jcrabapple/hermes-skills/cron-llm-wrapper-audit

Claude Code and agent skill by jcrabapple/hermes-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Detect and fix the "LLM-wrapping-cron-job" anti-pattern — when a cron job uses an LLM only to reformat/confirm a pre-run script's output, adding cost with no value. Use during spend audits, when `hermes-spend --top jobs` shows a job dominating token spend, or when a watchdog-style job is suspected of being pure overhead. Saves 60-99% of job cost in typical cases by converting to `no_agent: true` (proper watchdog pattern).

Install

npx vskill@latest install jcrabapple/hermes-skills/cron-llm-wrapper-audit

SKILL.md

The same SKILL.md was published earlier as jcrabapple/hermes-skills/cron-llm-wrapper-audit.

Cron LLM-Wrapper Audit

Find cron jobs where the LLM is just reformatting a script's output, and convert them to no_agent: true so the script can do its job without a token tax.

When to use

  • hermes-spend --top jobs shows a job dominating the spend leaderboard
  • A cron job has both a script: field AND uses an LLM
  • A watchdog/monitor job runs very frequently (e.g., every 5 minutes)
  • Output of a cron job is "all healthy" with no signal delivered to the user
  • User asks to audit cron spend / reduce token usage

Detection

bash
# 1. See the worst offenders
hermes-spend --week --top jobs -n 10
# 2. For each top job, look at the prompt and a recent session
hermes cron list
# For a suspect job:
session_search(query="<job name>", limit=3)

Anti-pattern signature

A cron job is wasting LLM tokens when ALL of these are true:

  • Has a script: field (pre-run script does the real work)
  • The LLM prompt is something like "Format the X results from the pre-run

script output"

  • The LLM's actual work is rephrasing the script's output (often

re-running the same checks the script already did)

  • The deliver target is local (output is just saved to a file nobody reads)
  • The job runs frequently (every few minutes) — compounds the waste

Fix

bash
# 1. Verify the script can stand alone (does it alert on failure?)
grep -i "alert\|send\|email\|notify" ~/.hermes/scripts/<job_script>.py
# 2. Convert to no_agent (keeps the script, drops the LLM)
hermes cron update <job_id> --no-agent --prompt ""
# 3. Make the script silent on success (proper watchdog pattern)
# Find lines like `print("X is healthy")` followed by sys.exit(0)
# Replace with `# silent on success — alert is the only signal`
# In `no_agent` mode, non-empty stdout gets delivered as a message,
# so silence on success is essential to avoid spam.

The script should:

  • Exit 0 silently on success
  • Print to stdout OR send an alert (email/etc.) only on failure
  • Handle its own restart/recovery logic (don't rely on the LLM)

Verification

bash
# 1. Force a run and check the output is now tiny (~159 bytes vs 50KB+)
hermes cron run <job_id>
ls -t /var~.hermes/cron/output/<job_id>/ | head -1
# Should be ~159 bytes with "Mode: no_agent (script)" in the header
# 2. Confirm cost is dropping
hermes-spend --days 1 --top jobs -n 5
# The job should no longer appear in the top spenders
# Note: 1d window still includes old LLM runs for ~24h after conversion
# 3. Confirm alerts still work (test by stopping the service briefly)
# e.g., podman stop <service> && wait for cron tick && check inbox
# 4. Clean up the stale output directory
rm -rf /var~.hermes/cron/output/<job_id>/
mkdir -p /var~.hermes/cron/output/<job_id>/

Pitfalls

  • Don't break alerting. The script MUST still send an email/notification

on failure before you convert. Check send_alert or equivalent first.

  • Cron prompts must not reference `send_message`. The send_message

tool is NOT available in cron sessions. If a cron job's prompt says "Use send_message with target='discord' to deliver," the agent will fail or produce error output instead of the digest. The scheduler auto-delivers the agent's final response to the job's deliver target. When fixing a cron prompt, add this header at the top: [IMPORTANT: You are running as a scheduled cron job. DELIVERY: Your final response will be automatically delivered to Discord — do NOT call send_message or any messaging tool. Just write your final response as plain text/markdown.]

  • Not all LLM cron jobs are wasteful. A job where the LLM does real

analysis (blog post writing, weather report drafting, weekly digests) is legitimate. The waste is specifically when the LLM only rephrases the script's already-actionable output.

  • Watch for "broken skill" references. If a cron job's skills: field

references a skill that doesn't exist, every run reports "⚠️ Skill(s) not found and skipped". Fix at the same time by listing the actual skill that exists.

  • Don't reduce frequency first. Removing the LLM is the main win;

frequency reduction is a smaller, secondary optimization.

  • Watch the boot grace period. If the script deliberately skips checks

during a startup window, that's correct behavior — keep it.

  • GET PID race on Linux: scripts that pick the lowest PID via

pgrep -f <name> may match the cron's own subshell during the first few seconds after a container restart. A BOOT_GRACE_SECONDS window mitigates this; otherwise filter by comm rather than cmdline.

Worked example (Hindsight Health Monitor, 2026-06-11)

A 5-minute cron job (*/5 * * * *) that was using 60% of weekly spend:

BeforeAfter
LLM wraps hindsight_health_check.pyno_agent: true
Output: ~50KB of skill docs + LLM rephrasingOutput: 159 bytes (silent)
288 runs/day × $0.0049 = $1.05/day$0/day
14,077 stale output files (245MB)0

The script was already doing everything: container check, health endpoint check, preemptive deadlock detection, auto-restart, email alert on failure. The LLM added nothing. Same fix generalizes to any watchdog with send_alert built in.

Related

  • cron-debugging — for fixing individual cron job issues
  • spend-dashboard — for understanding the cost telemetry
  • hermes-spend CLI — hermes-spend --help for all options
  • skill-friction-detector — meta-audit that may also catch this pattern

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jcrabapple/hermes-skills/cron-llm-wrapper-audit/badge)](https://verified-skill.com/skills/jcrabapple/hermes-skills/cron-llm-wrapper-audit)

Something wrong with this skill or its page? Tell us.