Context
The Agent SDK spawns a full Claude Code process per subprocess — a heavy Node.js runtime with 20-30s startup time and significant memory usage. For pipeline stages that only need simple API calls (e.g., a quick review pass), this overhead may be excessive.
This issue tracks investigation into lighter alternatives for sub-agent execution.
Alternatives to Investigate
1. Direct Anthropic API calls with tool loop
- Skip the Agent SDK entirely for simple tasks
- Use
@anthropic-ai/sdk to make raw Messages API calls
- Implement a minimal tool loop (read file → respond → done)
- Startup: near-instant (no CC process)
- Downside: must implement tool execution manually
2. Lighter agent frameworks
- Investigate frameworks that provide agent loops without full CC overhead
- e.g., Vercel AI SDK, LangChain.js, or custom minimal loop
- Trade-off: less CC integration but faster startup
3. Agent SDK optimizations
- Profile the Agent SDK subprocess startup
- Identify which CC initialization steps are unnecessary for review-only tasks
- Propose SDK configuration to reduce startup overhead
Acceptance Criteria
Priority
Low — the Agent SDK approach works and should be used for Phase 1. This investigation is for future optimization.
Dependencies
- Requires performance data from the Agent SDK direct-connect spike
Context
The Agent SDK spawns a full Claude Code process per subprocess — a heavy Node.js runtime with 20-30s startup time and significant memory usage. For pipeline stages that only need simple API calls (e.g., a quick review pass), this overhead may be excessive.
This issue tracks investigation into lighter alternatives for sub-agent execution.
Alternatives to Investigate
1. Direct Anthropic API calls with tool loop
@anthropic-ai/sdkto make raw Messages API calls2. Lighter agent frameworks
3. Agent SDK optimizations
Acceptance Criteria
Priority
Low — the Agent SDK approach works and should be used for Phase 1. This investigation is for future optimization.
Dependencies