Keeping Claude Code working overnight: the Brigadier skill, now open source
Before Brigadier was a desktop app, it was a skill I used every night: hand Claude Code a goal, go to sleep, read the report in the morning. We've cleaned it up and released it for anyone to use, in any terminal.
Today we released the Brigadier skill (opens in a new tab), version 0.1.0, open source under the MIT licence. It's a Claude Code skill that keeps work moving while you sleep. You give it a goal before bed and wake up to commits, verified phases and a report.
It started as my private overnight setup, and it built a good part of the Brigadier desktop app. The app, which I wrote about in Orchestrating AI coding agents, is the full desktop experience and still in development. The skill is the free terminal version, and it works today.
1. What it does
You type /brigadier and a goal, usually a phase brief from your plan with its rules and a "done when" list. Your session becomes the brigadier. It doesn't write code. It runs a small crew of workers: separate, full Claude Code sessions, each in its own terminal tab or window, each with its own context window. If Codex is installed, some workers can be Codex sessions too.
The brigadier gives each worker a task and answers its questions the way you would, from your plan, CLAUDE.md and the goal's rules. Every answer goes into the run's ledger under "Decided on your behalf", so in the morning you can see what was decided while you were away. When the work is done or truly blocked, it writes a report.
2. Any terminal, your own subscription
The skill runs wherever Claude Code runs. In cmux, workers open as tabs. In tmux, they open as windows. From a plain terminal (Terminal.app, iTerm, VS Code, an SSH shell) it starts tmux in the background and tells you the one line to attach and watch.
Every worker is a normal Claude Code session on your own account, driven through your own, unmodified claude binary. Nothing is proxied and there is no server. Run state stays in ~/.claude/brigadier/ on your machine. Because a night of work uses your plan's limits like a day would, the brigadier watches the 5-hour window and stops starting Claude workers when it is nearly used up.
Codex is optional. With it, you get a second reviewer, workers for well-bounded tasks, and somewhere to send work when Claude's window runs out, since Codex has its own quota.
3. A skill and about 1,000 lines of bash
There is no framework underneath. SKILL.md is the brigadier's playbook. About 1,000 lines of bash, a helper called brig and two small terminal backends, do the plumbing: opening tabs, typing into them, reading screens and keeping run state in plain files. Claude Code does all the thinking.
Hooks are what make it reliable. Each worker starts with its own settings file containing a Stop hook and a statusline script. The brigadier knows exactly when a worker's turn ended and how full its context is, instead of guessing from what's on the screen.
4. Waiting has to be cheap
Most of a night is waiting. If the coordinating session polled its workers, it would spend its own context and quota on nothing.
So the brigadier runs brig wait as a background command and ends its turn. Claude Code wakes it when an event arrives: a worker finished a turn, a context passed its threshold, a permission prompt appeared, a worker stalled, or the rate limit came close. A quiet hour costs almost nothing.
5. Handoffs instead of compaction
This is the same lesson as in the app. When a worker's context passes a threshold (70% or 300,000 tokens by default), the brigadier asks it to write a handoff: what's done, with commit hashes, what's in progress, the next steps, the decisions already made and the traps it learned. A fresh session continues from that note.
That gave much better continuity than letting a long session compact itself. The brigadier hands itself off the same way, and the new brigadier confirms it has taken over before the old one exits.
6. Every phase gets a second opinion
A phase doesn't end when the worker says it's done. A fresh verifier reviews the phase's diff, checks every "done when" item by actually running it, and fixes what it finds. The review uses Codex when it's installed, and a read-only Claude session otherwise. Plans get the same treatment: before the brigadier approves a worker's outline, it has the outline reviewed.
A second vendor catches different bugs. Codex reviews found real issues that Claude's own reviews missed, and the reverse happened too. That's why reviews default to Codex when it's available.
7. Real incidents became rules
One night a worker ran pkill -f vite -U <uid> to stop a dev server. On macOS, pkill stops reading options at the first pattern, so it treated the rest as more patterns. It killed every Claude Code background shell on the machine, and the run sat idle for hours. The worker protocol now says: never kill processes by name, only the PIDs you started. Scratch paths carry the run's name for the same reason, so one run's cleanup can't touch another's files.
Other rules were there from the start. Workers never push, publish, deploy, spend money, sign up for anything or contact anyone. When a task needs one of those, the worker stubs it and the report lists it under "Waiting on you".
8. Rules are not a sandbox
To keep working unattended, workers run with permissions bypassed by default, so a worker can run any command your user account can. The rules above are instructions the sessions follow. With permissions bypassed, nothing technically stops a worker that ignores them.
The README says this plainly, and so should we. Use it on repos and machines where that's acceptable. If you want it stricter, one setting switches workers to a mode where permission prompts reach the brigadier, which approves only what its rules allow. And keep the machine awake: a sleeping laptop stops the run.
Try it
With skills.sh (opens in a new tab):
npx skills add syncra-studio/brigadier-skill -g -a claude-codeOr as a Claude Code plugin:
/plugin marketplace add syncra-studio/brigadier-skill
/plugin install brigadier-skill@brigadier-skillThen run /brigadier doctor. It checks your terminal, claude, jq, git and the optional codex, and prints the exact fix for anything missing. Try a tiny goal in a scratch repo before you give it a real night's work.
Most of the skill was written by Claude Code workers running under an earlier version of it, which was a good stress test. It's new to other people's setups, though, so bug reports and ideas are welcome on GitHub (opens in a new tab).