A systemd timer on my desktop fires at 7:44 every Sunday. By about 9:20 it has turned a live YouTube stream into a fill-in-the-blank PDF and dropped it into a Slack DM. The middle step is claude -p — one headless Opus invocation that writes a worksheet, spawns two reviewer subagents, revises, and exits. I am asleep for the first thirty minutes of this and at church for the rest. Nothing in that pipeline can ask me a question.
Which is why the actual claude -p call is the most paranoid line of code in the project. If a Sunday morning Claude run accidentally inherited a stale session, half my MCP servers, or a CLAUDE.md from the wrong directory, the sermon would be over before the worksheet was written. So the subprocess call is fenced in on every side.
Here is the real invocation from inside the service:

Seven flags. Each one is there because something would have gone wrong without it.
--model and --effort
"--model", "claude-opus-5-5",
"--effort", "high",
Pin them. The global default on my machine shifts with mood — some weeks I default to Haiku for everything, some weeks Opus. A cron that has to produce a two-page document in under eight minutes is not where I want to find out my shell changed models on me last Tuesday. These two flags are “the model I tested this prompt against.” Nothing less.
--allowedTools with a scoped Bash glob
"--allowedTools",
"Read,Write,Edit,Agent,Task,Bash(/home/brettr/Projects/sermon-worksheet/bin/ws-check:*)",
Opus needs to read the transcript, write a draft worksheet, maybe edit it, launch its two reviewer subagents (Agent/Task), and — the important one — run my local checker to validate its draft.
What it does not need is Bash in general. The checker is the only shell command I want this run to be able to execute, so Bash is scoped to one binary. If Opus decides it would be clever to rm -rf /tmp or curl a ngrok URL, the tool call fails before it fires. This is the single most load-bearing flag in the whole invocation.
--strict-mcp-config with an empty config
"--strict-mcp-config",
"--mcp-config", "prompts/empty-mcp.json",
Where empty-mcp.json is, in full, three bytes of real content:
{"mcpServers":{}}
The run boots in milliseconds instead of twenty seconds, and nothing my morning hasn’t personally loaded can break it.
--setting-sources ""
"--setting-sources", "",
Normally Claude Code merges settings from your user config, your project config, and whatever CLAUDE.md files it walks up from the current working directory. All helpful at the keyboard. None helpful in a service.
The sermon-worksheet working directory is a run folder — runs/2026-11-15/ — with no CLAUDE.md of its own. If --setting-sources weren’t blanked, Claude would start walking parent directories looking for one, and the first hit would be my global CLAUDE.md, which has roughly nothing to do with building a church worksheet. Empty string, zero inheritance, done.
--no-session-persistence
"--no-session-persistence",
No session file written to disk, no session file read on startup. Every Sunday morning run is its own universe. If last Sunday’s run died in a funny state, this Sunday doesn’t know and doesn’t care.
--agents pointing at a local JSON
"--agents", "prompts/agents.json",
The two reviewer subagents — pew-tester and sermon-editor — live in a file inside the project. Their prompts are checked into git with the rest of the code, which means a change to how the editor agent thinks is a commit, not a mystery. The main Opus call launches them via the Agent tool and they inherit the same fenced invocation: one allowed tool (Read), no MCP, no persistence, scoped to the run folder.
The “ship what’s on disk” fallback
The flags are half the story. The other half is that none of them can save me when Claude just times out.
The timeout is 11 minutes. If it expires, Python keeps going. It loads whatever worksheet.json is on disk, validates it, and if anything is on disk that validates and fits on two pages, that is what ships. If the first draft never passed the checker, there’s one quick repair pass — same claude -p call, no reviewers, 5-minute budget — and if that also fails, we raise.
if ws is None:
log(f"not usable ({errs[:3]}); one repair pass")
rc, out = run_claude(fix, run, 300, agents=False)
Every pass writes its full stdout and stderr to a file in the run folder. On a quiet Sunday I never look. On the one Sunday the timer fires and nothing arrives, the log is already sitting there with the exact error and the last known-good draft on disk.
Treat the agent like a subprocess, not a shell session.
— the rule under all seven flags
What the fencing really buys
None of these flags make the worksheet better. The prompt does that. These are the flags that keep the worksheet from not existing — the ones that let the same invocation run the same way whether I’m at my desk, in a tent, or on the other side of a church lobby getting kids checked in.
The rule is the whole lesson. A claude -p call inside a cron is not you at your terminal. Your terminal has twenty years of config that mostly helps you. A cron has a ten-minute window and no supervisor. Strip out everything it does not need, scope every tool it does, and write the known-good draft to disk before you let anything new overwrite it.
The timer fires in about twenty minutes from when this post goes up. I will be at the 8am service. If nothing is wrong, I will know because a PDF shows up in my DMs around 9:20 and I will print it on the way to the 10.
If something is wrong, I will know because the run log is already on disk by the time I think to look.