headless

A setup guide for making Claude Code run many separate, temporary sessions from a shell script, one input item at a time.

In plain words
What is it for?
Use it to create a batch script, its instructions, and optionally an input list for bulk development tasks.
Why use it?
It helps automate repeated work such as migrating files, fixing lint errors, or generating documentation without managing each session manually.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ralfstrobel/agentic-brownfield-coding/headless
Any agent
npx skills add ralfstrobel/agentic-brownfield-coding --skill headless
Clone the repo
git clone --depth 1 https://github.com/ralfstrobel/agentic-brownfield-coding

Made for: Claude Code, Codex.

Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,531 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00047 $0.02531
Opus 5 $0.00023 $0.01265
Sonnet 5 $0.00009 $0.00506
Haiku 4.5 $0.00005 $0.00253

Measured 2d ago against content hash 416264b90d72, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

headless scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (templates/foreach-file.sh, templates/foreach-line.sh, templates/foreach-task-parallel.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

claude-plugins/abc-init/skills/headless/SKILL.md · 160 lines

How it starts

The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Claude Code Headless Batch Setup

Your goal is to help the user assemble a small shell script that drives claude -p over many inputs, running one ephemeral micro-session per item. The result usually lives under .claude/headless/ and pairs a driver script (*.sh) with a system prompt file (*.md) and potentially an input list file.

Additional user arguments: $ARGUMENTS

Language hint: Always create all generated script content and comments in English, while continuing to speak to the user in the language of their choice.

Platform hint: Instructions and templates assume a Linux host with GNU coreutils. Adapt to the detected user OS.

  • macOS — Substitute BSD equivalents for GNU-only utilities.
  • Windows — Still use .sh files (skip irrelevant chmod +x), assuming Git Bash is available at runtime.

Workflow

  1. Ensure the user intent is clear. If user arguments are absent or ambiguous, especially regarding the upcoming decisions, elicit the necessary information via informal conversation with the user.
  2. Advise the user on a sensible strategy using the given background as reference. Push back on choices that are likely to cause token usage escalation, contention, or silent failures.
  3. Pick the best suited template and copy it to .claude/headless/<descriptive-name>.sh and chmod +x it.
    • foreach-file.sh — one invocation per file matching a glob argument.
    • foreach-line.sh — one invocation per line of stdin (PR numbers, IDs, URLs).
    • foreach-task.sh — one invocation per unchecked item in a sibling checklist file. This is the most powerful driver script, capable of ingesting, tracking and resuming progress on arbitrary items. Use when the user wants to prepare and iterate on hand-curated task list (in this or a separate session).
    • foreach-task-parallel.sh — same as foreach-task.sh but runs BATCH_SIZE tasks concurrently per batch. However, tasks with overlapping access scope will race. Check the assumptions block at the top of the script for compatibility before suggesting this option.
  4. Copy the matching prompt template to .claude/headless/<descriptive-name>.md.
  5. Tune the parameters in the script such as CLAUDE_ARGS and BATCH_SIZE per the decisions below.
  6. Review the generated content and flag relevant pitfalls that apply to this setup.
  7. Remind the user how to run the script from the current working directory, suggesting a test run on the first items (script can be aborted at any time using Ctrl+C).

Read the full file on GitHub · 160 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 160 lines · 47 tokens per session scan A 416264b90d72

Subscribe to this mod's changes

headless is a skill published in the GitHub repository ralfstrobel/agentic-brownfield-coding (28 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 47 tokens to every session and 2,531 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

claude-md-writer

Use when creating or refactoring CLAUDE.md files - enforces best practices for size, structure, and content organization.

serejaris/personal-corp-os · 30 tokens

fable-ruki-agenty

Фейбл руки-агенты — ручной режим оркестрации, где Fable не пишет код, а пишет спеки в тела GH issues и раздаёт готовые задачи рукам: кодинг, код-ревью, gh-операции, CLI-механика, DoD-верификация и укладка файлов — Codex; разведка, чтение и скауты — Grok-воркеры через Orca. Вызывается пользователем явно, не моделью.

serejaris/personal-corp-os · 116 tokens

explore-codebase

MUST BE USED PROACTIVELY. Universal read-only codebase exploration. Combines jrag graph navigation (call chains, routes, service boundaries, impact analysis, FQN resolution) with broad file-system search (grep, glob, file reading). Use for any exploration: locating code, tracing dependencies, finding patterns, 'where…

HumanBean17/jrag · 117 tokens

paperclip-api

Use when managing Paperclip AI agent companies - creating tasks, managing agents, approving hires, running heartbeats, or any Paperclip control-plane operations via CLI or REST API. Triggers on "paperclip", "задача агенту", "одобри найм", "heartbeat", "запусти агента".

serejaris/personal-corp-os · 71 tokens

dispatching-parallel-agents

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies.

HumanBean17/jrag · 26 tokens

subagent-driven-development

Use when executing implementation plans with independent tasks in the current session.

HumanBean17/jrag · 17 tokens