What problem does it solve?
This skill helps you reliably run and debug programmatic Claude Code (CC) workflows, including tool access, budgeting, streaming, and multi-turn session management, without losing valid output on non-zero exits.
Core Features & Use Cases
- Claude Code subprocess orchestration: Runs the
claude CLI as a child process in Python (via claude-agent-sdk) or directly (claude -p) for automation.
- Budget + permission governance: Enforces
--max-budget-usd and tool access modes (e.g., --allowedTools) to prevent runaway spending and unsafe tool use.
- Session persistence + routing integration: Supports session resume via
agent_id and integrates as a prioritized provider in a model router with escalation logic.
- Production-grade operational guardrails: Handles nested-session recursion (skips CC SDK if already inside
CLAUDE_CODE_SESSION), cleans orphaned subprocesses on timeout, and preserves streamed output even when the CLI exits with warnings.
Quick Start
Use the claude_agent_sdk wrapper to analyze a business situation with a tight max budget so the model router can fall back safely if CC SDK fails.