An engineering loop for Claude Code: the main session leads, ponytail builds, critic reviews. Adapted from pstack by Lauren Tan.
Overview
keel is an engineering loop for Claude Code and Codex. The main session you talk to is the lead, ponytail builds, and critic reviews. pstack's method, skills, playbooks, principles and writing are hers, released under the MIT license, apart from material pstack itself adapted from others, which THIRD_PARTY_NOTICES.md credits. keel ports them from Cursor to Claude Code and Codex and reorganizes the agents around them, so the credit for how keel works belongs to pstack first. keel is an independent project and is not affiliated with or endorsed by Lauren Tan, Cursor, Anthropic or OpenAI. See credits and license. In this README, lowercase passages are pstack's original text, lightly adapted. Sentence-case passages are keel's. - is the main session. For real engineering work it loads the Claude Code or Codex lead skill, routes the task to one of 23 playbooks, and owns the design, plan, review and verification. Small asks it just does.
README
keel
keel is an engineering loop for Claude Code and Codex. The main session you talk to is the lead, ponytail builds, and critic reviews.
keel is adapted from pstack by Lauren Tan (poteto). pstack’s method, skills, playbooks, principles and writing are hers, released under the MIT license, apart from material pstack itself adapted from others, which THIRD_PARTY_NOTICES.md credits. keel ports them from Cursor to Claude Code and Codex and reorganizes the agents around them, so the credit for how keel works belongs to pstack first. keel is an independent project and is not affiliated with or endorsed by Lauren Tan, Cursor, Anthropic or OpenAI. See credits and license. In this README, lowercase passages are pstack’s original text, lightly adapted. Sentence-case passages are keel’s.
what it is
- The lead is the main session. For real engineering work it loads the Claude Code or Codex lead skill, routes the task to one of 23 playbooks, and owns the design, plan, review and verification. Small asks it just does.
- ponytail (Claude agent) owns one slice or pull request end to end: build, test, prove it on the real artifact, commit. In Codex, the lead gives that brief to a worker. A ponytail owner merges only under autopilot or when its brief says to land it.
- critic (Claude agent), generalized from pstack’s comment-review persona, Comment Sicko, reviews a diff through one lens: comments by default, or correctness, security, simplicity, tests or user impact. Codex gives the same brief to an independent reviewer.
keel keeps 50 of pstack’s 51 skills (its 24 principles are among them) and all 23 playbooks. Differences from pstack lists what changed.
install
Claude Code
keel needs Claude Code, git, the GitHub CLI gh (signed in), python3 for the git guard and bun for the playbook scripts. Optional: the Codex CLI for the cross-model review lane, tmux for driving interactive terminal apps, and Graphite (gt) for the Orchestrate playbook’s stacks.
claude plugin marketplace add tristanphvn/keel
claude plugin install keel@keel
To try it for one session without installing, clone the repository and run claude --plugin-dir ./keel.
Skills run as /keel:, and the agents are keel:ponytail and keel:critic. The main session loads lead on its own when a task needs it, or you type /keel:lead. It also loads help when you ask how to use keel, and typescript-best-practices on .ts and .tsx files. The other keel skills are user-invoked, so lead reads them by path when a step needs one.
Codex
Codex needs its CLI with plugin support, git, and bun for Keel’s playbook scripts. Playbooks that use GitHub also need the GitHub CLI gh signed in. Add the keel marketplace, then install the plugin:
codex plugin marketplace add tristanphvn/keel
codex plugin add keel@keel
Start a new Codex session after installation. Ask for nontrivial engineering work or invoke $keel:lead directly. The Codex lead reads the same playbooks and principles from the installed plugin. It delegates scoped work to Codex workers and uses independent reviewers with keel’s critic brief. Codex does not install Claude Code’s named agents or model aliases.
Codex’s workspace-write sandbox blocks the network, allows writes only in the workspace and temporary directories, and keeps the repository’s .git read-only. The lead asks you to approve each command that needs more:
- Network calls, such as
git fetch,git push,gh, and eachwatch-prrun. - Writes outside the workspace, such as the first run of keel’s playbook scripts, which installs their dependencies into the plugin.
- Git writes, such as commits and
git worktree add.
To allow git writes for a whole session, start or resume Codex with --add-dir and the repository’s .git directory. Sandboxed commands can then also change that repository’s Git config and hooks. The Orchestrate and multi-phase plan playbooks keep their state in keel-store/ in your Codex home (~/.codex by default). To let the lead write there, add --add-dir "${CODEX_HOME:-$HOME/.codex}/keel-store", or add that directory’s absolute path to sandbox_workspace_write.writable_roots in the home’s config.toml. Otherwise the lead keeps that state in a temporary directory.
Codex asks you to review the lead reminder in /hooks before it runs. The Codex plugin does not load Claude Code’s Git guard. That guard is a best-effort check of the command text, so do not rely on it as a Codex safety check.
For Claude Code, keel ships four hooks:
hooks/git-guard.py, adapted from Matt Pocock’s git guardrails (MIT), blocks force-pushes, deleting a protected branch on the remote,reset --hard,clean -f,filter-branch,filter-repo, and commands that discard the whole working tree, such asgit checkout .andgit checkout -f. The protected branches aremain,master,trunk,developandrelease*. The one exception is--force-with-leaseonto a branch that the command names and that is not protected, so an owner can publish its own rebased branch withgit push --force-with-lease origin. The guard catches the common forms an agent types by accident, including commands wrapped inbash -c,eval,$(...), subshells, heredocs fed to a shell, launchers such assudoorxargs, and abbreviated options. It skips quoted text, so a commit message that mentionsgit push --forcestill runs, but it blocks an unquoted mention such asecho git reset --hard. It is not a sandbox. Deliberate constructions get past it, such as brace or glob expansion in the command name, git-core helper paths, plumbing commands, inline-cconfig, and pathspec magic. A git alias, a script file, a heredoc piped into a shell, a flag built at run time, and a command string passed tosshor another language also get past it. To protect a branch, turn on your forge’s branch protection. On GitHub, add a ruleset that blocks force pushes and deletion. SetKEEL_BLOCK_AI_TRAILERS=1to also block commits whose message carries an AI attribution trailer.hooks/lead-reminder.shre-injects one line on every prompt, as pstack’s sticky reminder does in Cursor: a new task that needs rigor loadskeel:lead. SetKEEL_REMINDER=offto silence it.hooks/correct-reminder.pywatches each prompt for a correction, in Vietnamese or English (“sai rồi”, “lại lỗi”, “that’s wrong”, “I told you”). On a match it tells the lead to fix the mistake and record it through/keel:correctin the same turn. A repo rule goes into that repo’sCLAUDE.mdrule table, raised to a lint or test on a repeat. A lesson about working with you goes into afeedbackmemory. The patterns live in one table at the top of the file. SetKEEL_CORRECT=offto silence it.hooks/think.pyruns on every turn, not only after a mistake. On each prompt it injects a dig protocol: restate the real need, gather evidence from the source, weigh two approaches, trace to the root cause, check edge cases, plan the verification. At the first stop of each turn it blocks once with a review checklist, so a follow-up pass checks the answer you just saw. A failed check gets the corrected answer in full. A passing one adds one line that restates the key result and what was verified, soclaude -pand other readers of only the last message still get the answer. The review never starts new work, crosses a gate you set, or polls running subagents. Claude Code marks the continuation withstop_hook_active, so the turn ends on the second stop. It covers the main session only, not subagents. Every turn costs one extra review pass. SetKEEL_THINK=offto silence both.
get started
For Claude Code:
- Run
/keel:setupto choose models. It writeskeel-models.mdin the active Claude config directory,${CLAUDE_CONFIG_DIR:-$HOME/.claude}, so each profile keeps its own. - Give the main session real engineering work, or start with
/keel:lead. Once entered, lead mode stays on across turns.
Subagents live only as long as their session. Before you close the terminal on running work, type /bg to move the session to the background. Start unattended work with claude --bg. keel runs subagents inside subagents, so don’t cap CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS below its default of 20.
New here? The keel guide, adapted from pstack’s guide, walks through a first real task. Stuck, or unsure which skill fits? Ask /keel:help.
models
Claude Code subagents take a model alias, not a vendor slug. keel’s defaults:
| role | pstack default (Cursor) | keel default |
|---|---|---|
| code delegates: feature, refactoring, bug fix, perf, hillclimb | grok-4.7-xhigh-fast |
inherit (the lead’s model) |
| judgment, prose, hardest tasks | claude-opus-5-5-max |
inherit |
| explorers, investigators, swarm workers, reflect tooling | grok-4.7-xhigh-fast, gpt-5.6-sol-max |
sonnet |
| synthesizers, explainers, reflect’s judgment and divergent reviewers | claude-opus-5-5-max |
opus |
| arena runners, architect runners, arena cross-judge pool | opus / sol / grok | opus, fable, sonnet |
| interrogate reviewers | opus / sol / grok | opus, fable, sonnet, codex |
codex is not a subagent: interrogate runs codex exec --sandbox read-only from bash with the same brief as the other reviewers, and skips that lane when the Codex CLI is not installed.
usage
The examples below use Claude Code slash commands. In Codex, use $keel:lead or give the lead a nontrivial engineering task.
use /keel:lead at the start of a task. it reads your request, picks from a set of playbooks, and runs the other skills as the steps need them.
just use /keel:lead
this skill is the main shortcut. use it whenever you need the agent to do rigorous engineering work. it comes with twenty-three playbooks:
/keel:lead this pr has a subtle bug where the scroll drifts every 750ms even when idle. repro
first, then fix and verify.
/keel:lead i'm going to bed. land the stack even if ci flakes. i want everything merged by
morning.
when invoked it:
- matches your task to a playbook and opens a todo list whose first items are its steps, copied in verbatim.
- routes to the other skills as the steps fire.
- writes unslopped replies framed for the consumer and the maintainer.
the full rules and playbooks live in skills/lead/SKILL.md.
/keel:lead is also a sticky mode: once entered it stays on across turns, applying itself when a playbook matches or the task needs rigor and staying out of the way otherwise. opt out any time by saying so.
/keel:lead works extremely well with claude code’s /loop command. you can make claude code work for many hours without sacrificing rigor.
skills
/keel:lead runs most of these for you when a step needs them (how, why, architect, arena, swarm, interrogate, unslop, no-comments, technical-writing, tdd, and the principles). the table below is for when you want one directly:
/keel:how do we cancel runs? do we have an n+1 when we look up every run to cancel?
/keel:interrogate review this pr.
examples
mostly you give the lead a task, or type /keel:lead at its start, and let it route to a playbook. the other skills fire as the steps need them. a few are worth reaching for directly.
ponytail and critic
The lead delegates code-writing to keel:ponytail. ponytail reads lead in full, including its principles index, before any work, so the lead and its builders share one set of rules. It runs on the lead’s model unless the lead passes another, keeps user-scope memory, may spawn its own subagents within Claude Code’s depth limit, and merges its own pull request only under autopilot, after a clean review with CI green on a freshly rebased head, or when its brief says to land it. It never bypasses a review or check the forge enforces. The lead passes isolation: "worktree" when two or more builders share a repository.
keel:critic is the read-only reviewer, one lens per spawn. Its default comments lens keeps poteto’s comment-hating persona from pstack. Use it through /keel:no-comments, which carries out the deletions critic recommends, or through /keel:interrogate, which spawns one critic per configured model plus the Codex lane.
principles
twenty-four short skills, one principle each. lead indexes them inline and reads that index at task start. the standalone files are there so other skills can reference a principle by name, and so the index can point at the full rule for each.
differences from pstack
keel changes how pstack runs, not what it teaches.
- Platform. Cursor’s tools become their Claude Code equivalents. The Task tool becomes the Agent tool, Cursor cloud agents become background subagents in worktrees, and pull request operations go through
gh(the Orchestrate playbook also uses Graphite,gt, for stacks). cursor-team-kit’s slop and control skills become Claude Code’s/simplify, Bash (tmux for interactive TUIs) and the browser skills, and Cursor’screate-skillbecomesanthropic-skills:skill-creator. - Names.
poteto-mode,poteto-agent, Comment Sicko,setup-pstackandpoteto-helpbecomelead,ponytail,critic,setupandhelp. - Models. Claude Code has no grok. Review panels use Opus, Fable and Sonnet, and
interrogateadds a Codex lane. - Shape. The lead is a skill loaded by the main session, because running a session as an agent replaces Claude Code’s own instructions. critic is read-only, ponytail keeps memory, and keel adds the git guard and the lead reminder.
- Added.
/keel:qmdis keel’s own opt-in skill and has no pstack counterpart. - Removed. The benny Slack automation pack, the
make-bot-uiskill, Cursor’s plugin manifest, and pstack’s logo and illustrations. They are Cursor-only or pstack’s own branding.
UPSTREAM.md has the full translation and rename tables and how to pull future pstack changes.
why are there no planning skills?
Claude Code already has a plan mode, and it works well with keel. pstack leaves out planning skills on purpose; its README says “personally, i don’t believe in planning. the best spec is code.” If you do want a plan, /keel:lead covers it, but it’s not a default.
make it yours
lead is adapted from poteto-mode and carries much of poteto’s style. You may not want exactly that.
type /keel:automate-me. it mines your recent transcripts, drafts a -mode skill from how you’ve actually worked, and routes through keel underneath. you keep keel as the base and end up with your own routing skill alongside lead.
models are configurable too. type /keel:setup. it checks for the codex cli and writes ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/keel-models.md, a small file mapping each role (code, judgment, the review panels) to a model. claude code has no always-applied rule outside CLAUDE.md, so every skill that spawns a subagent reads that file itself and falls back to sensible defaults when it is absent. you override only what you want.
pstack’s Cursor model rule file does not carry over. Run /keel:setup once in Claude Code. A rerun keeps any role whose model differs from the default.
credits and license
- pstack by Lauren Tan (poteto), from cursor/plugins at commit
12d587d(pstack 0.15.5), MIT. keel’s skills, playbooks, principles, references, scripts, guide and both agents are adapted from it, except/keel:qmd, which is keel’s own. Later commits through4e5b1cf(pstack 0.15.10) are ported asUPSTREAM.mdrecords. - Git guardrails by Matt Pocock, from mattpocock/skills, MIT.
hooks/git-guard.pyis adapted from it. - keel by alexnthnz, from alexnthnz/keel at commit
72ef257(keel 0.3.1), MIT. - This fork’s changes by tristanphvn, MIT.
LICENSE keeps Lauren Tan’s copyright notice alongside keel’s, and THIRD_PARTY_NOTICES.md reproduces each upstream license. keel is not affiliated with or endorsed by Lauren Tan, Matt Pocock, Cursor or Anthropic.
Recommended Tools
Try a different keyword or remove a filter.
Install
npx skillfish add tristanphvn/keel