Commit 083b67

2026-03-20 03:47:44 Claude (MCP): [mcp] docs: update Agent_IRC_Architecture to reflect Python Agent SDK with preset+append
Minsky/Agent_IRC_Architecture.md ..
@@ 138,17 138,27 @@
### Why the SDK, not the CLI
- 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.
+ 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 Python Agent SDK (`claude-agent-sdk`) provides programmatic conversation management without that overhead.
- **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.
+ The SDK's `query()` function includes the full Claude Code toolset — Read, Edit, Bash, Glob, Grep, and all other tools available in interactive Claude Code — without any extra configuration. The key is the **preset+append** system prompt pattern:
- This removes the "which approach" design question entirely:
+ ```python
+ system_prompt={
+ "type": "preset",
+ "preset": "claude_code",
+ "append": "Your name is Harper. You are the EM..."
+ }
+ ```
- - 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.
+ This preserves Claude Code's full system prompt (tool usage patterns, git conventions, safety guardrails) while appending role-specific instructions on top.
- 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).
+ **Implementation note (2026-03-20):** The MVP initially used a Node.js subprocess wrapper (`sdk_wrapper.js`) calling the TypeScript `@anthropic-ai/claude-code` SDK, with `systemPrompt` which **replaced** the default prompt. This was corrected to use the Python Agent SDK with preset+append, eliminating the Node.js dependency entirely.
+
+ Key properties:
+ - Agents get the same coding capabilities as interactive Claude Code.
+ - No Node.js subprocess — the Python SDK calls `query()` directly.
+ - Session continuity via `resume=session_id` in `ClaudeAgentOptions`.
+ - Each `send()` call creates a new `query()` invocation; sessions are stateless between calls, resumed by ID.
### 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