Commit e80ba1

2026-03-19 23:17:48 Claude (MCP): [mcp] Correct SDK finding: ClaudeSDKClient includes full Claude Code toolset
Minsky/Agent_IRC_Architecture.md ..
@@ 138,15 138,17 @@
### Why the SDK, not the CLI
- The Claude Code CLI is designed for a human at a terminal — prompt handling, display rendering, keybindings are all overhead when the consumer is a daemon. The Claude Code SDK gives programmatic conversation management: send messages, get responses, and critically — start a new conversation with a handoff summary when context gets thin. That's the "compaction" equivalent: not clearing context, but gracefully retiring the agent and spawning a fresh one with the summary.
+ The Claude Code CLI is designed for a human at a terminal — prompt handling, display rendering, and keybindings are all overhead when the consumer is a daemon. The Claude Code SDK (`claude_agent_sdk`, `ClaudeSDKClient`) provides programmatic conversation management without that overhead.
- **Important finding (2026-03-19):** The Claude Code SDK does **not** include Claude Code's system prompt or tool definitions. Those are baked into the CLI binary. This means SDK agents start with a blank slate — no file read/write/edit tools, no git tools, no Bash tool. Options:
+ **Corrected finding (2026-03-19):** An earlier version of this spec noted that the SDK did not include Claude Code's tool definitions and that agents would start with a blank slate. This was wrong. `ClaudeSDKClient` includes the full Claude Code toolset — Read, Edit, Bash, Glob, Grep, and all other tools available in interactive Claude Code — without any extra configuration.
- 1. **Write your own system prompt + tools from scratch** with the SDK. Full lifecycle control, but you lose Claude Code's well-tuned coding toolset.
- 2. **Run the CLI in `--print` mode** to get the full Claude Code toolset. Less session lifecycle control, but agents get the same capabilities as interactive Claude Code.
- 3. **Hybrid**: use the SDK for session management but shell out to the CLI for actual coding tasks.
+ This removes the "which approach" design question entirely:
- This is an open design question for the supervisor. The system prompt and tool definitions may be significant for coding task quality — worth experimenting before committing to an approach.
+ - Agents get the same coding capabilities as interactive Claude Code.
+ - No need to write custom tool definitions or shell out to the CLI for actual coding work.
+ - `--append-system-prompt` injects agent-specific instructions (role, name, channel assignments) on top of the existing Claude Code defaults.
+
+ Session state is maintained **in-process** across `query()` calls — no subprocess is spawned per turn. Sessions can also be resumed across process restarts via session ID, and forked to branch conversations. These properties directly improve shift-change handling (see below).
### Polling and dispatch
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9