TK

tristanphvn/keel

Developer tools
0 stars Quality 57 Trend 20MIT

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 each watch-pr run.
  • 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 as git checkout . and git checkout -f. The protected branches are main, master, trunk, develop and release*. The one exception is --force-with-lease onto a branch that the command names and that is not protected, so an owner can publish its own rebased branch with git push --force-with-lease origin . The guard catches the common forms an agent types by accident, including commands wrapped in bash -c, eval, $(...), subshells, heredocs fed to a shell, launchers such as sudo or xargs, and abbreviated options. It skips quoted text, so a commit message that mentions git push --force still runs, but it blocks an unquoted mention such as echo 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 -c config, 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 to ssh or 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. Set KEEL_BLOCK_AI_TRAILERS=1 to also block commits whose message carries an AI attribution trailer.
  • hooks/lead-reminder.sh re-injects one line on every prompt, as pstack’s sticky reminder does in Cursor: a new task that needs rigor loads keel:lead. Set KEEL_REMINDER=off to silence it.
  • hooks/correct-reminder.py watches 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:correct in the same turn. A repo rule goes into that repo’s CLAUDE.md rule table, raised to a lint or test on a repeat. A lesson about working with you goes into a feedback memory. The patterns live in one table at the top of the file. Set KEEL_CORRECT=off to silence it.
  • hooks/think.py runs 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, so claude -p and 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 with stop_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. Set KEEL_THINK=off to silence both.

get started

For Claude Code:

  1. Run /keel:setup to choose models. It writes keel-models.md in the active Claude config directory, ${CLAUDE_CONFIG_DIR:-$HOME/.claude}, so each profile keeps its own.
  2. 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:

  1. matches your task to a playbook and opens a todo list whose first items are its steps, copied in verbatim.
  2. routes to the other skills as the steps fire.
  3. 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’s create-skill becomes anthropic-skills:skill-creator.
  • Names. poteto-mode, poteto-agent, Comment Sicko, setup-pstack and poteto-help become lead, ponytail, critic, setup and help.
  • Models. Claude Code has no grok. Review panels use Opus, Fable and Sonnet, and interrogate adds 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:qmd is keel’s own opt-in skill and has no pstack counterpart.
  • Removed. The benny Slack automation pack, the make-bot-ui skill, 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 through 4e5b1cf (pstack 0.15.10) are ported as UPSTREAM.md records.
  • Git guardrails by Matt Pocock, from mattpocock/skills, MIT. hooks/git-guard.py is 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.

View this README on GitHub

Recommended Tools

Try a different keyword or remove a filter.

Install

npx skillfish add tristanphvn/keel