@agent-dashboard/adapter-claude-code
v0.1.4
Published
The first-party adapter that lets the Agent Dashboard spawn and observe Claude Code agents.
Downloads
568
Readme
@agent-dashboard/adapter-claude-code
The first-party adapter that lets the Agent Dashboard spawn and observe Claude Code agents.
Usage
import { claudeCodeAdapter } from '@agent-dashboard/adapter-claude-code';
claudeCodeAdapter.on('agent.tool_called', (p) => console.log(p.tool, p.arg));
const handle = await claudeCodeAdapter.startTask({
agentId: 'agent-1',
storyId: '1.1',
story: { /* parsed BMAD story */ },
workspaceDir: process.cwd(),
});The adapter requires claude on PATH. The orchestrator (Story 4.3+)
constructs an instance via createClaudeCodeAdapter({ command, args })
when it needs to point at a different binary.
Overriding the binary (tests)
Pass command to createClaudeCodeAdapter to point at any executable
that consumes the prompt over stdin and emits Claude-style stdout lines.
The bundled test fixture at tests/fixtures/fake-claude.mjs is the
reference implementation used by the adapter's own test suite.
import { createClaudeCodeAdapter } from '@agent-dashboard/adapter-claude-code';
const adapter = createClaudeCodeAdapter({
command: process.execPath,
args: ['./tests/fixtures/fake-claude.mjs'],
});Forking as a template
The adapter is intentionally small (≤300 lines under src/). Use it
as the starting point for adapters targeting Cursor, Aider, Codex, or
any other agent runtime:
- Copy this package and rename it.
- Replace
parseClaudeLinewith the heuristic for your runtime's stdout format. - Replace
buildPromptwith the prompt template your runtime expects. - Update
runtimeandcommanddefaults. - The shape of
claudeCodeAdapter, the lifecycle (start → events → completed/crashed/killed), and the cross-platform spawn/kill helper in@agent-dashboard/coreare all reusable as-is.
See @agent-dashboard/protocol for the
contract every adapter implements.
