agentleFS
mindroom-aimindroom-ai/mindroom/.claude/skills/agent-cli-tmux-supervision/SKILL.md

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.

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
  1. Very specific:

    Use this skill when you are supervising parallel Codex branches launched with agent-cli dev new ...

    line 8
  2. Distinctive:

    Use this skill when:

    line 15
  3. Distinctive:

    Do not use this skill when:

    line 22
  4. Very specific:

    Use a feature branch as --from only when the prompt explicitly depends on unmerged branch work.

    line 39
  5. Very specific:

    When telling an agent to reread its instructions, always point it at the local .claude/TASK-*.md file, not the original prompt path from …

    line 47
  6. Very specific:

    If uv sync --all-extras fails during setup but the tmux session still launches, treat that as a setup caveat, not an automatic launch …

    line 51
  7. Very specific:

    Do not trust one combined tmux send-keys ...

    line 57
  8. Very specific:

    If the text is visible at the prompt but not running yet, send another bare Enter.

    line 74
  9. Very specific:

    Do not use C-c just to submit buffered text.

    line 76
  10. Distinctive:

    When actively supervising agents, do a real polling loop instead of assuming they are still working.

    line 80
  11. Very specific:

    Before review, force the agent to reopen its exact .claude/TASK-*.md file and compare the branch against:

    line 105
  12. Distinctive:

    If there is still a prompt gap, the agent should keep working before review.

    line 117
  13. Distinctive:

    When parallel reviewers are running, let every reviewer finish its full pass even after another reviewer reports a blocker.

    line 121
  14. Distinctive:

    After the full passes finish, consolidate their findings into one fix batch.

    line 124
  15. Distinctive:

    Only require another whole-PR pass when the fix materially changes architecture or when the active review policy explicitly requires it.

    line 126
  16. Distinctive:

    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.

    line 127
  17. Distinctive:

    commit and push if it changed anything

    line 141
  18. Distinctive:

    If the review found blockers, do not move on until the agent confirms:

    line 145
  19. Distinctive:

    Do not accept vague answers like “should be fixed”.

    line 152
  20. Distinctive:

    After the current-context review is clean, send:

    line 156
  21. Distinctive:

    Verify the pane actually reset.

    line 162
  22. Distinctive:

    If the fresh-context review finds blockers:

    line 170
  23. Distinctive:

    Keep looping until the fresh-context review is clean.

    line 179
  24. Very specific:

    After the clean fresh-context review, force one last prompt reread against .claude/TASK-*.md.

    line 183
  25. Distinctive:

    Only then should the agent:

    line 185
  26. Distinctive:

    Before considering the branch settled, confirm that the local branch, remote branch, and PR head all match.

    line 194
  27. Distinctive:

    If those SHAs do not match, the branch is not actually settled yet.

    line 204
  28. Distinctive:

    If an agent chooses to run the whole repository suite, tell it to use:

    line 208

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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-cli worktrees
  • 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> Enter

Then verify that the message actually started running:

tmux capture-pane -p -t <session> | tail -n 20

Look 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.

  1. Sleep for about a minute.
  2. Capture the last 20-50 lines from each relevant tmux session.
  3. 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 40

Do 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:

/new

Verify 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 /new again
  • 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,url

If 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-cov

Completion checklist

A supervised branch is only complete when all of these are true:

  1. The agent reread its local .claude/TASK-*.md and confirmed full prompt coverage.
  2. Current-context pr-review was run.
  3. Any blockers were fixed, tested, committed, and pushed.
  4. Pushed-state SHA confirmation was given.
  5. /new was sent and verified.
  6. Fresh-context pr-review was run.
  7. The fix/push//new/fresh-review loop repeated until clean.
  8. Final prompt reread was done.
  9. The PR was opened or updated.
  10. The local SHA, remote SHA, and PR head SHA all match.

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.