open-index/open-npm huggingface dataset:
npm package: @humanlayer/autotune
Description: Claude SDK PoC
Latest version: 0.0.4

# Claude SDK POC

Multi-agent research orchestrator using the Claude Agent SDK. Spawns parallel specialized agents to gather codebase context for implementation planning.

## Usage

```bash
# New interactive session
bun run dev                          # Interactive prompt
bun run dev "your research query"    # With initial query
bun run dev --cwd /path/to/repo      # Custom working directory

# Continue/Resume sessions
bun run dev --continue               # Continue most recent session
bun run dev --resume SESSION_ID      # Resume specific session by ID
bun run dev:continue                 # Shortcut for --continue

# Headless/piped mode (runs query and exits)
echo "your query" | bun run dev      # Pipe input
cat query.txt | bun run dev          # From file
```

## Interactive Session

After the initial query, the session stays open for follow-ups:

```
<session_id> > your follow-up question here
```

### Exiting
- Type `EXIT` and press Enter
- Press Ctrl+C
- Press Ctrl+D

### Session Continuation
- Session IDs are displayed when a session starts
- Use `--resume SESSION_ID` to resume any previous session
- Use `--continue` to resume the most recent session
- Both continuation modes fork the session (original is preserved)

## Headless Mode

When stdin is not a TTY (piped input), the tool runs in headless mode:
- Runs the query and prints the result to stdout
- Prints session ID to stderr (for scripting/resume)
- Exits after the first response (no interactive prompt)

## Structure

- `index.ts` - CLI entry point (Commander.js)
- `src/interactive.ts` - Interactive session handler
- `src/research.ts` - Research orchestrator (legacy one-shot mode)
- `src/agents/` - 4 specialized research agents

## Key Files

| File | Purpose |
|------|---------|
| [src/interactive.ts](src/interactive.ts) | Interactive session with AsyncIterable prompt |
| [src/research.ts](src/research.ts) | Legacy `planning1Research()` function |
| [src/agents/index.ts](src/agents/index.ts) | Agent exports |
| [src/evals/run-evals.ts](src/evals/run-evals.ts) | Eval runner with `WorkflowFn` type |

## If Working On...

**Interactive mode**: See [src/interactive.ts](src/interactive.ts). Uses SDK's AsyncIterable prompt mode for multi-turn conversations.

**Evals**: See [src/evals/](src/evals/). Run `bun run eval`, accept with `bun run eval:accept`, diff with `bun run eval:diff`.

**New workflow function**: Export from `src/research.ts` matching `(input: ResearchInput) => Promise<ResearchResult>`, then add eval cases in `run-evals.ts`.

**Agents**: See [src/agents/](src/agents/). Each agent is an `AgentDefinition` with `description`, `tools`, `model`, `prompt`.

## References

- [SDK Documentation](/Users/dex/go/src/github.com/humanlayer/synclayer/thoughts/shared/docs/2025-11-29-claude-sdk-typescript.md) - Claude TypeScript SDK usage
- [Implementation Plan](../../../thoughts/shared/plans/2025-11-29-planning1-research-workflow.md) - Full planning doc