# 9to5
Automated agents for Claude Code.
Agents that run on your schedule, from a webhook, or on demand. They stay under budget and report back to your inbox.
> **Agents:** for complete option references and scheduling examples, read [`skills/9to5/SKILL.md`](skills/9to5/SKILL.md) or install the skill with `npx skills add Michaelliv/9to5`. You should run `9to5 onboard` to add instructions to `~/.claude/CLAUDE.md`.
## What people automate
The [`examples/`](examples/) directory has ready-to-import agents:
```bash
9to5 agent import examples/morning-briefing.json
```
| Example | Schedule | What it does |
|---------|----------|-------------|
| [Morning briefing](examples/morning-briefing.json) | Daily 7am | Summarize last 24h of commits, PRs, issues, CI status |
| [Security scan](examples/security-scan.json) | Daily | Check recent commits for hardcoded secrets and vulnerability patterns |
| [Test gap finder](examples/test-gap-finder.json) | Nightly | Find untested code in recent commits, suggest test skeletons |
| [API contract watchdog](examples/api-contract-watchdog.json) | Every 2h | Hit API endpoints, compare responses to spec, flag drift |
| [Project health check](examples/project-health-check.json) | Every 6h | Run tests, measure build times, track repo metrics over time |
| [Ecosystem watch](examples/ecosystem-watch.json) | Every 12h | Check for new releases of dependencies and breaking changes |
| [Reddit trend scout](examples/reddit-trend-scout.json) | Every 4h | Scout trending posts and draft blog content |
| [TODO tracker](examples/todo-tracker.json) | Weekly | Inventory TODO/FIXME comments, track additions and removals |
| [Stale branch archaeologist](examples/stale-branch-archaeologist.json) | Weekly | Assess old branches and recommend which are safe to delete |
| [Dependency deep audit](examples/dependency-deep-audit.json) | Weekly | Analyze actual usage of deps, flag unmaintained or replaceable ones |
| [Refactor spotter](examples/refactor-spotter.json) | Weekly | Find emerging code patterns worth extracting |
| [License compliance](examples/license-compliance-checker.json) | Weekly | Scan dependency tree for copyleft or problematic licenses |
| [Drift detector](examples/drift-detector.json) | Daily | Compare IaC config against actual running state |
| [Competitor comparison](examples/competitor-comparison-pages.json) | Weekly | Research competitors and generate comparison docs via worktree PR |
## Install
Requires [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated.
```bash
npm install -g 9to5
```
Or run without installing:
```bash
npx 9to5 <command>
```
## Quick start
```bash
# Create an agent that runs daily at 9am
9to5 agent add "morning-review" \
--prompt "Review yesterday's commits and summarize changes" \
--rrule "FREQ=DAILY;BYHOUR=9" \
--model sonnet \
--max-budget-usd 0.25
# Run it now to see what you get
9to5 agent run <id>
# Browse everything in the TUI
9to5 ui
```
## Why not just cron + `claude -p`?
You could. 9to5 adds what you'd end up building yourself:
- **Budget caps per agent** - it won't burn your API credits overnight
- **Run history with cost and duration** - see what each agent cost and how long it worked
- **Inbox** - read/unread notifications so you know what happened while you were away
- **Session resume** - pick up where an agent left off with `resume <run-id>`
- **Interactive TUI** - browse, run, pause, delete, and drill into output without leaving the terminal. The daemon auto-starts and self-heals.
- **Export/import** - share agents as JSON, bring them to another machine
- **Model and system prompt per agent** - different personas for different jobs
## Commands
### Agent management (`9to5 agent`)
| Command | Description |
|---------|-------------|
| `9to5 agent add <name>` | Create a new agent |
| `9to5 agent edit <id>` | Edit an existing agent |
| `9to5 agent list` | List your agents |
| `9to5 agent run <id>` | Run an agent now |
| `9to5 agent remove <id>` | Remove an agent (`--force` to permanently delete) |
| `9to5 agent restore <id>` | Restore a deleted agent |
| `9to5 agent hide <id>` | Hide an agent from list and TUI views |
| `9to5 agent unhide <id>` | Unhide a hidden agent |
| `9to5 agent list --deleted` | List deleted agents |
| `9to5 agent export [id]` | Export agent(s) as JSON |
| `9to5 agent import <file>` | Import agent(s) from JSON |
### Runs & inbox
| Command | Description |
|---------|-------------|
| `9to5 runs [agent-id]` | View run history |
| `9to5 resume <run-id>` | Resume the Claude Code session from a previous run |
| `9to5 inbox` | Check your inbox |
### Daemon (`9to5 daemon`)
| Command | Description |
|---------|-------------|
| `9to5 daemon start` | Start the background daemon |
| `9to5 daemon stop` | Stop the background daemon |
### Webhooks (`9to5 webhook`)
| Command | Description |
|---------|-------------|
| `9to5 webhook info` | Show webhook configuration and URLs |
| `9to5 webhook refresh` | Regenerate the webhook secret |
| `9to5 webhook enable` | Enable webhook triggers |
| `9to5 webhook disable` | Disable webhook triggers |
| `9to5 webhook url <id>` | Print trigger commands for an agent |
### Other
| Command | Description |
|---------|-------------|
| `9to5 onboard` | Add 9to5 instructions to `~/.claude/CLAUDE.md` |
| `9to5 ui` | Launch the interactive TUI dashboard |
## TUI dashboard
Launch with `9to5 ui` for a two-panel terminal dashboard:
- **Agents** - browse, run, pause, and delete with a detail panel showing prompt, schedule, and config
- **Runs** - drill into an agent to see execution history with status, duration, cost, and structured output
- **Hotkeys** - `r` run, `p` pause/resume, `dd` delete (with `u` to undo), `c` copy output, `⏎` toggle read, `q` quit
## Webhooks
Trigger agents from GitHub Actions, CI, Zapier, or any script. Two trigger paths — local HTTP and remote via [ntfy.sh](https://ntfy.sh) — both secured with HMAC-SHA256 signing. No infrastructure, no dependencies, completely free.
Webhooks are enabled by default — the daemon auto-generates a secret on first start. Use `webhook disable` to turn them off.
```bash
# View webhook config and URLs
9to5 webhook info
# Get ready-to-use curl commands for an agent
9to5 webhook url <agent-id>
# Regenerate the secret (breaks existing integrations)
9to5 webhook refresh
```
**Local trigger** — POST to `http://localhost:9505/trigger/<id>` with a signed body and `X-Signature` header. Works for scripts on the same machine or in your local network.
**Remote trigger** — POST to the ntfy.sh URL shown by `webhook info`. The daemon subscribes via SSE. Works from anywhere — CI, GitHub Actions, other machines.
Both paths verify HMAC-SHA256 signatures and reject messages older than 5 minutes.
```bash
# Example: trigger from a script
SECRET='<your-webhook-secret>'
BODY='{"automation_id":"<id>","ts":'$(date +%s000)'}'
SIG=$(echo -n "$BODY" | openssl dgst -sha256 -hmac "$SECRET" | sed 's/^.* //')
# Local
curl -X POST http://localhost:9505/trigger/<id> \
-H "Content-Type: application/json" \
-H "X-Signature: $SIG" \
-d "$BODY"
# Remote (ntfy)
curl -X POST <ntfy-url> \
-H "Content-Type: application/json" \
-d '{"payload":"'"$BODY"'","sig":"'"$SIG"'"}'
```
## Data
All data is stored locally in `~/.9to5/` (SQLite database, daemon PID file, and webhook secret).
## Docs
Landing page at [michaelliv.github.io/9to5](https://michaelliv.github.io/9to5/). For agent-friendly option references and scheduling examples, see [`skills/9to5/SKILL.md`](skills/9to5/SKILL.md).
## License
MIT