Before you start
How to drive Claude Code headless in CI with structured JSON
This tutorial
What you’ll do: run cckit with no human watching — a CI bot or scheduled run that reads state as
structured data instead of scraping human output. Every verb that reports state takes --llm, so the
agent reasons over JSON (and TOON), picks the highest-priority unblocked issue, and drives it start to
finish.
-
Prime the headless agent. Tell it there’s no human and to consume data, not prose.
Prompt to paste You're running headless — no human watching. Work the board through to merged on your own: readstate as structured data, pick the highest-priority unblocked issue, and drive it start to finish.Keep token use lean when you hand context to sub-agents. -
Consume every verb as data.
Terminal window cckit sync --llm # board state + what's unblocked, as TOONcckit scan --llm # repo stack + kit state, as JSONcckit plan --llm # the session-fit wave plan, as TOON -
Compact context for sub-agents. Pipe uniform arrays through
encode-contextso hand-offs stay token-lean:Terminal window echo "$json" | cckit encode-context # compact uniform arrays into TOON for sub-agents
How it works
Section titled “How it works”cckit is agent-operable by design: every verb has a machine-readable mode and the repo ships an
AGENTS.md contract, so an agent reasons over structured data instead of scraping human
output. Point the agent at AGENTS.md once and it knows the grammar; --llm then gives it the board,
the stack, and the plan as JSON/TOON it can act on without a human in the loop.
Troubleshooting
Section titled “Troubleshooting”A verb printed human output in CI. Add --llm. Only the reporting verbs take it; if one still
prints prose, you’ve hit a verb that doesn’t report state (it just acts) — that’s expected.
The agent doesn’t know the verbs. It hasn’t read the contract. Have it read AGENTS.md and
cckit.config.json once at the start of the run.
Hand-offs are burning tokens. Pipe the JSON through cckit encode-context before handing it to a
sub-agent; TOON is materially smaller than the equivalent JSON.
Related tutorials
Section titled “Related tutorials”Independent, educational project — not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic PBC. Disclaimer & trademarks ·
From Mexico with love by josegtz