Plan · Investigate · Narrow · Code · Evaluate · Release
A compact workflow for Claude Code: six letters, five commands (plus a status check), taking one idea from brief to reviewed, verified code — with the evidence saved beside it.
These sheets explain what it does, why every step leaves an artifact, and how to install it in any repo. No prior agentic-tooling experience required.
An AI agent given one big prompt will produce code — but no record of what was decided, no line between in-scope and out, and "done" means "it stopped typing".
This workflow makes the agent work the way a disciplined team does: requirements first, small verified steps, review at the end. Each command produces a file you can read — the thinking is auditable, not vibes.
The whole thing is markdown and git: rules live once in AGENTS.md (the cross-platform standard), plus five command playbooks and a status check, two specialist subagents, two templates, two shell scripts that own ticket state, a permission guardrail, and two hooks — one blocks destructive commands, one keeps ticket state honest. Adapters make it run on Claude Code, Codex CLI, and GitHub Copilot. No servers, no external tracker.
| One big prompt | This workflow |
|---|---|
| Scope lives in the model's head | Scope table in the PRD — in and out |
| One giant diff at the end | One commit per ticket, story in git log |
| "Done" is unverified | Every ticket carries a runnable check |
| Cuts happen silently | Cuts recorded in Out of Scope, with reasons |
| Review is optional | Review + audit are commands in the chain |
The PRD is a reviewable contract: problem, solution, scope (in and out), architecture, success criteria. Its depth follows the change's uncertainty and risk.
Discovery is deliberately short: the agent extracts everything it can from your brief first, then asks at most 3–4 questions — only ones whose answers would change the architecture or the scope.
If the repo already has code, read-only explorer subagents scan it in parallel so the architecture is grounded in what actually exists.
| Phase | What happens | Gate |
|---|---|---|
| 1 · Discovery | Batch of targeted questions; design direction if there's a UI | ask only on material ambiguity |
| 2 · Codebase scan | Explorer agents map structure and patterns (skipped if repo is empty) | — |
| 3 · Architecture | Components, data flow, verified dependency versions | reuse existing authorization |
| 4 · Write PRD | Saved to the next unused .prd/prd-vN.md, committed | concrete draft before approval |
The heavy gate sits exactly where a wrong decision is most expensive to undo. After it, the plan is locked and execution speeds up.
The PRD becomes coherent local ticket files — no external tracker. Count and size follow dependencies and risk; every ticket carries a runnable verification command: the proof it's done.
Shape follows the repository. Greenfield work can start with a walking skeleton; brownfield work starts with the smallest protected vertical change and adds characterization coverage where load-bearing behavior is untested.
If the brief implies automated tests, at least one ticket's verification command must be the test runner itself — a manual check alone doesn't count as proof.
tickets/T-03-complete-task.md
---
ticket: T-03
status: open
size: S # S · M · L are relative scope indicators
prd: .prd/prd-v2.md
depends_on: [T-01]
---
## Objective
Mark a task complete from the CLI and persist it.
## Acceptance Criteria
- [ ] `todo done 2` sets task 2 to completed
- [ ] completed tasks render with a check mark
## Verification
npm test -- --run complete
Per ticket: start → implement → verify → self-review → done → commit. A ticket's state is written only by scripts/pincer-ticket.sh: verify runs the ticket's check and stamps a receipt only on a green exit; done refuses without a receipt matching the current check. Green output is the definition of done, not the agent's confidence — and on Claude Code a hook makes it the only way through.
The loop reports wall-clock elapsed time, and measures it against a budget only when the PRD sets one. Running out of budget triggers a proposed scope cut, recorded in the PRD's Out of Scope — a deliberate cut beats an unfinished mess, and it's never silent.
State lives in the ticket files, not the conversation: /pincer-status reads them back — what's done, what's in progress, what's blocked, elapsed time from the clock — and names the next command. A fresh session resumes where the last one stopped.
$ git log --oneline
a41f2c9 review: fixes
7c03e1d T-05: filter and list views
5b91af0 T-04: delete with confirmation
e8d22b7 T-03: complete a task
c17f440 T-02: add and persist tasks
90ab3ce T-01: walking skeleton — CLI runs end to end
308dad9 PRD v1 + workflow setup
/pincer-evaluate dispatches a quality-reviewer subagent over the whole session's diff while the main agent checks spec compliance against every acceptance criterion. Findings below 70 confidence are dropped — you see real bugs, silent failures, and security issues, not style opinions.
If the project has a UI, review means looking at it: the app is started and checked in the browser against the PRD's visual direction — never code-read alone.
It closes by writing NOTES.md: what was built, what was cut and why, known issues, next steps — the first file a reviewer of the repo should read.
/pincer-release is the workflow auditing itself. It reads docs/dry-run-checklist.md as its source of truth and checks the repo mechanically: files exist, statuses correct, commit format right, ticket checks re-run.
Output is a pass/fail table with evidence per item. A failed item names the command file to fix — so the workflow, like the code, is testable.
One source of truth: update the checklist and the audit updates with it.
Gates scale with decision cost. A light confirmation after discovery, one heavy gate before the architecture locks, then autonomy during build. Human attention is spent where mistakes are expensive, not sprinkled everywhere.
Secrets never enter the conversation. Permission rules make .env files unreadable to the agent; code references secrets by name via .env.example; debugging logs only whether a key is set — never its value.
Keys stay server-side. LLM and API calls run in the backend only — the key never reaches frontend code or the browser. The review pass explicitly hunts for hardcoded secrets, client-exposed keys, unescaped untrusted output, and unvalidated input flowing into shells, queries, or prompts.
Untrusted content is data, never instructions. Whatever a README, changelog, or model output says to the agent — it gets reported as a security finding, not followed. Instructions come only from the human and the workflow files.
.claude/settings.json — enforced by the harness, not by good intentions
{
"permissions": {
"deny": [ .env files are unreadable to the agent
"Read(./.env)", "Read(./.env.*)",
"Read(./**/.env)", "Read(./**/.env.*)"
]
},
"hooks": {
"PreToolUse": [ every Bash call passes this gate first
{ "matcher": "Bash", "hooks": [ { "type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-dangerous.sh" } ] }
]
}
}
The hook structurally parses its payload and blocks documented forms of absolute-path deletes, force-pushes, curl | sh, and mass permission changes. It is a guard against mistakes alongside the host sandbox and approval controls. The standing rules in CLAUDE.md still require green checks and recorded scope cuts.
Two critiques every agentic workflow must survive: the realist's — AI turbocharges greenfield but stumbles on load-bearing code, and floods the world with abandonware — and the attacker's — untrusted inputs and unsupervised automation are a new attack surface.
PINCER's answer to both is the same move: don't rely on the model's judgment in the moment — write the rule into the workflow, and where possible have the harness enforce it mechanically.
| The critique | The drawing that answers it |
|---|---|
| "AI stumbles on load-bearing code" | Brownfield scaling: Investigate grows, coverage is measured not assumed, blast radius + rollback named in the PRD; untested load-bearing paths get a characterization test before any change |
| "AI-generated abandonware" | NOTES.md ends with a handover written for the stranger who inherits the repo: orientation, why each dependency earned its place, what breaks first |
| "Models hallucinate the outside world" | Dependency versions and external API contracts verified live (npm view, one real request) — never from training data |
| "Untrusted inputs get weaponized" | Prompt injection defused by rule: file, web, and model content is data — embedded "instructions" become security findings, in both subagents too |
| "Hallucinated packages get typosquatted" | New dependencies are a human gate: verified on the registry before install, versions pinned, lockfile committed |
| "Why auto-approve anything?" | Destructive commands blocked by a PreToolUse hook (sheet 108); a human owns every architecture, scope, and merge — autonomy runs only between gates, bounded by an explicit budget and one revision loop |
Delivery isn't the end of the drawing set. The chain loops back — and the entry point depends on the size of the change, so small fixes stay cheap and big changes stay honest.
The rule that keeps the history clean: after /pincer-evaluate, every change goes through a ticket, never an ad-hoc patch. Done still means a green check and one commit.
| Change | Route | Artifact |
|---|---|---|
| Bug the reviewer finds | Fixed inside /pincer-evaluate; declined findings become known-issues | review: fixes · NOTES.md |
| Bug found later, or a small addition in scope | One new S/M ticket whose verification reproduces the bug, then /pincer-code T-{NN} | tickets/T-08-fix-*.md |
| New feature that changes scope or architecture | Back to /pincer-plan — a new PRD version; /pincer-narrow continues numbering; the chain runs again | .prd/prd-v2.md |
Old PRD versions are never overwritten — .prd/ keeps the history of what the product was supposed to be at every point.
| File | Role |
|---|---|
| .claude/commands/pincer-plan.md | PRD playbook — discovery, scan, architecture gate, write |
| .claude/commands/pincer-narrow.md | Decomposition playbook — S/M sizing, walking skeleton, verification per ticket |
| .claude/commands/pincer-code.md | Implementation loop — verify, commit, budget and scope-cut rules |
| .claude/commands/pincer-evaluate.md · pincer-release.md | Quality pass with security audit · pass/fail workflow audit |
| .claude/commands/pincer-status.md | Where are we — wraps the status script, names the next command, offers to resume |
| scripts/pincer-ticket.sh · pincer-status.sh | Ticket state machine (start · verify · done, receipts) · read-only state report with clock-based elapsed time |
| scripts/pincer-runtime.cjs · pincer-runtime/ | The runtime (Node.js 18+, no dependencies) behind the wrappers: change records with an explicit lifecycle, agreements and recorded authorization, per-worktree selection, the read-only resume report, readiness and status JSON, source-bound verification attempts with captured logs under the ignored .pincer/runtime/, explicit migration with backups, candidate checks and evidence export; docs/runtime-contracts.md is its contract |
| scripts/pincer-evidence.cjs | Read-only validator for candidate evidence — the manifest, logs and screenshots evaluate saves under .prd/evidence/; status and release read the verdict |
| .claude/agents/codebase-explorer.md | Read-only scout — reports facts with file:line references |
| .claude/agents/code-quality-reviewer.md | Diff reviewer — bugs, silent failures, security issues, spec drift; ≥70 confidence only |
| .claude/references/prd-template.md · ticket-template.md | The two artifact formats |
| .claude/settings.json | Secret-file deny rules + the PreToolUse guardrail wiring |
| .claude/hooks/block-dangerous.sh · ticket-guard.sh | Mechanical block on destructive and pipe-to-shell commands · ticket state fields writable only through the script |
| AGENTS.md · CLAUDE.md | Project rules, single cross-platform source · one-line Claude Code import of it |
| scripts/sync-prompts.sh | Generates the Codex skills (.agents/skills/) and Copilot (.github/prompts/) command adapters from the playbooks |
| docs/dry-run-checklist.md | The workflow's own test — audited by /pincer-release |
Plain markdown, one JSON file, and two shell scripts — read all of it in ten minutes, change any of it with a text editor. The generated adapters are never edited by hand.
# 1 · install the workflow into your project (all platforms)
cd your-project
npx pincer-workflow init # asks which platform(s) you use
# 2a · Claude Code — everything works as-is
claude
/pincer-plan a CLI todo app — add, list, complete, delete
# 2b · Codex CLI — rules load natively, commands are repo-local skills
codex
$pincer-plan a CLI todo app — add, list, complete, delete # (posture: .codex/README.md)
# 2c · VS Code Copilot — AGENTS.md is already wired;
# enable prompt files in settings, then /pincer-plan in chat
"chat.promptFiles": true
# 3 · then follow the chain, identical everywhere
/pincer-narrow → /pincer-code → /pincer-evaluate → /pincer-release
# (Codex skills are mentioned, not slashed: $pincer-narrow → … → $pincer-release)
# later · refresh the kit (edited files get a .new sidecar, never clobbered)
npx pincer-workflow@latest update
npx pincer-workflow doctor
One source, three platforms. Rules live once in AGENTS.md — Codex and the Copilot coding agent read it natively, Claude Code imports it via CLAUDE.md, VS Code Copilot is pointed at it by .github/copilot-instructions.md. The playbooks in .claude/commands/ are canonical; scripts/sync-prompts.sh regenerates the Codex and Copilot command adapters after any edit.
Fill in the Conventions section of AGENTS.md once you know the stack; everything else works as-is.
Claude Code plugin (alternative): /plugin marketplace add orchestratedbyalex/pincer-workflow then /plugin install pincer@pincer-workflow — commands arrive as /pincer:plan … /pincer:release. Pick one channel per project.
The process ports fully, while Pincer's hook adapter currently targets Claude Code and requires Node.js 18+. Other platforms use their native sandbox and approval settings, and /pincer-release audits the git artifacts on every platform.
Source on GitHub · pincer-workflow on npm · MIT
Approvedfor construction