claude_code
claude_code
¶
ClaudeCodeAgent -- wraps the Claude Agent SDK via Node.js subprocess bridge.
Spawns a Node.js runner process that calls the @anthropic-ai/claude-code
SDK, communicating via JSON over stdin/stdout with sentinel-delimited output.
The engine parameter is accepted for interface conformance with BaseAgent but is not used -- inference is handled entirely by the Claude Agent SDK.
Classes¶
ClaudeCodeAgent
¶
ClaudeCodeAgent(engine: InferenceEngine, model: str, *, bus: Optional[EventBus] = None, temperature: float = 0.7, max_tokens: int = 1024, api_key: str = '', workspace: str = '', session_id: str = '', allowed_tools: Optional[List[str]] = None, system_prompt: str = '', timeout: int = 300)
Bases: BaseAgent
Agent that wraps the Claude Agent SDK via a Node.js subprocess.
Spawns a Node.js process running dist/index.js which imports
@anthropic-ai/claude-code and streams agentic responses. Results
are communicated back via sentinel-delimited JSON on stdout.
The engine parameter is accepted for BaseAgent interface conformance
but is not used -- all inference is handled by the Claude Agent SDK.
Source code in src/openjarvis/agents/claude_code.py
Functions¶
run
¶
run(input: str, context: Optional[AgentContext] = None, **kwargs: Any) -> AgentResult
Execute a query via the Claude Agent SDK subprocess.
Spawns node dist/index.js, writes a JSON request to stdin, and
reads sentinel-delimited JSON output from stdout.