Recipes / Claude Code use cases
Claude CodeWorkflowDev & code

Treat the workflow, not the agent, as the product

Replies describe running Claude Code headless with claude -p from scripts and cron, wrapped in a simple state machine: task record, bounded run, artifacts, checks, human approval.

From r/ClaudeCode on Reddit · Mar 2026

Setup time30 min
CostIncluded in plan
RunsPer automated task
NeedsClaude Code (claude -p), scripts or CI
Last updated2026-10-20

What the source did

  • One commenter runs several headless instances in tmux and chains tasks with a bash script.
  • Another suggests layering: CLAUDE.md rules, then a few skills, then a typecheck hook.
  • Another lays out a safe automation shape that ends in human approval before merge.

Summary written by Agent Cookbook from the original post. See the original for the full context. How we source recipes

Our notes

What it takes
A task file per job, claude -p with a narrow --allowedTools list, and checks that run outside the agent. One commenter chains tasks with a bash script in tmux; another keeps a run ledger with the task record, artifacts and a handoff per run.
Where it breaks
Automating plan approval too early, which a commenter warns against, and a CLAUDE.md that keeps growing; one commenter keeps it under about 100 lines and moves the rest into skills and hooks.
Human checkpoint
A human approves the plan and the merge; the checks run outside the agent and the script never merges.
Tools involved
Claude Code (claude -p), scripts or CI

✓ Verified Source link checked and still live. Notes by Thomas, editor. How we verify

Copy the prompt

Ours Our version, based on what r/ClaudeCode described. Not their wording. Fill in the [BRACKETS].

claude -p with this prompt, from a script: Task: [TASK RECORD: repo, path, objective, constraints]. Work only in [PATH]. When done, write handoff.md: files changed, assumptions, tests run, open questions. Do not commit. (The script then runs [CHECKS] outside the agent and only notifies me if they pass.)

Approval rule

🛡
Plans and merges are approved by a human; the script never auto-merges.

Set it up

  1. Write a task file per job.
  2. Run claude -p with --allowedTools limited to what the task needs.
  3. Run checks outside the agent.
  4. Review handoff.md and approve the merge.

Common failures

⚠
  • Automating plan approval too early.
  • No artifact means you can't tell the run happened; always write handoff.md.

Variations

  • Same pattern with codex exec.

Get the 10 best agent setups. Free.

Plus new recipes every week. One email, no spam.

Unsubscribe anytime. Privacy

Related recipes

Same job: Dev & code

Claude CodeFull setup

Claude Code fault-test loop found 55 Ceph bugs

Alex Ainscow, who works on Ceph's erasure coding, let Claude Code run a loop on upstream Ceph: inject faults into a one-machine test cluster, catch what breaks, work out why, write a unit test that fails, fix it, rebuild and go again. Across his runs it found 55 real defects, 32 of them in code already on main, for about $840 of API time on the first two sessions.

His first two long sessions were 87 hours of Claude Code work (one overnight, one over a weekend); later runs ran overnightvia Ceph.io
Claude CodeWorkflow

Claude Code Built a Test Rig to Fix Dead Space Stutter

The 2023 Dead Space remake hitched badly when the game loaded the next area. Lukeman3000 had Claude Code reverse engineer the closed executable, build a test rig that replays his recorded input, and then fix the stutter. The result, Ishimura Patch, was featured by Wccftech and Digital Foundry. His numbers come from one PC.

About 3 weeks. He put well over a hundred hours in, mostly directing Claude and running testsvia Reddit
Claude CodeWorkflow

Claude Code app UIs that look and move like a designer's

Breeje Anadkat says the app UIs he builds with Claude Code that look and move well took several rounds of prompting, not one. He starts by telling Claude what the app does and sharing UI and motion references. For some screens he designs in Figma first and puts it next to the build to list exactly what must change. He tests by tapping through the app, because a transition can look great in a clip and still feel slow.

Not stated. He says most screens took several rounds of promptingvia X

More Claude Code recipes

In these guides: More Claude Code use cases →

Read original ↗