session-orchestrator
Loop engineering for AI coding agents — turn ad-hoc sessions into a repeatable research → plan → wave-execute → close loop with verification gates. Runs on Claude Code, Codex CLI, Cursor, and Pi.
Package details
Install session-orchestrator from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:session-orchestrator- Package
session-orchestrator- Version
4.2.0- Published
- Sep 9, 2026
- Downloads
- 1,237/mo · 280/wk
- Author
- kanevry
- License
- MIT
- Types
- extension, skill, prompt
- Size
- 11.1 MB
- Dependencies
- 11 dependencies · 0 peers
Pi manifest JSON
{
"extensions": [
"./pi/extensions/session-orchestrator.ts"
],
"skills": [
"./skills"
],
"prompts": [
"./pi/prompts/*.md"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
Session Orchestrator
Plan, run and verify coding sessions with Claude Code, Codex CLI, Cursor IDE, or Pi. Session Orchestrator reads your repository and issues, proposes a plan, coordinates work in waves, and records what passed and what remains. Free, MIT-licensed, and community-maintained.
Website · User guide · Platform support · Changelog
The same workflows are available on all four harnesses; Codex exposes commands as selectable skills. Enforcement depth differs — scope enforcement is full on Claude Code, bridged on Cursor and Pi, and currently unavailable on Codex CLI (see Platform support).
Requirements
| Node.js | 24 or later (node --version) — package.json engines.node is >=24.0.0. The plugin is ES modules and needs a real Node runtime. Install Node.js. |
| A coding agent | Claude Code, Codex CLI, Cursor IDE, or Pi. This is a workflow layer on top of one of them, not a replacement. |
| Harness version | Codex CLI 0.144.4 or later (docs/codex-setup.md). No minimum is pinned for Claude Code, Cursor, or Pi — if /plugin (or the Cursor/Pi installer) runs, the plugin loads. |
| OS | macOS and Linux are tested in CI. Windows is untested and best-effort; shell hooks and the optional Bash/jq MCP server need WSL or Git Bash. |
| Git | A git repository. Session-orchestrator reads git state at every session start and commits at close. |
Install
| Platform | Install |
|---|---|
| Claude Code | /plugin marketplace add Kanevry/session-orchestrator then /plugin install session-orchestrator@kanevry (run both inside Claude Code). |
| Codex CLI | git clone https://github.com/Kanevry/session-orchestrator.git ~/Projects/session-orchestrator && cd ~/Projects/session-orchestrator && npm install && node scripts/codex-install.mjs |
| Cursor IDE | git clone https://github.com/Kanevry/session-orchestrator.git ~/Projects/session-orchestrator && cd ~/Projects/session-orchestrator && npm install && node scripts/cursor-install.mjs /path/to/your/project |
| Pi | pi install npm:session-orchestrator — or dev-fallback: git clone https://github.com/Kanevry/session-orchestrator.git ~/Projects/session-orchestrator && cd ~/Projects/session-orchestrator && npm install && node scripts/pi-install.mjs /path/to/your/project --settings-only |
For Claude Code, also install the package's Node dependencies once and restart Claude Code. First locate the installed plugin:
claude plugin list --json
Find the enabled session-orchestrator@kanevry entry, then replace the placeholder below with its installPath value:
cd "/absolute/installPath/from/the/list" && npm install
If that entry is missing or disabled, resolve it through /plugin first. Use the path reported for that entry; another cached version or a nested dependency is not the installed plugin.
Setup guides: Codex · Cursor IDE · Pi. Per-IDE notes on CLAUDE.md vs AGENTS.md: instruction-file-resolution.
Quick Start
In Codex, select the corresponding Session Orchestrator skill in the picker or use $session-orchestrator:<command>; the slash commands below name the shared workflows. For example, bootstrap with $session-orchestrator:bootstrap. See Codex usage.
1. Bootstrap the repo once. Run /bootstrap in your project — it scaffolds the minimum structure and writes .orchestrator/bootstrap.lock, which session-start requires before /session will run.
2. Declare a Session Config. Add a ## Session Config section to your project's CLAUDE.md (Claude Code, Cursor IDE) or AGENTS.md (Codex CLI, Pi) — see instruction-file-resolution for which file each platform reads. The smallest valid config is seven fields:
## Session Config
test-command: npm test
typecheck-command: npm run typecheck
lint-command: npm run lint
agents-per-wave: 6
waves: 5
persistence: true
enforcement: warn
Everything else is opt-in. Full template: docs/session-config-template.md. Canonical types and defaults: docs/session-config-reference.md.
3. What the first /session writes into your repo. Nothing outside these paths, all plain text, all local:
.orchestrator/bootstrap.lock # written by /bootstrap, the gate for every later run
.orchestrator/current-session.json # which session owns this working copy right now
.orchestrator/session.lock # heartbeat lock — stops two sessions colliding in one checkout
.orchestrator/host.json # host-local identity for peer-session detection
.orchestrator/metrics/*.jsonl # append-only session, learning, event and subagent records
.orchestrator/steering/ # stable product/tech/structure context injected each session
.claude/STATE.md # wave progress and deviations (harness-specific directory)
A session in three commands
/session feature # research + Q&A — inspect git, issues, history, then agree on scope
/go # execute in typed waves sized by session type (feature: 3, deep: 5) — quality gate between each
/close # verify every item, commit cleanly, file carryover issues for the rest
In Codex, invoke the same loop through the generated command skills:
$session-orchestrator:session feature
$session-orchestrator:go
$session-orchestrator:close
These entries preserve each command's full workflow and prechecks. Codex's native /goal is a separate feature. /plan and /evolve extend the loop, but you can start with just these three.
Upgrade
/plugin update session-orchestrator@kanevry # Claude Code
Restart the harness afterwards, and re-run npm install in the plugin directory when the release adds dependencies. On Cursor and the Pi clone fallback, upgrade with git pull in your clone followed by the same install script you originally ran. Manage npm-installed Pi packages through Pi's package manager. For Codex, follow the refresh instructions for your marketplace source, then reload the skill picker or restart Codex.
Session-start tells you when the running copy is behind: scripts/lib/plugin-update-banner.mjs compares the version of the code that is actually loaded against the published npm version and warns in the session-start banner (minor or major; patch-only updates stay silent). It fails silent — offline, a non-2xx response, or a malformed answer produces no statement, never a false "up to date".
Upgrading across a major version: docs/migration-v4.md is the current one — v4.0.0 removes five skills, three commands and eight top-level scripts, each on a measured 90-day two-signal rule rather than a judgement call, and it names what replaces every removed invocation. docs/migration-v3.md documents the older v2 → v3 path and the shape both guides follow (what changes · prerequisites · per-platform steps · what stays · known issues · rollback).
Uninstall
Remove the plugin through your harness's own plugin manager — /plugin in Claude Code (marketplace entry session-orchestrator@kanevry), codex plugin remove on Codex CLI (docs/codex-setup.md), or Pi's package manager for an npm-installed Pi package. On Cursor and the Pi clone fallback, delete the files the installer wrote into your project.
What stays behind in your repo — none of it is removed by uninstalling, and all of it is plain text you can delete by hand:
.orchestrator/—bootstrap.lock,metrics/(your session and learning JSONL records),policy/,steering/,runtime/,peers/,session.lockSTATE.mdunder your harness's state directory (.claude/STATE.mdon Claude Code — see Platform support)- The
## Session Configblock you added toCLAUDE.md/AGENTS.md .claude/rules/*.mdif you vendored the rule library via/bootstrap --sync-rules
Deleting .orchestrator/metrics/ deletes your session history. Telemetry requires explicit consent (see Data & telemetry). The session-start update check (scripts/lib/plugin-update-banner.mjs) makes an anonymous GET to the npm registry to compare your installed version against the latest release. Successful results are cached for 24 hours per repo; failed checks can retry at the next session start. Set SO_DISABLE_UPDATE_CHECK=1 (or DO_NOT_TRACK=1) to turn it off.
Lifecycle and waves
The rendered diagram above (assets/wave-lifecycle.svg) survives anywhere Markdown does. The Mermaid source below is the maintainable version of the same two flows:
flowchart TD
Z["/bootstrap"] -->|once per repo, writes bootstrap.lock| B["/session [type]"]
A["/plan [feature|retro]"] -->|optional, defines WHAT| B
B -->|research + Q&A| C["/go"]
C -->|5 waves with quality gates| D["/close"]
D -->|verifies + commits| E["/evolve [analyze]"]
E -->|extracts cross-session learnings| B
style Z fill:#475569,color:#fff
style C fill:#1f6feb,color:#fff
style D fill:#238636,color:#fff
flowchart LR
W1["1·Discovery<br/>read-only audit"] --> G1{Gate}
G1 --> W2["2·Impl-Core<br/>primary code"]
W2 --> G2{Gate}
G2 --> W3["3·Impl-Polish<br/>integration, edges"]
W3 --> G3{Gate}
G3 --> W4["4·Quality<br/>simplify + tests"]
W4 --> G4{Full Gate}
G4 --> W5["5·Finalization<br/>commit + close"]
style G4 fill:#d29922,color:#000
/plan is optional — you can create issues manually and jump straight to /session. /evolve runs deliberately after 5+ sessions, not automatically. Both diagrams show the happy path; a failing gate stops the wave and hands the findings back.
For sessions that outgrow five waves there is a named ultradeep profile: a profile over session-type: deep that runs seven waves — Research + Code-Discovery, a blocking coordinator Synthesis-Gate, Impl-Core, Impl-Polish, a read-only Review-Panel, Quality, Release — instead of a fourth session-type enum value. Downstream tooling still sees deep.
How it works
Most agentic-coding tools jump straight into writing code. Session Orchestrator adds a structured loop on top: research first, agree on scope, then execute in typed waves with verification gates between them.
When you type /session feature:
- Phase analysis runs in parallel — git state, open issues, recent commits, SSOT freshness, resource health, and prior-session memory are all inspected, then distilled into a structured Session Overview with a recommendation, not a wall of raw data.
- You agree on scope — through a tool-rendered picker (Claude Code) or a numbered list (Codex / Cursor / Pi). The orchestrator has an opinion and tells you what it would do.
- The plan is decomposed into waves — Discovery (read-only), Impl-Core, Impl-Polish, Quality, Finalization. Each wave has a defined purpose and a deliverable; agent counts scale by session type.
/goexecutes — agents work in parallel within a wave. A session-reviewer audits the output between waves on eight dimensions; only findings at confidence ≥ 80 reach you./closeships it — every planned item is verified, quality gates run full, and unfinished work becomes carryover issues. Files are staged individually, so parallel sessions can't stomp each other.
Two complementary commands round out the loop: /plan runs before a session when you need a PRD or retrospective; /evolve runs occasionally to surface patterns across sessions and feed them back at the next start.
The system is markdown-driven config plus a thin Node runtime — skills, commands, and agents are Markdown with YAML frontmatter; scripts/lib/*.mjs and hooks/*.mjs handle dispatch, validation, and telemetry. Everything is plain text: if something goes wrong, you can read every file and see what happened.
What you get
Counts measured on 2026-09-07 with the command in brackets:
- 43 skills for the session lifecycle (start, plan, execute, close, evolve), discovery, vault sync, MCP authoring, debugging, brainstorming, plan grilling, persona panels, cross-repo dispatch, learning→rule reconciliation, session-process eval, and audits (
ls -d skills/*/ | grep -v _shared | wc -l) - 25 slash commands (
/session,/go,/close,/discovery,/plan,/grill,/evolve,/autopilot,/dispatcher,/reconcile,/eval,/test,/debug, …) (ls commands/*.md | wc -l) - 14 typed subagents (code-implementer, test-writer, security-reviewer, session-reviewer, qa-strategist, architect-reviewer, …) (
ls agents/*.md | wc -l) - 27 hook files across 10 event types, enforcing scope, blocking destructive commands, gating templates-first, and capturing telemetry — full on Claude Code; experimental, post-hoc, or bridged elsewhere (Platform support) (
ls hooks/*.mjs | wc -l) - 26 rule files and 18 ADRs carrying the reasoning behind the mechanisms (
ls .claude/rules/*.md | wc -l,ls docs/adr/*.md | wc -l) - 664 vitest test files covered by the full quality gate and CI — 13,789 static
it()/test()definitions at that measurement, and the runtime total is higher because of parameterised blocks (methodology) (find tests -name '*.test.mjs' | wc -l); Full Gate 2026-09-09: 16847 passed / 11 skipped / 664 files
Portable across harnesses by construction. scripts/generate-agents-skills.mjs generates root AGENTS.md byte-identical from CLAUDE.md and the .agents/skills/<name>/SKILL.md mirrors, with spec-legal frontmatter and pointers to canonical instructions. scripts/generate-codex-skills.mjs generates the Codex command entrypoints. Plugin validation checks both surfaces. Separate manifests under .claude-plugin/, .codex-plugin/ and .cursor-plugin/ register each harness's components; see Codex manifest compatibility.
Full component inventory: docs/components.md. Version history and per-release detail: CHANGELOG.md.
Why this design
- Typed waves, not one big batch. Discovery first, so implementers start with shared context. Impl-Core before Impl-Polish, so architecture lands before integrations. Quality runs a simplification pass on AI-generated code before tests are written — otherwise tests pin the AI patterns into place.
- Inter-wave reviews, not just end-of-session. Catching regressions between waves stops a bad pattern from propagating into later work; the confidence floor filters speculative criticism so only high-signal findings reach you.
- State persists across crashes.
STATE.mdrecords wave progress and deviations; the next/sessionoffers to resume from the last completed wave. - Hook enforcement has a defined platform boundary. Claude Code hooks block covered destructive commands; writes outside declared paths warn in
warnmode and block instrictmode. Cursor and Pi bridge supported events. Codex currently has no scope-enforcement adapter (Platform support). - Parallel operator sessions are treated as a hazard. Two humans — or two of your own sessions — in the same working copy share one git index, one filesystem, one
STATE.md. A heartbeat session lock, peer-scope manifests, and the PSA rule set in.claude/rules/parallel-sessions.mdexist for exactly that axis. - Cross-session learning is opt-in and inspectable. Every session writes a record; after 5+ sessions
/evolve analyzeextracts confidence-scored patterns you can read and prune. Nothing is hidden. - VCS dual support, no lock-in. Auto-detects GitLab or GitHub from your remote and drives the full lifecycle for both.
How this compares to other orchestrators — with the parts that are measured and the parts that are not: docs/components.md § Comparisons.
Recent highlights (v4.2.0)
Highlights of the v4.2.0 line:
- One place resolves a session into its shape.
node scripts/session-shape.mjsturns a mode (housekeeping/feature/deep, optional ultradeep profile) into waves, per-wave agent caps, isolation and enforcement, and records the result as an event. Housekeeping is now the maintenance loop (drift-check, sweep, evolve, reconcile, dialectic, memory-cleanup), driven by the session-startmaintenance-dueprobe instead of close-time nudges. - Honest cost numbers. Subagent telemetry schema v2 counts cache-read and cache-creation tokens (previously under-reported ~65,000×); a per-model price table rolls up USD per session. The issue-budget ledger is reconciled against the session record at close.
- Leaner tree. A dead-code sweep removed 13 unreachable library modules and their tests;
js-yamlpatched for GHSA-2883-xcg3-v3hh; ten reconciled learnings absorbed into the thematic rule files so the generated-rule surface stays under budget.
If upgrading from before 4.0, read the v4 migration guide. Full changes and verification: CHANGELOG.md.
Platform support
| Feature | Claude Code | Codex CLI | Cursor IDE | Pi |
|---|---|---|---|---|
| All 25 commands | Native slash commands | Generated skills ($session-orchestrator:<name>) |
Native .cursor/commands slash commands |
Prompt templates |
| Parallel agents | Agent tool | Multi-agent roles | Sequential only | Sequential (parallel planned) |
| Session persistence | .claude/STATE.md |
.codex/STATE.md |
.cursor/STATE.md |
.pi/STATE.md |
| Scope enforcement | PreToolUse hooks | Unavailable — pending a real apply_patch adapter |
preToolUse + beforeShellExecution via cursor-hook-bridge; afterFileEdit post-hoc |
tool_call bridge |
| AskUserQuestion | Native tool | Numbered-list fallback | Numbered-list fallback | Numbered-list fallback |
| Quality gates | Full | Full | Full | Full |
All platforms share the same skills, commands, and scripts; hooks use platform-specific adapters and event subsets. Codex intentionally wires only its six supported project event slots and omits Claude-only events plus Edit/Write payload handlers until a real Codex apply_patch adapter exists, so scope enforcement is currently unavailable there. Platform detection lives in scripts/lib/platform.mjs. Cursor and Pi have known event-coverage caveats — see docs/cursor-setup.md and docs/pi-setup.md.
Safety & data & telemetry
Your data stays in your repo. Session Orchestrator runs locally, requires no account, and writes its records as append-only JSONL under .orchestrator/metrics/ in your repository — sessions, learnings, events, subagent records. Those files are yours: readable, greppable, deletable. Optional anonymous usage telemetry is off until you explicitly consent and is separate from the local records (docs/telemetry.md says exactly what it would collect and how to turn it off). Reported metrics describe this repository under its own conditions and will not transfer unchanged to yours (details).
Destructive-command guard. On Claude Code, hooks/pre-bash-destructive-guard.mjs enforces .orchestrator/policy/blocked-commands.json — 14 rules, of which 10 block outright (git reset --hard, rm -rf, git push --force, and more) and 4 warn — in the main session and in subagent waves. Other harnesses depend on their event adapters; see Platform support. Bypass per session only for intentional maintenance:
allow-destructive-ops: true
The rule source of truth is .claude/rules/parallel-sessions.md (PSA-003), vendored to consumer repos via /bootstrap.
Import probe. hooks/post-edit-import-probe.mjs (PostToolUse on Edit/Write/MultiEdit) guards the other direction: a hook-reachable helper saved in a broken intermediate state makes every Bash/Edit/Write call fail with "Internal hook error — request blocked", host-wide, for every session sharing the working copy. Right after such a file is saved the probe runs ESLint no-undef on it (plus a child-process import() for scripts/lib/**) and reports the blast radius; it never blocks and always exits 0. It only fires for files listed in the committed allowlist hooks/_lib/hook-import-set.json, regenerated by node scripts/generate-hook-import-set.mjs. Kill switch: SO_DISABLED_HOOKS=post-edit-import-probe.
Troubleshooting
Codex plugin or hooks not loading. Start with codex plugin list --available --json. Confirm session-orchestrator@kanevry is installed, enabled, unique, and at the tracked manifest version; then start a fresh task and review /hooks. Remove only the two allowlisted legacy IDs through codex plugin remove, and resolve marketplace conflicts through the public marketplace remove/add lifecycle before reinstalling. Any other pre-public plugin/config/cache/hook-state residue is unsupported: do not modify private Codex files; file an issue with codex --version plus the public plugin and marketplace list output. Full decision tree: docs/codex-setup.md.
"'node' not found on the hook PATH — plugin hooks are skipped." The harness executes hook commands via /bin/sh -c with its own PATH — that shell does not source ~/.zshrc/~/.bashrc, so Node installed via Homebrew, nvm, volta, or asdf can be invisible to hooks even though node works in your terminal. All hook commands route through hooks/run-node.sh, which resolves Node via $SO_NODE_BIN → PATH → well-known install dirs → nvm and degrades gracefully: hooks are skipped with one warning per 6 hours instead of a shell error on every tool call. Fixes, in order of preference: launch the harness from a shell where node resolves; export SO_NODE_BIN=/abs/path/to/node; or install Node 24+ to a standard location.
/session refuses to start. It needs .orchestrator/bootstrap.lock — run /bootstrap first, or /bootstrap --retroactive if the repo already has a ## Session Config block.
Development
git clone https://github.com/Kanevry/session-orchestrator.git && cd session-orchestrator
npm install
npm test # vitest
npm run lint # ESLint v10 + Prettier
npm run typecheck # node --check on every .mjs file
.npmrc ships with ignore-scripts=true (supply-chain defence), so Husky git hooks don't auto-wire on install — run npx husky once after cloning. git commit then runs gitleaks → owner-privacy scan → lint-staged → commitlint. CI re-runs everything, plus more.
Two directories share the name rules and play opposite roles: rules/ is the deliverable rule library shipped out to consumer repos via /bootstrap --sync-rules, while .claude/rules/ is this repo's own rule set with always-on and path-scoped entries.
Contributor docs: Plugin Architecture (v3) · CONTRIBUTING.md · sub-agent authoring spec.
Support & scope
Session Orchestrator is provided as-is — a community project with no SLA, no commercial support contract, and no guaranteed response time. Maintenance is best-effort.
- Questions, ideas, show-and-tell → GitHub Discussions
- Bugs and feature requests → Issues
What it is not:
- Not an official product of any agent vendor. An independent, community-maintained project — not affiliated with, endorsed by, or sponsored by Anthropic, OpenAI, Cursor, or any agent it integrates with. (It is distributed through the Claude Code plugin marketplace, but is not an Anthropic product.)
- Not a replacement for Claude Code / Codex CLI / Cursor / Pi. It is a workflow layer that runs on top of your existing agent — you still need one of those installed.
- Not a multi-user product. Single-operator by design; the parallel-session machinery protects one operator's concurrent sessions, not a shared team workspace.
Documentation
- docs/ Router — living reference vs. public decision history vs. active work documents
- User Guide — installation, config reference, workflow walkthrough, FAQ
- Components & Reference — full skill/command/agent/hook inventory, repository anatomy, comparisons
- Plugin Architecture (v3) — contributor guide, layering, hook anatomy, testing
- Migration to v4 — upgrade path, removed surfaces and replacements
- Telemetry · Telemetry claims — what is collected, how metrics are measured, why they may not transfer
- Example Configs — Session Config examples for Next.js, Express, Swift
- CHANGELOG.md — version history
We follow Conventional Commits — see CONTRIBUTING.md.
Learn the method behind it
This plugin is a methodology turned into code. The reasoning behind it — why execution runs in waves, why every wave ends at a verification gate, how to make an autonomous loop that actually finishes — is taught hands-on at agenticbuilders.at: Multi-Agent Orchestration and Loop Engineering. The plugin is free and MIT; the courses are for going deeper, not a requirement for using it.
Links
Homepage (also at /de in German, with a plain-words layer above the developer detail) · Privacy Policy · npm