// book 2
patriola.com
Book 2 · Patriola’s Guide to Claude
What this book is
Workflows that run without you
A guide to the Claude workflows that run without you in the loop — hooks that fire when events happen, tasks that run on a schedule, and pipelines that carry Claude’s output into the next step without anyone driving. Drawn from production systems that have been running unattended for months.
What you’ll learnFive areas, one automated system
- hooks — Event-triggered Claude tasks using the four hook types:
PreToolUse,PostToolUse,Stop, andSubagentResult. Each hook is a shell command or Python script; non-zero exit fromPreToolUseblocks the tool call. Learn the failure modes that only surface at 2 a.m. - scheduling — Running Claude jobs on a clock: cron syntax (
0 6 * * 1for Monday 6 a.m.), Windows Task Scheduler, systemd timers on Linux. Non-interactive mode viaclaude --no-interactive --print, stdout captured to a date-stamped log file, exit code checked by the scheduler. - pipelines — Chaining Claude calls so each step’s output is the next step’s input: JSON handoff schema, exit-code contracts between steps, and how to design each stage so a failure leaves enough evidence to diagnose from the log alone — without re-running everything.
- background-jobs — Jobs that run without supervision: PID files to prevent double-runs,
EXITtraps for cleanup, log rotation with date-stamped file swap. How to design failure so a crashed job leaves evidence rather than silence — and how to wire a restart policy that doesn’t loop forever. - monitoring — Knowing a job finished cleanly without checking by hand: poll-based health checks on the output file’s last-modified timestamp, a watchdog process that re-launches on unexpected exit, and a daily summary job that reads all logs and surfaces anything that failed or stalled.
- scheduling — Cron-style task execution for Claude jobs that need to run on a clock rather than on demand.
- pipelines — Chaining Claude calls so the output of one step becomes the input of the next without manual handoffs.
- background-jobs — Jobs that run while you’re not watching — how to design them so they fail gracefully and log what matters.
- monitoring — How to know a background job is still running, finished cleanly, or silently failed without you checking it by hand.
A preview
“The goal of automation isn’t to remove yourself from the work. It’s to remove yourself from the parts that don’t need you — so the parts that do get more of your attention.”
You — Monday morning
What ran over the weekend? Summarize anything that finished, flagged errors, or is still in progress.
Claude
Three jobs ran. The weekly digest completed Saturday at 6:04 a.m. — output in reports/weekly-2026-05-31.md. The file-watch pipeline ran twice, both clean. The nightly summary job failed Saturday at 11:47 p.m. — log shows a missing input file at data/sources/feed.json. Still failing as of now; nothing has replaced that file.
“A pipeline that fails silently is worse than one that never ran. The difference between a useful automation and a broken one is almost always the log.”Who it’s for
Claude users ready to automate
Claude users who have a working daily workflow and want to stop doing the repetitive parts by hand. Prerequisites: comfortable with the Productivity daily loop.
A longer excerpt is available to newsletter subscribers.
You might also like
More from Patriola
Stay current
New books in this series
One short email per book launch.