/skills:claude-headlessfrom skills
Use when running Claude Code headless — claude -p, JSON output, claude calling claude, or a nested run that hangs, denies a tool or picks the wrong model.
Ships in skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
claude -p "<prompt>" runs one non-interactive turn-loop and exits. Calling it from
inside a running Claude Code session works — no environment cleanup needed. Facts below
verified against claude 2.1.261; when a flag misbehaves, claude --help is the
authority for the installed version.
A child does not inherit the parent session's model — it reads the saved user
default (~/.claude/settings.json, key model; this is where /model saves). To
guarantee the same model, pass it explicitly and verify:
MiniMax-M3-512k, or claude-opus-5-5 when on Claude. No environment variable
carries it.--model <exact-id> using that exact string, verbatim. Do not substitute
an Anthropic-family alias (fable, opus, sonnet, haiku) when the parent is on
a different provider; those aliases resolve inside the Anthropic namespace only, and
would silently swap the model.--output-format json, the modelUsage object is
keyed by the model ID that actually ran — assert it is the one you asked for.claude -p "Reply with exactly one word: PONG" \
--model MiniMax-M3-512k --output-format json \
| jq -er '.result, (.modelUsage | keys[0])'
Default to the model you're already on. Switch to fable / claude-fable-5-2 only
when the run's task sits at the frontier tier of skill model-routing — it is the most
expensive slot, and a one-shot -p call on it writes a fresh cache before it even
answers. The system prompt's "alternative models" list (typically the recent Claude
family plus Haiku) is the switch menu; your current model is often not on it when it
belongs to another provider. Pick the cheapest tier appropriate for the task, priced by
that provider's rate card, not Claude's.
A one-shot print run cannot ask. An unapproved tool call is denied (see
permission_denials in the JSON), so the run limps or stops instead of prompting.
Choose one:
--allowedTools "Bash(git *),Read,Edit" — pre-approve exactly what the task needs
(permission-rule syntax; the deny syntax is --disallowedTools).--permission-mode <mode> — auto, dontAsk, acceptEdits, plan,
bypassPermissions.--dangerously-skip-permissions (= bypassPermissions) — only inside an isolated
environment (container, throwaway VM), never on a working checkout you care about.A run that should ask instead needs the stream-json channel and
--permission-prompt-tool: references/stream-json.md.
Settings resolve against the child's cwd, not the parent's session: managed → user
(~/.claude/settings.json) → project (.claude/settings.json) → local
(.claude/settings.local.json), plus the cwd's CLAUDE.md, skills, agents, and hooks.
cd is the main
inheritance lever.--setting-sources user,project,local narrows which scopes load;
--settings <file-or-json> injects overrides; --bare skips hooks, plugins, MCP,
and CLAUDE.md discovery entirely — pass what it needs explicitly
(--append-system-prompt, --mcp-config, --agents).A -p child is a full session, not an isolated command. It appears in
claude agents --json as kind: interactive, named after its directory, and can call
ListAgents and SendMessage to reach the session that started it and every other
session on the machine. So it can talk back while it works, not only through its exit
JSON, and you can talk to it. See claude-cross-session.
stream-json output, --json-schema, several turns in one
process over stdin (the single turn is a choice, not a limit), a print run that
asks: references/stream-json.md.--max-turns, --max-budget-usd), resuming or continuing it,
session persistence, background commands the child starts (killed right after its
result), recursion detection: references/guard-rails.md.claude-cross-session — when you do not want a result but a counterpart: starting a
session elsewhere with claude --bg and talking to it while it runs.getty-agent-team — subagents within a session (skills preloaded); reach for
headless spawning only when a separate process is genuinely needed: clean context,
different cwd, CI, or another program driving Claude.What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (getty/skills) — no native marketplace selected
npx claudepluginhub p/getty-skills129 skills in this plugin
/ai-playable-gamesUse when building a game or simulation that bots or LLM agents must play — observation and order interface, agent API or MCP server, AI seats beside humans, fog of war, replays; or when an AI player cheats, stalls, misreads the state or follows text other players wrote./ai-web-scrapingUse when scraping, crawling or extracting structured data from websites, especially with an LLM — Crawl4AI, Firecrawl, Scrapy, Crawlee, Playwright, browser-use; building a dataset or RAG corpus, watching pages for changes, or a scraper that returns empty, duplicated or invented records./cedar-engineeringUse when writing, validating or debugging Cedar authorization policies — .cedar and .cedarschema files, permit/forbid, entities and hierarchies, RBAC/ABAC/ReBAC, templates, multi-tenant access, partial evaluation, Amazon Verified Permissions, migrating to or from Cedar.Other plugins' skills for the same job