How do you automate your workflow with claude code?
by r/ClaudeCode commenters · not retrieved
✓ Reddit blocks our fetcher (login wall). Thread content confirmed via a search-engine snapshot on 2026-10-15; the username wasn't in that snapshot.
Read the original ↗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.
- 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. See the original for the full context.
Adapted by us from what the source described. Fill in the [BRACKETS].
The prompt
Set it up
- Write a task file per job.
- Run claude -p with --allowedTools limited to what the task needs.
- Run checks outside the agent.
- 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.