{"slug": "a-free-claude-code-skill-that-audits-your-cron-job-before-it-bills-you", "title": "A free Claude Code skill that audits your cron job before it bills you", "summary": "A developer released cron-preflight, a free read-only Claude Code skill that audits scheduled `claude -p` cron jobs for API-key billing leaks, missing `flock` overlap protection, absent `--max-turns`/`timeout` caps, and overly broad `--allowedTools` permissions, reporting PASS/FAIL with file:line references and fixes. The skill is distributed as a markdown SKILL.md file, and the developer also maintains the MIT-licensed agent-autopilot-kit cron launcher, which they say passes all ten checks.", "body_md": "Scheduling `claude -p` from cron is easy. Scheduling it so it can't silently bill an API key, overlap with itself,\n\nhang forever, or hammer a usage limit is where most setups fall short. I turned the checklist I use into a\n\nClaude Code **skill**: a plain markdown file Claude loads when you ask it to audit a scheduled run.\n\nIt is read-only. It reads your crontab and the script it calls, then reports PASS / FAIL with `file:line` and a fix.\n\n`ANTHROPIC_API_KEY` is set anywhere the cron job inherits it (script, sourced files,\n`/etc/environment`, `VAR=` lines in the crontab), `claude` may bill the API instead of your plan. Fix:\n`unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN` at the top of the script, unless API billing is intended.`flock -n` means a slow run plus the next tick gives you two agents editing the same files.`--max-turns` `timeout` around the whole command.`$HOME`; `cd` to the project first.`--allowedTools`, not a\nblanket `Bash(*)` or `--dangerously-skip-permissions` outside a sandbox.`@reboot` or a systemd unit if it must survive restarts.\nSave the file as `~/.claude/skills/cron-preflight/SKILL.md`, then ask Claude: \"run cron-preflight on my crontab\".\n\nFree download (pay what you want, $0 is fine):\n\n[https://spikeyjr.gumroad.com/l/claude-code-cron-preflight](https://spikeyjr.gumroad.com/l/claude-code-cron-preflight)\n\nThe output is a table, `# | Check | Result | Where | Fix`, and a one-line verdict. It never prints secret values\n\nit finds; it writes `<set>` instead.\n\nThe free, MIT-licensed [agent-autopilot-kit](https://github.com/spikeyjr/agent-autopilot-kit) is a cron launcher that\n\npasses all ten: flock, key stripping, turn cap, limit detection with a pause file, daily run cap, `@reboot`, logs.\n\nThere is also a paid pack of five more ops skills (session handoff, task slicing for short sessions, pre-publish secret\n\nscan, log triage, changelog from git) for people running Claude Code across many short sessions:\n\n[https://spikeyjr.gumroad.com/l/claude-code-headless-skills](https://spikeyjr.gumroad.com/l/claude-code-headless-skills)\n\n*Disclosure: I maintain the repo and sell the paid pack; this post was drafted with AI assistance. Unofficial, not affiliated with Anthropic.*", "url": "https://wpnews.pro/news/a-free-claude-code-skill-that-audits-your-cron-job-before-it-bills-you", "canonical_source": "https://dev.to/spikeyjt/a-free-claude-code-skill-that-audits-your-cron-job-before-it-bills-you-2mhe", "published_at": "2026-11-29 20:03:56+00:00", "updated_at": "2026-11-29 20:15:04.393180+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools"], "entities": ["Claude Code", "Anthropic", "agent-autopilot-kit", "Gumroad"], "also_reported_by": [], "takeaway": "Unset ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN at the top of a cron-invoked script unless API billing is intended, and wrap the whole `claude -p` command in `flock -n` plus `--max-turns` and `timeout` to prevent overlap and runaway runs.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/a-free-claude-code-skill-that-audits-your-cron-job-before-it-bills-you", "markdown": "https://wpnews.pro/news/a-free-claude-code-skill-that-audits-your-cron-job-before-it-bills-you.md", "text": "https://wpnews.pro/news/a-free-claude-code-skill-that-audits-your-cron-job-before-it-bills-you.txt", "jsonld": "https://wpnews.pro/news/a-free-claude-code-skill-that-audits-your-cron-job-before-it-bills-you.jsonld"}}