Post 5: The Autonomous Pipeline — Cron Jobs That Run While You Sleep
May 31, 2026 · 5 min read
In Post 4, we built the team: Supervisor, Coder, Reviewer, and QC. Four agents, each with one job. But they don’t do anything unless someone tells them to.
Today we wire the autonomous nervous system. The cron pipeline that wakes up every 30 minutes, checks GitHub for new issues, routes them to the right agent, and reports back. All without a human touching anything.
The Pipeline Design
Hermes has a built-in cron scheduler. It runs jobs on a schedule, spawns agents in fresh sessions, and delivers results to any platform. Here’s our pipeline:
Every 30 minutes:
1. Poll GitHub Issues API (filter: label=bug, created <1hr ago)
2. For each NEW issue:
a. Parse: title, body, error messages, stack traces
b. Classify: code bug / needs info / skip
c. If code bug → spawn Coder → Reviewer → QC
d. If needs info → auto-comment on issue
e. Report all decisions to Telegram
3. Log summary: issues found, fixed, failed, costs
Step 1: GitHub Access Setup
First, authenticate Hermes with GitHub. Create a personal access token with repo and issues scopes.
# Add to ~/.hermes/.env
export GITHUB_TOKEN="ghp_xxxx"
export GITHUB_REPO="myorg/erp"
Verify access:
curl -H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/repos/$GITHUB_REPO/issues?labels=bug&state=open
Step 2: Create the Cron Job
hermes cron create "every 30m" \
--name "agent-pipeline" \
--prompt "Run the full agent pipeline:
1. Poll GitHub for new 'bug' issues from the last hour
2. For each issue, classify it
3. Spawn Coder → Reviewer → QC for code bugs
4. Comment on issues that need more info
5. Report everything to Telegram"
--skills "claude-code"
--deliver "telegram"
--workdir "/home/hermes/erp-app"
What --skills "claude-code" does: It preloads the Claude Code skill into the cron session, so the agent knows all Claude Code CLI flags, modes, and pitfalls without us having to explain them in the prompt.
What --workdir does: It runs the cron job inside the ERP project directory, so CLAUDE.md and .claude/ are automatically loaded into context.
Step 3: The Classification Logic
The pipeline classifies each issue before acting:
# Classify incoming issues
has_error = any(kw in (body + title).lower()
for kw in ["error", "exception", "traceback", "500", "null"])
has_repro = any(kw in (body + title).lower()
for kw in ["steps to reproduce", "when i", "every time"])
if has_error and has_repro:
# CODE BUG — spawn the full pipeline
process_code_bug(issue)
elif has_error and not has_repro:
# NEEDS INFO — ask for reproduction steps
auto_comment(issue, "Please provide steps to reproduce")
else:
# NOT A CODE BUG — skip
log_issue(issue, "SKIPPED")
This prevents the agent from wasting time on feature requests or vague bug reports.
Step 4: The Agent Pipeline
For each code bug, the pipeline spawns three agents in sequence:
1. Coder (Claude Code, ~15 turns):
make test and make lint2. Reviewer (fresh session, read-only):
3. QC/Tester (Haiku, ~8 turns): Using the prompt-as-code approach for consistency.
Step 5: Handling Failures
The pipeline handles common failure modes:
# Retry logic with backoff
MAX_RETRIES = 3
for attempt in range(MAX_RETRIES):
try:
result = terminal(command=coder_cmd, timeout=600)
break
except Exception as e:
if attempt == MAX_RETRIES - 1:
send_telegram(f"🚨 Issue #{num} failed: {e}")
time.sleep(2 ** attempt)
Security: What the Agent Can't Do
The pipeline runs with restricted permissions:
// ~/.claude/settings.json
{
"permissions": {
"allow": ["Bash(git *)", "Bash(make *)", "Bash(pytest *)", "Read", "Edit"],
"deny": ["Bash(rm -rf *)", "Bash(git push *force*)", "Read(.env)"]
}
}
The agent can:
The agent cannot:
Cron Job Management
# List all jobs
hermes cron list
# Check job status
hermes cron status
# Manually trigger a run (for testing)
hermes cron run agent-pipeline
# Pause the pipeline (deploy day, don't auto-fix)
hermes cron pause agent-pipeline
# Resume
hermes cron resume agent-pipeline
Cost Reality Check
Running this pipeline with ~3 tickets per day:
That’s about the cost of one lunch delivery. For a junior developer that works 24/7.
What We Just Built
A fully autonomous pipeline that:
The whole thing fits in one cron job. You create it once, and it runs forever.
Series: “AI Junior Developer” — Part 5 of 6. Next: Post 6 on monitoring and continuous improvement.
Discover more from Susiloharjo
Subscribe to get the latest posts sent to your email.