otomode
Skill63 starsChanged 9 days agoMITView on GitHub
Unattended work mode for when the user is away. `otomode 6h` asks everything up front in one round (tasks, how to check each, permissions), writes OTOMODE.md, turns on a hook that denies every permission prompt and question and logs it to QUESTIONS.md, then works task by task through every lane that answered the start-round probe (external CLIs through mmo-run, Claude sub-agents), verifies each with its own check and commits each separately, pauses at 85% usage and resumes by cron after the reset, with an hourly watchdog. `otomode off` turns the hook off, reports and asks the saved questions. Also handles `otomode resume`, `otomode watchdog`, `otomode status`.
- Commits and pushes
In this repository7 other files it gives its agents.
- advisorSkill
- chatgpt-laneSkill
- cloud-laneSkill
- councilSkill
- deepseek-laneSkill
- kimi-laneSkill
- orchestraSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 7 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 48
Never wait on the user; no AskUserQuestion after the start round.
- Distinctive: line 49
Never delete, deploy, push or send messages, even if a task seems to need it.
- Distinctive: line 52
Commit only on the otomode branch, one commit per task, task id in the subject, following the repo's CLAUDE.md and trailer rules.
- Very specific: line 54
Every launch names its model (a sub-agent's model, an mmo-run lane's -m).
- Very specific: line 64
Every segment of a compound command (a.
- Very specific: line 70
Never write a time from memory: $OTO log for log lines, else date +%H:%M.
- Distinctive: line 83
Ask one round, as a plain numbered message (not AskUserQuestion, so free text fits), and wait.
- Distinctive: line 114
If the work tree is dirty: leave it, or include it in the first commit?
- Very specific: line 115
After the answer: add the approved allow rules (and worktree.baseRef if accepted) to .claude/settings.local.json (merge, never replace.
- Very specific: line 117
Write or Edit tool, not a shell heredoc, so the user sees one approval).
- Distinctive: line 125
Run the quick check once on the new branch.
- Very specific: line 127
Write OTOMODE.md at the repo root (format below), with the lineup on the Lanes: line minus vetoed lanes, and commit it as otomode: plan.
- Very specific: line 166
Before each task: the usage gate (section 3) and the deadline check (past Ends: no new tasks, go to step 7).
- Very specific: line 187
Every lane change is a $OTO log line (T<n> lane <old> -> <new>: <why>).
- Very specific: line 188
Write the brief. For Claude lanes its first line is: "First run git merge otomode/<stamp> in your worktree.
- Very specific: line 199
When the lane returns, check it yourself.
- Very specific: line 229
When no todo task is left or the deadline passed: run the full check, write the summary into OTOMODE.md (with its result, $OTO status's …
- Distinctive: line 237
Run the gate before every new task and in every watchdog run.
- Very specific: line 239
If mcp__ccd_session_mgmt__get_usage exists (desktop app.
- Very specific: line 256
Run $OTO status. If off, do nothing.
- Very specific: line 269
No lane running, tasks todo, usage fine, no resume cron pending: the loop stalled.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
otomode
The user is away. Work through an agreed task list without ever waiting on them; leave everything reviewable: one commit per task, a plan file, a question log. Helper script (state, hook, log, usage readout):
OTO="python $HOME/.claude/skills/otomode/scripts/otomode.py" # python3 where python is not on PATH
$OTO on --project "<repo root>" --hours <N> # hook ON for this session (refuses: see step 6)
$OTO off # hook OFF; prints cleanup_left_for_you
$OTO status # state, session, crons, quick checks, denials, usage
$OTO log "<text>" # "- HH:MM <text>" into the OTOMODE.md log
$OTO gate [--percent P --reset ISO] # go / stop / unknown (with why) before each task
$OTO lane T<n> <lane> # record a Claude lane launch (scoreboard)
$OTO merged T<n> --quick-exit <code> # after each cherry-pick: the quick check's exit code
$OTO cron [--watchdog ID] [--resume ID] # record cron job ids in the state
$OTO score # per-lane first-try passes from lanes.jsonl$OTO is shorthand: write the full command each time (variables do not
survive between tool calls), exactly as in its allow rule. Setup, once:
$OTO install registers the hook in ~/.claude/settings.json (uninstall
removes it); it does nothing while otomode is off. For usage in the CLI use
scripts/statusline.py as the status line; the desktop app has get_usage
(section 3). While on, for this session only, the hook:
- denies every permission prompt,
AskUserQuestion,EnterPlanModeandExitPlanMode, and appends each one to<repo>/QUESTIONS.md; - denies delete, deploy, push and send commands (rm, git push, branch or
worktree removal, reset --hard, kubectl/terraform/az/aws, ssh/scp, POST
requests, gh pr/issue writes, publish, mail,
| sh) and MCP tools named send, post, delete, submit, upload and the like, logged for the end report. Bash is judged by the commands that would run (echo and commit messages may name them); unparseable lines and PowerShell by whole-text regex.
Denial classes: off_limits (as designed), question, allowlist_gap (a
prompt the start round did not allow; a compound command gets one suggested
rule per segment). status and off print counts and rules. A denial is not
a failure to retry: take the safe default or mark the task blocked.
Hard rules (whole run)
- Never wait on the user; no AskUserQuestion after the start round.
- Never delete, deploy, push or send messages, even if a task seems to need it; write what would be needed into the task's notes. Never remove worktrees or branches you created; list them in the report.
- Commit only on the otomode branch, one commit per task, task id in the subject, following the repo's CLAUDE.md and trailer rules.
- Every launch names its model (a sub-agent's
model, an mmo-run lane's-m); no lane asks questions or commits. Every lane works on the otomode branch's code, never the default branch's (loop steps 1, 2 and 4). - Task checks go through
mmo-check(loop step 3). mmo-check and mmo-run write a status header as the first line of their out file: run each as ONE simple command, then read that header in a separate call; no; echo. For a raw quick or full check never let a pipe hide the exit code: run<check> > <repo>/.otomode/<name>.log 2>&1; echo "exit=$?"(needsBash(echo:*)), read the log's tail in a separate call. If you must pipe, start withset -o pipefail. - Every segment of a compound command (
a; b,a && b, pipes,for/whileloops) needs its own allow rule, or the whole command is denied. Avoid chains and loops: one simple command per call, one call per worktree. - Your state is OTOMODE.md and
<repo>/.otomode/, not the conversation: after a resume or a compaction rebuild from them; theLanes:line is the routing table (re-probe when the roster is stale). - Never write a time from memory:
$OTO logfor log lines, elsedate +%H:%M.
1. Start: otomode <duration> (e.g. otomode 6h)
TOOL <name> stands for the one command form every lane tool runs in:
MMO_LOG=<repo>/.otomode/lanes.jsonl MMO_TASK=<id> bash <home>/.claude/skills/orchestra/scripts/<name>
(absolute home, no ~), written in full and always in exactly this form, so
one allow rule covers mmo-run, mmo-check and mmo-roster.
- Probe the lanes first, while the user is there:
TOOL mmo-roster probe --out <repo>/.otomode/roster.json(MMO_TASK=roster; one tiny call per lane;--models <file>for lanes without a default id), then... mmo-roster lineup --file <repo>/.otomode/roster.json. - Ask one round, as a plain numbered message (not AskUserQuestion, so
free text fits), and wait. It is not optional: paste the lineup from
step 1 on top, unedited (which model plays which tier, what is unusable and
why; the user may veto a lane or fix a sign-in now).
on(step 6) refuses without aLanes:line. If the message already lists tasks and checks, use them and ask only what is missing:- The tasks, in priority order, each with the files it may touch.
- For each task, how to check it is done: a command (test, build, lint, script) whose exit code decides. Offer a concrete check per task. Also the repo's quick check (its fast gate, run after every merge) and full check (what CI runs), e.g. from CLAUDE.md or the CI config.
- The permissions the run will need. Read
.claude/settings*.jsonand~/.claude/settings.json, derive the commands from the tasks and checks (test runners, build, git checkout/add/commit/merge/cherry-pick/ worktree add,date), and list the allow rules still missing, e.g.Bash(go test:*). Always includeBash(echo:*)(the; echo "exit=$?"tail), file editsEdit(<repo>/**),Edit(<repo-parent>/wt-*/**)(mmo-run worktrees) andEdit(<repo>/.claude/worktrees/**)(sub-agent worktrees) unless the session runs in auto or acceptEdits mode; the helperBash(python <home>/.claude/skills/otomode/scripts/otomode.py:*); the lane toolsBash(MMO_LOG=<repo>/.otomode/lanes.jsonl MMO_TASK=*); andRead(<home>/.claude/skills/**). Everything not allowed now is denied later, so be generous within the repo. Ask whether to add them to.claude/settings.local.json. - Anything off limits (files, directories, services, vendors). Every ready lane in the lineup may be used unless the user says otherwise.
- A time budget per task in minutes (default 45); a lane past it is stopped.
- Sub-agent worktrees start from the default branch unless
worktree.baseRefis"head"; if unset, offer to add"worktree": {"baseRef": "head"}to.claude/settings.local.json. - If the work tree is dirty: leave it, or include it in the first commit?
- After the answer: add the approved allow rules (and
worktree.baseRefif accepted) to.claude/settings.local.json(merge, never replace; use the Write or Edit tool, not a shell heredoc, so the user sees one approval). If a write is refused, say which approval is needed and stop; do not turn the hook on with setup unfinished. (onwrites.otomode/andQUESTIONS.mdinto.git/info/excludeitself; never edit that file.) Create the branchotomode/<YYYY-MM-DD-HHMM>from HEAD unless told otherwise. Then runTOOL mmo-roster show --file <repo>/.otomode/roster.json(MMO_TASK=smoke, no model call): if that still prompts, the allow rule does not match the command form; fix it now, not at 3 a.m. - Run the quick check once on the new branch; note an existing failure in OTOMODE.md, so a later one is known to be the run's.
- Write
OTOMODE.mdat the repo root (format below), with the lineup on theLanes:line minus vetoed lanes, and commit it asotomode: plan. Copy lane and model names frommmo-roster lineup/readyas they print (<lane> <model>, a space, no slash); never compose or shorten them. - Turn the hook on:
$OTO on --project "<repo root>" --hours <N>. It refuses without aLanes:line naming a lane (--force: do not) or a session id (--all-sessionsonly if the user asks). - Schedule the watchdog with CronCreate: cron
17 * * * *, recurring, promptotomode watchdog; then$OTO cron --watchdog <id>(the state is the reliable record) and the id in OTOMODE.md. - Say in one line that otomode is on and until when; start working.
OTOMODE.md
# Otomode run
Started: <time> · Ends: <time> · Branch: otomode/<stamp> · Usage stop: 85%
Watchdog cron: <id> · Resume cron: <id or none>
Quick check: `<cmd>` · Full check: `<cmd>` · Roster: <time>
Lanes: strong=<lane> <model>,opus · middle=<lane> <model>,sonnet · cheap=<lane> <model>,... · bulk=...,haiku · out: <lane> (limit <HH:MM>)
## Rules from the user
- <off limits, vetoed lanes, dirty tree decision>
## Tasks
| # | Task | Check | Files | Lane | Min | Status | Tries | Commit | Notes |
|---|------|-------|-------|------|-----|--------|-------|--------|-------|
| T1 | ... | `go test ./internal/x/...` | `internal/x/*` | cheap: <lane> | 45 | todo | 0 | | |
## Log
- <HH:MM from $OTO log> T1 started (cheap: <lane> <model>, worktree ...)Files is the task's --allow list for mmo-check, Min its time budget,
Lane the tier and lane now on it. Status: todo, running, done,
blocked, failed. Update the table after every step; log with $OTO log.
2. Work loop
Before each task: the usage gate (section 3) and the deadline check (past
Ends: no new tasks, go to step 7). For each todo task, in order:
- Give the task a tier (orchestra skill: strong, middle, cheap, bulk) and
take the first lane of that tier on the
Lanes:line: external lanes first, a Claude sub-agent only when none of that tier is left (strong tier: Opus first).- An
mmo-runlane: write the brief to<repo>/.otomode/T<n>.brief.md,git worktree add <repo-parent>/wt-<lane>-T<n> -b otomode-<lane>/T<n> otomode/<stamp>(one command per task, no loop) and start it with Bashrun_in_background(if that is unavailable, run lanes one at a time in the foreground; never call a tool whose schema is not loaded, load it with ToolSearch first):TOOL mmo-run <lane> -m <model> --mode rw -C <repo-parent>/wt-<lane>-T<n> --base otomode/<stamp> --brief <repo>/.otomode/T<n>.brief.md --out <repo>/.otomode/T<n>.out.md -t <Min*60> --idle 600 --max-turns 80(MMO_TASK=T<n>). Exit 9: stale worktree; recreate it (not a try). Exit 6 (limit), 7 (auth) or 8 (model rejected): that lane is out (until a re-probe shows it back), the others stay: move it toout:onLanes:with time and reason, and rerun the task on the next lane of the same tier (not a try). Exit 4 or any other non-zero exit: a failed try. - A Claude sub-agent (
opus,sonnet,haiku), withisolation: "worktree": run$OTO lane T<n> <model>; the watchdog stops it pastMin(a failed try). Every lane change is a$OTO logline (T<n> lane <old> -> <new>: <why>).
- An
- Write the brief. For Claude lanes its first line is: "First run
git merge otomode/<stamp>in your worktree; if that fails, stop and say so." Then: goal, exact files, steps, the check command, the repo's rules, and: "Do not commit, push or ask questions. Use the Bash tool, not PowerShell, only simple commands; never pipe a check withoutset -o pipefail. Changing or deleting tests, or special-casing code to make the check pass, is not acceptable. If the task cannot be done honestly, stop withBLOCKED: <reason>. End with at most 10 lines: what changed, files, check result, then DONE, FAILED:<why>or BLOCKED:<reason>; longer notes go to<repo>/.otomode/T<n>.notes.md." Independent tasks may run in parallel (at most 3 lanes). - When the lane returns, check it yourself; its word is not the check. A
lane ending in
BLOCKED:is not a failed try: set the taskblocked, the reason in Notes and QUESTIONS.md. Otherwise runTOOL mmo-check -C <worktree> --base otomode/<stamp> --cmd "<task check>" --allow <glob> --out <repo>/.otomode/T<n>.check.md(one--allowperFilesglob;--redwhen the task adds tests) as one simple command, and read the header line of the out file. Exit 0 pass: go to step 4. 1 fail, 4 timeout: a failed try. 3 policy (files outsideFiles, or protected): reject as a failed try, or keep it only with the reason in Notes. 5 not-red: the new test passes without the change, so it does not test it; a failed try. Read the report and the diff, not the lane's narrative; read the hunks of changed or deleted existing tests (tests_changed) before merging. A lane that stopped "waiting on background work" is not resumed: run mmo-check on its worktree yourself. - Pass: commit in the lane's worktree (
otomode T<n>: <task>). Thengit log --oneline otomode/<stamp>..<lane branch>must list only that commit (plus the merge from step 2); anything else means a wrong base: do not merge, retry instead (a try).git cherry-pick <commit>onto the otomode branch, run the quick check there (after every merge), then$OTO merged T<n> --quick-exit <code>with its exit code. If it failed, fix it now (a follow-up commit, orgit revert, never reset) before the next merge. Record the hash, setdone,$OTO logit. - Fail: increment Tries and retry with the last 40 lines of
T<n>.check.mdpasted verbatim into the brief. The second failed try moves the task one tier up (cheap to middle to strong), to that tier's first lane, external first. After 3 failed tries, or when the task is blocked (a needed permission was denied, a decision is the user's, something off limits), setblockedorfailed, write why in Notes and QUESTIONS.md, and move on. - Integration gate: after every 4 merged tasks, run the full check on the otomode branch. A red full check is fixed (its own commit) or the offending commit reverted before any new merge.
- When no
todotask is left or the deadline passed: run the full check, write the summary into OTOMODE.md (with its result,$OTO status's quick check line and$OTO score), commit it (otomode: summary), stop the watchdog only if every task is settled, and stay idle. Keep the hook on until the user saysotomode off.
3. Usage gate
Run the gate before every new task and in every watchdog run. Do not skip it.
- If
mcp__ccd_session_mgmt__get_usageexists (desktop app; load it via ToolSearch), call it, take the window with the highestpercentUsed, and run$OTO gate --percent <percentUsed> --reset <resetsAt>. Otherwise (CLI) run$OTO gate, which reads the statusline file. - Act on
decision:go: start the task.unknown(whysays so; print mode has no statusline file and noget_usage): one task at a time, gate again after each.stop(85% or more): start nothing new. Let running lanes finish, verify and commit what is ready. Then CronCreate withcron= the gate'sresume_cron,recurring: false, promptotomode resume; run$OTO cron --resume <id>, write the id,resume_atand the percent into OTOMODE.md, and stop. If the gate's note says the reset is after the run ends, write the summary instead.
4. otomode resume
Run $OTO status. If off, do nothing. Otherwise rebuild from OTOMODE.md and
.otomode/, run TOOL mmo-roster show --file <repo>/.otomode/roster.json; on
exit 3 probe again and rewrite Lanes: (a lane that is back returns; log the
change). Gate, and continue from the first unsettled task. A task left
running is checked first: if its worktree has a change, verify it (loop
step 3); otherwise restart it (it counts as a try).
5. otomode watchdog (hourly cron)
Quick and cheap, no new work unless the loop has stalled:
$OTO status: if off, CronDelete the watchdog and stop.- Usage gate. Over 85% with no resume cron scheduled: schedule it.
- No lane running, tasks
todo, usage fine, no resume cron pending: the loop stalled; continue it (as in resume). - A lane past its task's
Minbudget, or idle-waiting on its own background work: read its output. Work done: verify it yourself (loop step 3); not done: stop it (TaskStop) and count a failed try. - Roster older than 12 hours, or a lane in
out:: re-probe as in resume. PastEnds: no new tasks; finish step 7 of the work loop.$OTO loga line.
6. End: otomode off
In this order:
$OTO offfirst, so the hook stops denying before anything else. Keep itscleanup_left_for_you,denials_by_classandsuggested_allow_rules.- CronDelete the watchdog and any resume cron (CronList to find them).
- A short report, under 15 lines: tasks done (commit hashes), blocked or
failed with the reason, the branch name, the full check's result, the
quick_checkline, denials per class with the suggested allow rules, which lane did each task and each lane change (from the log), first-try passes from$OTO score, usage at the end. Nothing is pushed or merged. Then a Cleanup left for you block, one exact command per line: thecleanup_left_for_youhousekeeping and the removal of the worktrees and lane branches this run created (git worktree remove <path>,git branch -D <branch>). - Then ask the saved questions from QUESTIONS.md: group them, skip ones that no longer matter or are in the cleanup block, and ask with AskUserQuestion (up to 4 per call) where there are clear options, as plain text otherwise. Offer to redo the blocked tasks with the answers.
otomode status
$OTO status, then three lines: tasks by status, usage and denials, next cron.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

