agentleFS
T0mSIlverT0mSIlver/skills/orchestrate-sessions/SKILL.md

orchestrate-sessions

Skill1 starsChanged 2 months agoMITView on GitHub

Run a Claude Code desktop session as the orchestrator for many parallel sessions on one repo: spawn one session per independent issue (chips only the owner can start; subagents only explore, on Sonnet), brief and greenlight them, take handoffs, keep the pipeline full, archive finished sessions and clean up, and report to the owner. Pairs with merge-queue, scarce-resource, needs-you and quota. Use when the owner asks this session to split work across sessions, act as the scheduler, take over from a previous scheduler, unblock or relaunch sessions, or archive finished ones.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Taking over: read ~/.config/orchestrate/<repo>.env (reference/repo-config.md.

    line 14
  2. Very specific:

    Before spawning,: search the issue number in open PRs and in list_sessions titles (work in progress often has no PR).

    line 42
  3. Very specific:

    Keep the pipeline full: When a session finishes, spawn or propose the next well-defined issue.

    line 48
  4. Very specific:

    After every merge batch, without being asked: archive each session whose PR merged (or the owner closed) or whose handoff is posted, once …

    line 78
  5. Very specific:

    Every change gets a cross-vendor review (cross-review).

    line 86
  6. Very specific:

    Metered review quota is a resource too: Keep every window busy with the strongest model on reviews and audits (quota).

    line 88
  7. Very specific:

    When the owner comes back: what happened, what went wrong, what needs them now (hand checks: gh pr list --state all --label <hand-check …

    line 104
  8. Distinctive:

    Before compaction, write the plan and ledger to memory, then give the owner a compaction prompt: config path, memory files, background …

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

Orchestrate sessions

You don't implement. You spawn sessions, hand out the shared resource, merge, archive, and tell the owner what needs them. What you only remember is lost at compaction, so state lives in files: the repo config, the project memory and PR handoff comments.

Taking over: read ~/.config/orchestrate/<repo>.env (reference/repo-config.md; if missing, write it from the repo's AGENTS.md and CI workflow, and keep it in the owner's dotfiles), then the project memory and the repo's agent guide. Take stock with list_sessions, gh pr list --state open (labels, draft state) and orch-conflicts. Run orch-iam, then restart the background loops: green poller, combo watcher, idle watcher, next wake-up, quota queue.

The other skills

  • Merging: merge-queue (poll for green, check against main, combos, stacking, waits: labels, merge classes).
  • The shared resource: scarce-resource (night window, wake-ups, dispatch order, greenlighting lanes).
  • Owner decisions: needs-you, a page the owner keeps open.
  • Review quota: quota; quota-queue keeps every window busy.

The orch-* scripts are on PATH, else in this skill's scripts/; run them from a checkout of the repo.

Sessions

  • Work goes to chips, which only the owner can start; the click is their OK. While the owner is away, queue the briefs, batching related small fixes into one (each session pays 50–75k tokens to start). Subagents and fleets only explore, read-only, on a full Sonnet model ID, never waiting on a build, CI, a review or the owner: their cache lasts 5 minutes, so each return from a longer wait re-sends the whole context.
  • Before spawning, search the issue number in open PRs and in list_sessions titles (work in progress often has no PR). Title with (#n). The prompt stands alone: issue (none yet: open one first), what to read, the proof its PR carries, the open PRs it may collide with and whether to stack, "message the scheduler (this session's title) before using the resource and before gh pr ready", reviewers, who merges.
  • Keep the pipeline full. When a session finishes, spawn or propose the next well-defined issue. At each wake-up, list_events on sessions idle on a question or a green draft, and answer or nudge those idle under an hour. Archive the rest (Idle sessions).
  • Greenlight each gh pr ready by the lanes the head will run (scarce-resource).
  • Handoffs before long waits. A session that would wait hours posts a handoff comment (exact commands, a prepared commit per outcome, decision rules); archive it and run the steps yourself, or queue them for a chip.
  • Messages go to the local_… id from list_sessions. Broadcast owner rulings to every running session.

Usage

The owner's weekly Claude limit runs out first. Run at /effort low.

  • Idle sessions. orch-idlewatch, under Monitor, names each session idle 50 minutes, before its 1-hour cache expires. Nudge it with its next step if one is due within the hour; otherwise have it post a handoff and archive it. Past the hour the session is cold: archive it, never message it. A message re-sends its whole context at the cache-write rate (2x input), and a fresh session that reads the handoff costs less. The one exception is a session that holds what no handoff, PR or issue has, which the handoff before every long wait rules out.
  • Yourself. The orchestrator-cache mod (owner's dotfiles) sends you a keepalive at 50 idle minutes, or compacts you, as the owner switches it. On a keepalive, do only steps that are due; else answer "warm".

Archiving and cleanup

After every merge batch, without being asked: archive each session whose PR merged (or the owner closed) or whose handoff is posted, once orch-wtclean says CLEAN. Check title and cwd first; touch only the repos the owner named. Then remove the worktrees you made (review, combo, fleet slices). Archiving deletes a session's worktree, so a night step fetches the PR head instead.

Reviews and quota

  • Every change gets a cross-vendor review (cross-review); data-safety and trust-boundary PRs get two vendors at high effort.
  • Metered review quota is a resource too. Keep every window busy with the strongest model on reviews and audits (quota). A PR waiting on that review carries waits:deep-review.
  • Audits of a bug class (data loss, dead code): two vendors read main in parallel, then one tracking issue, a sub-issue per finding, and one session per sub-issue.

Reporting

  • Answer first, then Needs you: one line per decision with your recommendation and default. PRs as links, sessions by issue number.
  • Long output buries questions. With a Needs You page (needs-you), each decision goes there and chat gets one line.
  • Between tool calls, write only what changes what the owner would do (a merge, a red run, a session that needs them); never narrate checks or plans. Opus 5.5 writes a progress note there by default.
  • When the owner comes back: what happened, what went wrong, what needs them now (hand checks: gh pr list --state all --label <hand-check label>, as links).
  • Before compaction, write the plan and ledger to memory, then give the owner a compaction prompt: config path, memory files, background loops, night plan, live sessions, what waits on them.

Gotchas

  • Workers share one machine: they kill only PIDs they started, never send Command + letter key codes (on AZERTY, Cmd+A's code is Cmd+Q), and a safety check that refused stays refused.
  • Times in UTC with the owner's offset. zsh doesn't word-split $var. Scratchpad scripts vanish with the session; what a successor needs goes in the skill, config or memory.
  • To stop a wrong turn, send the correction, then stop_session.
  • A data-loss report comes first: back up, read-only forensics, restore on the owner's go (reference/incidents.md).

Not possible

  • Starting a chip (only the owner can) or archiving a session mid-turn (retry after its reply).

reference/worked-example.md shows one real scheduler (a single self-hosted Mac runner); reference/incidents.md holds the evidence behind the rules of all four skills.

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.