agent-cli-tmux-supervision
Skill319 starsChanged 58 days agoApache-2.0View on GitHub
Use when spawning and supervising multiple agent-cli Codex worktrees through tmux, especially when you must poll progress, force prompt rereads against the local TASK file, run current-context and fresh-context pr-review loops, and verify that review fixes are actually pushed before merge.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/mindroom-docs/references/llms-full.txtllms.txt
- skills/mindroom-docs/references/llms.txtllms.txt
- address-pr-review-commentsSkill
- agent-cli-devSkill
- code-debateSkill
- docs-reviewSkill
- duplication-auditSkill
- live-testSkill
- native-subagent-pr-loopSkill
- pr-reviewSkill
- mindroom-docsSkill
- open-knowledge-formatSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
28 rules. About 0 are common, 19 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill when you are supervising parallel Codex branches launched with agent-cli dev new ...
- Distinctive: line 15
Use this skill when:
- Distinctive: line 22
Do not use this skill when:
- Very specific: line 39
Use a feature branch as --from only when the prompt explicitly depends on unmerged branch work.
- Very specific: line 47
When telling an agent to reread its instructions, always point it at the local .claude/TASK-*.md file, not the original prompt path from …
- Very specific: line 51
If uv sync --all-extras fails during setup but the tmux session still launches, treat that as a setup caveat, not an automatic launch …
- Very specific: line 57
Do not trust one combined tmux send-keys ...
- Very specific: line 74
If the text is visible at the prompt but not running yet, send another bare Enter.
- Very specific: line 76
Do not use C-c just to submit buffered text.
- Distinctive: line 80
When actively supervising agents, do a real polling loop instead of assuming they are still working.
- Very specific: line 105
Before review, force the agent to reopen its exact .claude/TASK-*.md file and compare the branch against:
- Distinctive: line 117
If there is still a prompt gap, the agent should keep working before review.
- Distinctive: line 121
When parallel reviewers are running, let every reviewer finish its full pass even after another reviewer reports a blocker.
- Distinctive: line 124
After the full passes finish, consolidate their findings into one fix batch.
- Distinctive: line 126
Only require another whole-PR pass when the fix materially changes architecture or when the active review policy explicitly requires it.
- Distinctive: line 127
If a whole-PR exact-head rerun is required, start it only after all reviews of the previous SHA have completed and their reports are saved.
- Distinctive: line 141
commit and push if it changed anything
- Distinctive: line 145
If the review found blockers, do not move on until the agent confirms:
- Distinctive: line 152
Do not accept vague answers like “should be fixed”.
- Distinctive: line 156
After the current-context review is clean, send:
- Distinctive: line 162
Verify the pane actually reset.
- Distinctive: line 170
If the fresh-context review finds blockers:
- Distinctive: line 179
Keep looping until the fresh-context review is clean.
- Very specific: line 183
After the clean fresh-context review, force one last prompt reread against .claude/TASK-*.md.
- Distinctive: line 185
Only then should the agent:
- Distinctive: line 194
Before considering the branch settled, confirm that the local branch, remote branch, and PR head all match.
- Distinctive: line 204
If those SHAs do not match, the branch is not actually settled yet.
- Distinctive: line 208
If an agent chooses to run the whole repository suite, tell it to use:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Agent CLI + tmux Supervision
Use this skill when you are supervising parallel Codex branches launched with agent-cli dev new ... --tmux-session ....
This is not just a launch guide. It is the full supervision protocol for getting from spawned worktree to reviewed PR without letting agents stop early.
When to use
Use this skill when:
- multiple Codex agents are working in separate
agent-cliworktrees - each branch needs active tmux supervision instead of fire-and-forget delegation
- you need repeated review loops before considering a PR done
- you need to prove that review fixes are pushed, not just described
Do not use this skill when:
- there is only one local branch and no tmux-supervised sub-agents
- the work is small enough to complete directly in the current session
Core launch pattern
Launch each branch with an explicit base, Codex as the agent, a dedicated tmux session, and a prompt file.
agent-cli dev new <branch-name> \
--from origin/main \
--agent codex \
--tmux-session <session-name> \
--prompt-file <prompt-file>Use a feature branch as --from only when the prompt explicitly depends on unmerged branch work.
What the agent actually reads
The original prompt file path does not have to exist inside the spawned worktree.
agent-cli copies the prompt into the worktree as .claude/TASK-*.md.
When telling an agent to reread its instructions, always point it at the local .claude/TASK-*.md file, not the original prompt path from the main repo.
Known environment caveat
If uv sync --all-extras fails during setup but the tmux session still launches, treat that as a setup caveat, not an automatic launch failure.
In this repo, a known example is python-olm failing to build while Codex still starts successfully in tmux.
Sending messages reliably
Do not trust one combined tmux send-keys ... Enter command.
The reliable pattern is:
tmux send-keys -t <session> 'your message here'
tmux send-keys -t <session> EnterThen verify that the message actually started running:
tmux capture-pane -p -t <session> | tail -n 20Look for Working.
If the text is visible at the prompt but not running yet, send another bare Enter.
Do not use C-c just to submit buffered text.
Monitoring loop
When actively supervising agents, do a real polling loop instead of assuming they are still working.
- Sleep for about a minute.
- Capture the last 20-50 lines from each relevant tmux session.
- Classify each branch as:
- still working
- parked at a prompt
- done enough for review
- blocked and needing intervention
Useful commands:
tmux list-panes -a -F '#{session_name}|#{pane_current_command}|#{pane_dead}|#{pane_title}'
tmux capture-pane -p -t <session> | tail -n 40Do not accept “done” too early
Passing tests is not enough.
A clean self-review is not enough.
A PR is not done just because the agent says the prompt is satisfied.
Before review, force the agent to reopen its exact .claude/TASK-*.md file and compare the branch against:
- the goal
- the problem statement
- the design target
- the scope
- the important notes
The key question is:
- did the branch actually deliver the intended simplification and source-of-truth cleanup, or did it only move logic around and pass tests?
If there is still a prompt gap, the agent should keep working before review.
Never interrupt an in-flight independent review for a fix
When parallel reviewers are running, let every reviewer finish its full pass even after another reviewer reports a blocker. A blocker from one reviewer does not justify restarting or cancelling the other reviewers, because they may still find unrelated problems elsewhere in the PR. Apply verified fixes in parallel when useful, but preserve every complete review report before moving reviewers to a new commit. After the full passes finish, consolidate their findings into one fix batch. Then ask the same reviewers to verify the exact fix delta and final SHA. Only require another whole-PR pass when the fix materially changes architecture or when the active review policy explicitly requires it. If a whole-PR exact-head rerun is required, start it only after all reviews of the previous SHA have completed and their reports are saved.
Review loop
Once the agent has completed the prompt-reread pass, run this loop.
1. Current-context review
Tell the agent to run pr-review in its current context against origin/main.
Require it to:
- fix every blocker
- rerun relevant tests
- commit and push if it changed anything
2. Explicit pushed-state confirmation
If the review found blockers, do not move on until the agent confirms:
- the blockers are fully fixed
- the exact HEAD SHA
- the remote branch SHA matches
- the PR head SHA matches
Do not accept vague answers like “should be fixed”.
3. Fresh-context review
After the current-context review is clean, send:
/newVerify the pane actually reset.
Then tell the agent to run pr-review again in the fresh context.
Fresh-context review is required because it often catches issues that current-context review misses.
4. Repeat until clean
If the fresh-context review finds blockers:
- fix them
- rerun relevant tests
- commit and push
- explicitly confirm the pushed SHA state
- send
/newagain - rerun fresh-context
pr-review
Keep looping until the fresh-context review is clean.
Finalization gate
After the clean fresh-context review, force one last prompt reread against .claude/TASK-*.md.
Only then should the agent:
- open or update the PR
- report PR number
- report PR URL
- report exact HEAD SHA
PR sync check
Before considering the branch settled, confirm that the local branch, remote branch, and PR head all match.
Useful commands:
git rev-parse HEAD
git rev-parse origin/<branch>
gh pr view <number> --json headRefOid,updatedAt,urlIf those SHAs do not match, the branch is not actually settled yet.
Full-suite instruction
If an agent chooses to run the whole repository suite, tell it to use:
pytest -n auto --no-covCompletion checklist
A supervised branch is only complete when all of these are true:
- The agent reread its local
.claude/TASK-*.mdand confirmed full prompt coverage. - Current-context
pr-reviewwas run. - Any blockers were fixed, tested, committed, and pushed.
- Pushed-state SHA confirmation was given.
/newwas sent and verified.- Fresh-context
pr-reviewwas run. - The fix/push/
/new/fresh-review loop repeated until clean. - Final prompt reread was done.
- The PR was opened or updated.
- The local SHA, remote SHA, and PR head SHA all match.
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.

