Multi-agent orchestration template — senpai is a session role. Grok Build is the default/proven host; Claude Code and Codex CLI can host experimentally. Workers stay Claude and Codex, launched only through .grok/orchestration/senpai.sh (no eval).
GitHub: kengggg/grok-senpai
Defaults: Claude Fable (fable) at high · Codex Sol (gpt-5.6-sol) at ultra. Override in plain English any time.
Solo agents blur planning, coding, and review. grok-senpai makes the workflow explicit:
| Role | Who |
|---|---|
| Senpai host (default) | Grok Build |
| Deep reasoning / architecture / adversarial review | Claude Code (claude-worker) |
| Scoped implementation / mechanical review | Codex CLI (codex-worker) |
| Simple independent slices | Grok subagents |
Every non-trivial change is a proposal until verification, cross-model review, and human approval. See AGENTS.md for the full playbook, or docs/design-model-roles-visibility.md for model selection, roles, and visibility design.
bash tests/senpai/run.sh bash tests/senpai/conformance.sh
Fake runners only. No live model usage.
- Grok Build (orchestrator)
- Claude Code CLI (optional, for
claude-worker) - Codex CLI (optional, for
codex-worker) - Git (required for worktrees)
grok-senpai/
├── .grok/
│ ├── skills/
│ │ ├── senpai/
│ │ │ └── SKILL.md
│ │ ├── claude-worker/
│ │ │ └── SKILL.md
│ │ └── codex-worker/
│ │ └── SKILL.md
│ └── orchestration/
│ ├── senpai.sh
│ ├── state.md
│ ├── worker-config.toml # model + effort defaults (Fable/high, Sol/ultra)
│ ├── worker-config.example.toml
│ ├── model-aliases.toml # friendly name → CLI model
│ ├── model-aliases.example.toml
│ ├── TASK_PACKET.template.md
│ ├── RESULT_PACKET.template.md
│ ├── REVIEW_PACKET.template.md # implementer → reviewer handoff
│ ├── reviews/ # written Review Packets per task
│ └── logs/ # gitignored worker I/O
├── examples/
│ └── clamp/ # optional worked example
├── install.sh # install into another project
├── AGENTS.md # playbook (project instructions for Grok)
├── docs/
│ ├── cover.jpg # 16:9 README hero
│ ├── og-image.jpg # 1280×640 (2:1) social preview, safe margins
│ └── design-model-roles-visibility.md
├── README.md
└── LICENSE
Assets
docs/cover.jpg— 16:9 READMEdocs/og-image.jpg— 1280×640 (2:1) Social preview with safe margins
From inside your project directory:
curl -sL https://raw.githubusercontent.com/kengggg/grok-senpai/main/install.sh | bashOr pass a target path:
curl -sL https://raw.githubusercontent.com/kengggg/grok-senpai/main/install.sh | bash -s -- /path/to/your-appPin a branch or tag:
GROK_SENPAI_REF=main curl -sL https://raw.githubusercontent.com/kengggg/grok-senpai/main/install.sh | bashgit clone https://github.com/kengggg/grok-senpai.git /path/to/grok-senpai/install.sh /path/to/your-app /path/to/grok-senpai/install.sh --host claude --target /path/to/your-app # or, from inside your app: /path/to/grok-senpai/install.sh .
cp -R path/to/grok-senpai/.grok . # Merge the playbook into AGENTS.md yourself — prefer install.sh
.grok/skills/—senpai,claude-worker,codex-worker(always refreshed on re-run).agents/skills/senpai/and.claude/skills/senpai/— native host discovery copies (--hostcan limit these).grok/orchestration/senpai.sh— pack-floor helper.senpai/— additive machine state on fresh installs (journal, ledger, locks, runs). Existing.grokjournals stay put..grok/orchestration/— Task/Result/Review packet templates + config/alias examples (refreshed)worker-config.toml— created once with defaults; not overwritten on re-runmodel-aliases.toml— created once with friendly aliases; not overwritten on re-runlogs/— created for worker output used by progress heartbeats; ignore rules are added idempotentlystate.md— created once; kept on re-runAGENTS.md— Multi-Agent Orchestration Playbook merged or created (idempotent markers)
Handoff flow: Task Packet → implementer Result Packet → Review Packet (summary + diff) → opposite-model review → human approval.
| Worker | Model | Effort |
|---|---|---|
| Claude | Fable (fable) |
high |
| Codex | Sol (gpt-5.6-sol) |
ultra |
Grok may lower effort per Task Packet (worker_effort) when the playbook allows; floors default to high. Edit .grok/orchestration/worker-config.toml to change project defaults.
Friendly aliases (edit .grok/orchestration/model-aliases.toml):
| You say | CLI model |
|---|---|
opus / Opus 5 |
opus |
claude-opus-5 |
claude-opus-5 |
fable / sonnet |
same alias |
sol |
gpt-5.6-sol |
You never need to edit a Task Packet. Add a model, effort, or one-turn role override when you want one:
Use claude Opus 5 max for the architecture. # optional override; default is Fable high
Codex sol ultra, implement the approved slice.
Claude dev, codex review this turn.
Codex implement, claude review.
What Grok does with that:
- Resolves aliases via
model-aliases.tomland writes concreteworker_model/worker_efforton the Task Packet - Echoes a Launch plan (agent, role, model, effort, worktree) before invoke
- Confirms unknown aliases instead of launching blindly
- Honors role overrides for that task chain only; otherwise uses the routing table in
AGENTS.md
While a worker runs, Grok:
- Captures worker I/O to
.grok/orchestration/logs/<task_id>.log(gitignored) - Records PID + log path in
.grok/orchestration/state.md - Posts a short heartbeat about every 2 minutes (and on “status?”)
- Reports phase, last signal, and worktree churn — not a full tool stream
Re-run the installer to pull new skills + playbook (keeps your state.md, worker-config.toml, and model-aliases.toml):
curl -sL https://raw.githubusercontent.com/kengggg/grok-senpai/main/install.sh | bashTo adopt stock Fable/high + Sol/ultra (overwrites your worker-config):
cp .grok/orchestration/worker-config.example.toml .grok/orchestration/worker-config.toml
# optional: refresh aliases too
cp .grok/orchestration/model-aliases.example.toml .grok/orchestration/model-aliases.tomlYou do not run worktrees, Task Packets, or workers yourself.
- Open Grok Build in the project (git repo recommended).
- Describe the goal in plain language; optionally name a model, effort, or per-turn role.
- Grok reads
AGENTS.md, routes to Claude/Codex, verifies, and reviews. - You only approve or reject the final diff when asked.
Implement rate limiting on the login endpoint and add tests.
Follow the grok-senpai playbook.
| You (human) | Grok (orchestrator) |
|---|---|
| Describe the goal; optionally override models or roles | Reads AGENTS.md and follows the playbook |
| Approve (or reject) final diffs when asked | Creates worktrees, Task Packets, launches workers |
| That’s it — no need to micromanage steps | Runs verification, opposite-model review, updates state.md, merges after your approval |
You do not need to invent worktree names, fill Task Packets, or choose Claude vs Codex. Grok routes by default, while still honoring an explicit model or role override for the current task.
You: state the goal
→ Grok: Plan
→ Grok: Worktree (orch/<task>-<agent>) — mandatory isolation
→ Grok: Task Packet + resolved Launch plan
→ Grok: Worker skill (Claude or Codex) + ~2m heartbeats
→ Grok: Result Packet + verification
→ Grok: Review Packet (summary + diff handoff)
→ Grok: Independent review (opposite model)
→ You: approve or reject the final diff
→ Grok: Merge + worktree cleanup
The playbook in AGENTS.md and the worker skills are instructions for Grok, not a checklist for you.
examples/clamp/ is a small pure-function walkthrough (implement → review → polish) used to validate grok-senpai. It is optional teaching material, not required runtime.
cd examples/clamp python3 -m unittest discover -s . -p "test_*.py" -v
MIT — see LICENSE.
