agentleFS
anivaranivar/agentic-sdlc/skills/unattended-runs/SKILL.md

unattended-runs

Skill0 starsChanged 53 days agoMITView on GitHub

Run agent work that nobody watches without stalling it at a prompt, in Claude Code or Codex. In agent mode, the guard's default, the guard never asks: a call it would ask about runs and is recorded, and a secret read or print, a change to the guard's configuration and a production write are refused. In a repository set to confirm mode, whoever launches the run sets AGENTIC_SDLC_UNATTENDED, so the guard never asks: checkpoint commits pass on a working branch, pushes pass only to listed agent branches, and every other gated call is refused with a reason the agent acts on. The run starts with a finish condition, a spend cap and a branch of its own, and ends with a run report in a file that lists the held calls for a person. Triggers on: "run this overnight", "long-running", "unattended", "while I'm away", "background session", "keep going until", "/goal", "claude -p", "headless", "scheduled task", "routine", "don't stop for permission", "the run stopped at a prompt", "Needs input".

The file

Files
SKILL.md

Unattended runs

A run that nobody watches stops at its first prompt and waits until someone opens it. Set the run up so nothing waits on a person, the work checkpoints itself on its own branch, and every call that needed a person is written down for one.

The rules

IdRuleIn practice
RUN-1An unattended run never waits on a personHook, opt-in. In agent mode nothing asks, so the signal only changes the reason a kept ask is refused (SECRET-2, SECRET-3, GUARD-2, PROD-1). In confirm mode, with AGENTIC_SDLC_UNATTENDED set by the launcher, a commit on a branch that is not protected passes; a push passes only to a branch that matches unattended.push_branches and is not protected, with no force, tags, deletion or mirror. Every other call that would ask (a commit elsewhere, any other push, a post, a secret file, a change to the guard's configuration) is refused with a reason that says not to retry. Deny rules still refuse (STAGE-1, PUSH-1, GUARD-1).
RUN-2Start with a finish line, a cap and its own branchA finish condition a check can show, a spend cap, a working branch or worktree, and in confirm mode the signal set by whoever launches. Use the platform's own loop, not a loop of your own.
RUN-3End with a report in a fileCommits with shas, checks with commands and results, held calls, failures and skips, what is left. A held call is never retried or worked around during the run.
RUN-4An agent may start an unattended run, and the start is recordedHook, record only. A command that sets AGENTIC_SDLC_UNATTENDED (a leading assignment, env, export), or agentic-sdlc run, which sets it for the run it starts, is the agent's own decision: never asked about or refused, written to the decision record. The run it starts follows RUN-1.

In agent mode the agent decides every commit, push and post itself, and the decision record keeps each one. A plain push to a protected branch runs too; only a force push or a delete is refused (PUSH-1), so the run's own branch is the agent's discipline, not the guard's. In confirm mode with the signal, a commit on a working branch passes without the person's go-ahead SLICE-6 asks for, because nobody is there to give it. The go-ahead moves to the merge: a person reads the branch, the report and the held calls, then decides (ASK-1, ASK-2 and ASK-3 apply to them as usual).

Before the launch

  1. A branch or worktree for the run alone: git switch -c agent/<task>, or --worktree <task>, which names the branch worktree-<task>. Never the default branch.
  2. In confirm mode, where pushes may land, once per repository, in .agentic-sdlc.json: "unattended": {"push_branches": ["agent/*", "worktree-*"]}. Without it every push is refused and the work stays in the run's checkout, which in a cloud run is lost with the container unless the run can push. Agent mode needs no list.
  3. The files the run reads and writes (HANDOFF-1): .agent/progress.md and .agent/features.json, with the finish condition at the top of both.
  4. The finish condition, as something the run's own output can show: "just check exits 0 and every entry in .agent/features.json has status passing". Not "the feature is done".

Launch

One command does the launch: agentic-sdlc run <name> "<task and finish condition>", with --agent codex for Codex, --budget and --hours for the caps. It makes the branch agent/<name> in its own worktree, starts the run detached with nothing that can prompt, and returns. agentic-sdlc runs lists the runs and their state; runs read, runs wait and runs stop act on one by name. The rows below are the same launches by hand.

In agent mode, the default, leave AGENTIC_SDLC_UNATTENDED=1 out of the rows below: it changes nothing there. In a repository set to confirm mode, keep it.

WhereHow
Print mode, local or CIAGENTIC_SDLC_UNATTENDED=1 claude -p "<task and finish condition>" --worktree <task> --permission-mode auto --permission-prompts none --max-budget-usd <cap>
A session you leave runningAGENTIC_SDLC_UNATTENDED=1 claude --permission-mode auto, then /goal <finish condition>. A goal does not change the permission mode; auto mode is what lets its turns run.
Cloud scheduled taskSet AGENTIC_SDLC_UNATTENDED=1 in the cloud environment's environment variables. Scheduled tasks start in auto mode.
Background sessionThe session runs under a supervisor process, so a variable exported only in the launching shell may not reach the hook. Prefer one of the rows above, or confirm in the first minute that a checkpoint commit passes without a prompt.
Codex, headlessTrust the plugin's hooks once in an interactive codex session, then codex exec "<task and finish condition>" --sandbox workspace-write --approve-for-me. --approve-for-me routes Codex's own approval requests through its automatic review. Codex has no spend cap flag, so the finish condition and a timeout on the launching job bound the run.

--permission-prompts none denies anything else that would prompt and tells the agent not to retry, so the platform's own prompts cannot stall the run either. Codex takes no ask from a hook at all, so the guard refuses there whatever it would have asked. In confirm mode without the signal, modes that cannot prompt refuse every commit (ADR 0005): the run survives but cannot checkpoint.

During the run

  • Take one item from the feature list at a time. Commit when it passes its check, and before any step that is hard to undo. Commit text follows thin-slices.
  • A refused call: do not retry it, do not reach the same effect through another command, and do not edit the guard's configuration (GUARD-2). Write it into the held calls of the progress file at once (HANDOFF-4), then take the next step.
  • An item that keeps failing the same way is marked blocked with the failing command and its output, and the run moves to the next item.
  • A secret file stays unread (SECRET-3) and a secret value unprinted (SECRET-2). A production write waits for a person (PROD-1). If the work needs one, that is a held call.
  • An item counts as passing only on its recorded check (HANDOFF-3); the run's own opinion that it works is not evidence.

The run report

Written to .agent/run-report.md and committed with the last checkpoint. The finish condition's result goes in the first line.

# Run report: <task>
Finish condition: <text> · Met: yes | no · Branch: <branch> · Started <UTC> · Ended <UTC>

## Commits
| sha | What it does |

## Checks
| Command | Result |

## Held calls
| Call | Rule | Why it waits | What a person does |

## Failed, blocked or skipped
| Item | What happened | Evidence |

## Left
<items not started, in order>

What the guard does

CallAgent mode (the default)Confirm mode, attendedConfirm mode, unattended
Commit on a working branchruns, recorded (ASK-1, AGENT-1)asks (ASK-1)passes
Commit on a protected branch or a detached HEADruns, recordedasksrefused
Push to a branch in push_branchesruns, recorded (ASK-2, AGENT-1)asks (ASK-2)passes
Any other push, tagsruns, recorded; a force push or delete of a protected branch is refused (PUSH-1)asks, or refused to a protected branch (PUSH-1)refused
A post to the forge: pull request, comment, reviewruns, recorded (ASK-3, AGENT-1)asks (ASK-3)refused
A secret file or value, the guard's own configuration, a production writerefused (SECRET-2, SECRET-3, GUARD-2, PROD-1, AGENT-1)asks (SECRET-2, SECRET-3, GUARD-2, PROD-1)refused
git add -A, --no-verifyrefused (STAGE-1, GUARD-1)refusedrefused

Companion skills

NeedSkill
The progress file, the feature list, the start-up routineinvoke session-handoff
Commit text and the size of each checkpointthin-slices
The read a person does before the mergereview-change
Calibrating what the report claimsevidence

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.