Expand description
ClaudeCodeExecutor: drives the official Claude Code CLI as a
ChildExecutor (ExecutorSpec::ClaudeCode), sibling of subagent_worker.
ClaudeCodeExecutor: a [ChildExecutor] that drives the official Claude
Code CLI (claude) as an external sub-agent engine over its stream-json
wire protocol. See docs/claude-code-executor.md for the full protocol
reference (spawn flags, NDJSON frame table, permission relay, shutdown)
this implementation follows.
MVP scope (issue #441): spawn a fresh claude process per run() call
(one activation = one turn), map its stdout frames onto the same
AgentEvents the real bamboo runtime emits (so the parent’s child preview
renders identically — see BambooRuntimeExecutor),
and relay can_use_tool permission asks through [EventSink::host] when a
host bridge is wired. Mid-turn steering remains out of scope — see the doc
comment on [ChildExecutor::run]’s steer parameter below.
Session resume (issue #444): RunSpec.messages empty/non-empty is the
discriminant a reactivation ships (proto.rs:28). A non-empty shipment
means this activation has prior context, resolved by [ClaudeCodeExecutor::run]
in four steps — see its doc comment for the full state-machine and
docs/claude-code-executor.md §4 for the on-disk state file shape.
Structs§
- Claude
Code Executor - Drives
claude --output-format stream-json --input-format stream-json ...as the engine behind one sub-agent run.
Functions§
- resolve_
claude_ code_ state_ dir - Resolve this actor’s stable per-child storage dir, exactly like
BambooRuntimeExecutor::build(subagent_worker.rs:194-202):spec.storage_dirwhen the parent already isolated it, else a temp dir keyed bychild_id— stable across activations of the SAME child. BothExecutorSpec::ClaudeCodefactory arms (subagent_worker.rs,broker_agent.rs) call this to giveClaudeCodeExecutor::new’sstate_dira location the resumed-session state file (issue #444) survives in.