Install any skill in seconds. Free to start, no credit card required.
Get Started Free →aiskillstore/claude-code-headless
Run Claude Code programmatically without interactive UI.
Passed 16 of 21 test cases with the skill, and 11 of 21 without it.
and 4 more in the full report
8 fixed9 passed either way3 still failing2 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 8 test cases the skill fixed. Same model, same prompt, with and without the skill.
I need to monitor API usage costs programmatically after running a headless Claude Code command in a script. What JSON schema field returned in success responses contains the dollar cost of the run?
| Checked | Without skill | With skill |
|---|---|---|
| The response identifies total_cost_usd as the JSON field for run cost. | Passed | Passed |
| The response specifies --output-format json for structured output. | Missed | Passed |
The instructions your model reads when the skill loads.
Run Claude Code from scripts without interactive UI.
# Basic headless execution
claude -p "Explain this code" --allowedTools "Read,Grep"
# JSON output for parsing
claude -p "List files" --output-format json
# Continue conversation
claude -p "Start analysis" --output-format json > result.json
session=$(jq -r '.session_id' result.json)
claude --resume "$session" "Now fix the issues"
| Flag | Description |
|---|---|
-p, --print | Non-interactive (headless) mode |
--output-format | text, json, stream-json |
-r, --resume | Resume by session ID |
-c, --continue | Continue most recent session |
--allowedTools | Comma-separated allowed tools |
--disallowedTools | Comma-separated denied tools |
--mcp-config | Path to MCP server config JSON |
--verbose | Enable verbose logging |
--append-system-prompt | Add to system prompt |
| Mode | Flag | Effect |
|---|---|---|
| Default | (none) | Prompt for permissions |
| Accept edits | --permission-mode acceptEdits | Auto-accept file changes |
| Bypass | --permission-mode bypassPermissions | Skip all prompts |
test cases passed, vs 11 / 21 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.