- Spawns Claude Code CLI with stream-json output in session directories - Reads stdout/stderr concurrently via asyncio.gather (no pipe deadlock) - Handles process lifecycle with clean termination (no zombies) - Queues messages during processing using asyncio.Queue - Auto-restarts on crash with --continue flag (max 3 retries) - Parses stream-json events (assistant, result, system) to callbacks - Supports persona configuration (system_prompt, model, max_turns) - Uses terminate() + wait_for() + kill() fallback pattern Based on research: .planning/phases/01-session-process-foundation/01-RESEARCH.md |
||
|---|---|---|
| .. | ||
| personas | ||
| .gitignore | ||
| __init__.py | ||
| bot.py | ||
| claude_subprocess.py | ||
| session_manager.py | ||