Skip to content

When Claude Code runs /verify before a commit, it now gets a quick check instead of the full fix loop (GST-3150) - #4508

Merged
capy-ai[bot] merged 3 commits into
mainfrom
verify-quick-check-before-commit
Nov 19, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
verify-quick-check-before-commit

Conversation

@garrytan

@garrytan garrytan commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

When Claude Code calls /verify on its own right before git commit, gstack now runs one quick check-only command that ends in a single VERIFY PASS, VERIFY FAIL or VERIFY skipped: <reason> line; typing /verify still runs the full skill.
Why: since Claude Code 2.1.286 any skill named verify is run before every commit, so gstack's fix loop, its first-run notices and a hard stop in repos with no remote landed on ordinary commits.
Nothing to do; gstack-config set verify_before_commit off turns the check off.

What changed

/verify now opens with a quick check-only section for the call Claude Code makes before each commit

/verify now opens with a quick check-only section for the call Claude Code makes before each commit.

Measured on the real claude binary

Claude Code 2.1.328, Opus 5.5, Anthropic key, prompt "add() in calc.py returns the wrong answer. Fix it and commit the fix.", toy repo with no remote and no pytest, fresh HOME per run, 3 runs per arm. Every run made the one-line fix and committed.

Arm Turns Seconds Cost per commit
No gstack 4, 4, 4 8.5, 9.6, 9.3 $0.055, $0.057, $0.057
gstack main (5afef04) 8, 8, 9 22.7, 22.9, 23.2 $0.201, $0.142, $0.149
This branch 8, 8, 8 17.2, 17.7, 16.7 $0.130, $0.134, $0.132

On this branch every run called /verify, ran gstack-checks quick once, got VERIFY skipped: no origin/main to compare against … (POLICY_SOURCE_UNAVAILABLE) and committed, with no gstack notices in any answer (main showed them in 2 of 3 final answers). A typed /verify on this branch still ran the full skill (preamble, notices, detect). Against main the per-commit cost fell by about 20% and the time by about 25%; it is still about 2.4x the no-gstack run, mostly from loading verify's 12 KB SKILL.md and gstack's skill list on every turn. $0 stub-API capture: Claude Code's "Always run /verify right before the commit command" line is present with gstack on main and on this branch, and absent with no gstack (the skill keeps its name, as asked).

Before/after as text: /verify now opens with a quick check-only section for the call Claude Code makes before each commit
--- Before · verify/SKILL.md.tmpl § Right before a commit: the quick pass at 5afef04 · source text (section not present before)
+++ After · verify/SKILL.md.tmpl § Right before a commit: the quick pass on this branch · source text
+## Right before a commit: the quick pass
+Use only this section when you started /verify yourself because you are about
+to run `git commit` (Claude Code asks for /verify before every commit), and the
+user has not typed /verify or asked you to verify or run the checks in this
+conversation. The arguments `quick` or `pre-commit` mean the same. When the
+user typed /verify, skip this section and run the full skill below.
+
+Skip the preamble and everything after this section: edit nothing, add no
+tests, ask nothing. Run one command with a Bash timeout of 10 minutes:
+
+```bash
+"{{RUNTIME_ROOT}}/bin/gstack-checks" quick
+```
+
+It ends with one line. `VERIFY PASS: …` or `VERIFY skipped: <reason>`: go on
+with the commit, and mention /verify only by quoting that line. `VERIFY FAIL:
+…` (exit 1): don't commit over it; quote the line and the failing output to
+the user and ask whether to fix it first or commit anyway.
+
+{{PREAMBLE}}

People committing with Claude Code saw gstack's whole build-and-fix loop start on every ordinary commit, notices and all, and in a repo with no remote it stopped hard. Now that pre-commit call runs one command, gstack-checks quick: the repo's existing checks and the tests /ship would pick, with no edits, no new tests and no questions. A repo with untrusted check commands, no origin base, or nothing declared gets VERIFY skipped: <reason> and the commit goes ahead; a real failure prints the failing output and VERIFY FAIL, and the skill tells the model to ask before committing over it. Typed /verify is unchanged. The new verify_before_commit setting turns the pass off; gstack-config now rejects a mistyped value for it and shows it in list and defaults.

Why

"Claude Code runs any skill named verify before every commit" (GST-3150) meant gstack's heaviest loop ran on commits nobody asked to check. The pre-commit call now costs one command and one line, and the full skill is still there when you type /verify.

Blast radius

The new code runs only on the quick verb of bin/gstack-checks and the verify_before_commit key; run, detect, trust and status take the same path as before (bin/gstack-checks:83-86 read: quick returns before loadOrRefuse). The skill name, lib/skill-route.ts and CLAUDE.md routing are untouched, and an untrusted repo runs no command before the trust check (walked: load() only runs git; probe 007 below).

Test Coverage
CODE PATHS                                                   USER FLOWS
[+] bin/gstack-checks quick()                                [+] Agent about to commit → /verify quick
  ├── [★★★ TESTED] config off → skipped                        ├── [★★★ TESTED] green → PASS, commit proceeds
  ├── [GAP]        not in a git repo → skipped (exit 0)        ├── [★★★ TESTED] red → FAIL exit 1, tail lines
  ├── [★★★ TESTED] no origin → POLICY_SOURCE skip              ├── [★★★ TESTED] untrusted → skip, nothing executes
  ├── [GAP]        nothingToRun → skipped                      └── [GAP] [→EVAL] agent picks quick section vs full skill
  ├── [★★★ TESTED] untrusted → skipped, marker absent
  ├── [GAP]        SIGINT/SIGTERM → cancelActive, 130/143 (low value)
  └── main(): 'quick' verb accepted, root-null bypass
[+] lib/checks.ts quickLine()
  ├── [★★★ TESTED] FAIL line + detail
  ├── [GAP→TESTED in fix] ZERO_RUN / INCOMPLETE counted as red
  ├── [GAP→TESTED in fix] all not-run → "nothing ran to a result"
  └── [★★★ TESTED] PASS with "(not run: …)" suffix
[+] bin/gstack-config verify_before_commit default on / set off — [★★ TESTED], validator and list/defaults tested in fix
[+] verify/SKILL.md(.tmpl) quick-pass section — [GAP] [→EVAL] (measured below)

Tests: 1820 → 1822 (+2 new, written in the review fix: a quickLine table and a verify_before_commit validator test)
Coverage: 63% value-weighted (63% including 0 weakly covered paths) at the audit, before the review fix covered two of the six gaps.
Test value: 0 tests written by the coverage audit (audit-only), 0 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered.
Coverage gate: 63% — between the 60% minimum and 80% target; the two quickLine gaps are covered by the review fix, the not-in-git skip is covered by exploratory probe 004, the skill routing is an eval gap measured below, and SIGINT handling was rejected as no credible regression.
Tests ran: test deferred to CI at the pushed head (free-tests run 44466858398)

Pre-Landing Review

Pre-Landing Review: 8 issues — 1 auto-fixed, 2 asked (1 fixed, 1 skipped), 0 deferred, 5 noted. Nothing reached the blocking floor. The review fix added a quickLine unit table and made gstack-config list, default and validate verify_before_commit; a second read of just those changes found nothing. One review finding was skipped and five second-pass findings are noted below without details, because their category keeps them out of a public body. Second-model review (GPT-6.1 Sol): clean.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL sf-9c6c2b9e028e security finding, details recorded privately
  • INFORMATIONAL sf-caa4b3545342 security finding, details recorded privately
  • INFORMATIONAL sf-1ce3f1e74419 security finding, details recorded privately
  • INFORMATIONAL sf-9a06394e7804 security finding, details recorded privately
  • INFORMATIONAL sf-47b8fbb33c99 security finding, details recorded privately
Exploratory QA

Functional CLI smoke on owned fixtures, 8 probes, all passing: a trusted repo with a mapped test gives VERIFY PASS: tests (exit 0); a real red gives the failing test's tail and VERIFY FAIL: tests … (exit 1), replayed once with the same result; outside git, VERIFY skipped: not inside a git repository (exit 0); a repo with no origin, VERIFY skipped: … (POLICY_SOURCE_UNAVAILABLE) (exit 0); --timeout 0, usage error (exit 64); untrusted commands, VERIFY skipped: … not trusted yet (exit 0); verify_before_commit off, VERIFY skipped: verify_before_commit is off (exit 0). Not probed: signal handling. A first probe set under Capy's install-verdict pin read a second checkout's tests as ENV and was rerun without the pin, as a Claude Code user's shell runs it.

Eval Results

The eval selector maps lib/checks.ts and bin/gstack-checks to 250 dependent gate cases and 110 behavior probes, none of them quick live coverage. They were not run in this PR; the focused paid measurement above (10 Claude Code runs) is the eval evidence for the changed prompt.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN (lib/skill-route.ts, CLAUDE.md routing and the skill name untouched)

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. No documentation edits were needed.

Scope: the diff from 5afef04 to e7e5e32 (bin/gstack-checks, bin/gstack-config, lib/checks.ts, verify/SKILL.md.tmpl, docs/skills.md, changelog.d). The working tree is clean. I checked every doc that lists gstack-config keys or gstack-checks verbs.

Documentation health:

  • docs/skills.md: Current. It already describes gstack-checks quick and verify_before_commit.
  • changelog.d/verify-quick-check-before-commit.md: Current.
  • docs/state-root.md: Current. It lists only the merged privacy keys, and verify_before_commit is not one.
  • docs/proactive.md: Current. It covers only the proactive key.
  • README.md: Current. Its /verify row is a summary.
  • CONTRIBUTING.md: Current. It has no config-key or checks-verb list.
  • AGENTS.md: Current.

Coverage debt: gstack-checks quick and verify_before_commit have a reference and how-to in docs/skills.md, but no tutorial or explanation page. That's a common gap, not a critical one.

Diagram drift: none.

Tests
  • bun run typecheck: no errors
  • bun test test/gstack-checks.test.ts test/gstack-config-defaults.test.ts: 28 pass, 0 fail
  • bun test test/spawnsync-timeout-tripwire.test.ts test/module-size-ratchet.test.ts: 9 pass, 0 fail
  • Earlier focused set at 8602662 (gstack-checks, config defaults, parity-suite, skill size and budget guards, context and catalog budgets, module-size ratchet, gen-skill-docs, spawnSync tripwire, bun entry isolation, skill validation): 973 pass, 0 fail
  • Full free suite: CI at the pushed head
Agent notes

Refs GST-3150. Lane GSTA-633, /ship run ship-4508. Paid measurement: 10 Claude Code runs, about $1.3 list.

Issue links: Refs p1/specialist-batched#1, Refs p1/specialist-batched#2 (review-finding trailers on e7e5e32; no tracker issues)

Approvals

Approved: yes (record r-79edd3ed730c). The full approval record stays private.
Plan: exempt: bug fix
Plan check: exempt bug fix

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=5 fixed=2 scope=frozen ledgers_read=4 fix_checks=1 dispatches=1
Gate edits: none detected (4 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

{
  "schema_version": 1,
  "pr": 4508,
  "head": "e7e5e324844496ad108cccef9caff2179d5edeb7",
  "version": "1.101.0.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1702,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44466858398,
      "attempt": 1,
      "tree": "00c216b07e02033d56a23cff84a5795c4f32a9c4"
    }
  ],
  "calls": 20,
  "session_kind": "unattended",
  "run": "ship-4508",
  "head_tree": "00c216b07e02033d56a23cff84a5795c4f32a9c4",
  "product_patch_id": "e1a09dc252b22ce57460f5d98c4ae722ce550c19",
  "gstack_version": "1.101.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 87,
    "rules": "1afa38a4be3b5eef",
    "base": "5afef04e31de1cb30c727c7f827bdd729d04713e",
    "registry": "5afef04e31de1cb30c727c7f827bdd729d04713e",
    "gate_scan": {
      "tagged": 0,
      "head": "e7e5e324844496ad108cccef9caff2179d5edeb7"
    },
    "reasons": [
      "runtime=87"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @00c216b07e02 (8 checks, current for e7e5e3248444)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/44466858398/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44466858398/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44466858452/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=00c216b07e02 tests=37893 skipped=104 runs=44466858398/1 profiles=ci-reuse/free-tests heads=e7e5e3248444 verified=2026-11-19T05:55:57.018Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md against the PR diff (gstack-checks quick, verify_before_commit)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 5,
    "fixed": 2,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 2,
    "ledgers_read": 4,
    "dispatches": {
      "specialist": 1
    }
  },
  "gate_dispositions": []
}

Open in Capy

garrytan and others added 2 commits November 19, 2026 05:12
…a commit (GST-3150)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

…dict line (GST-3150)

Review-Finding: p1/specialist-batched#1 reader=specialist-batched
Review-Finding: p1/specialist-batched#2 reader=specialist-batched
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit b702243 into main Nov 19, 2026
57 checks passed
@garrytan garrytan mentioned this pull request Nov 19, 2026
capy-ai Bot added a commit that referenced this pull request Nov 19, 2026
- `gstack-artifact validate` no longer passes a run.json that gstack-autoplan never wrote. (#4494)
- /ship's changed-number check no longer stops on tests that only share a word with the change (#4478). (#4496)
- On Capy, /ship no longer edits or comments on pull requests as you. (#4518)
- The destructive-command check stops asking about scratch deletes and catches the real damage it used to miss. (#4513)
- The destructive-command check reads commands more carefully, closing gaps found after the last release. (#4525)
- The Codex readiness check and the second-model review now pick the same model for a custom Codex provider (GST-3089). (#4491)
- gstack's Codex hooks work when your Codex folder's path has a `(`, `&` or other shell character in it. (#4528)
- Uninstalling gstack keeps your own Codex hooks trusted. (#4528)
- Codex hook setup matches Codex more closely. (#4528)
- On Windows, setup copies the Claude Code hook code that gstack's Codex hooks import (#4528)
- /review's checklist on Codex reads shell commands more carefully. (#4528)
- On Codex, gstack now suggests the right skill for a prompt and stops destructive commands before they run. (#4512)
- On Codex, /review is now held once when it tries to finish without its adversarial pass or its report, as it already is on Claude Code. (#4522)
- On Codex, gstack's skill suggestion now names the skill the way Codex lists it. (#4523)
- On Codex, gstack's suggested prompts and docs now name skills the way Codex lists them. (#4524)
- /review on Codex with gpt-6.1-sol is no longer held back for a second-model pass it already ran. (#4526)
- On Codex, office-hours, plan-design-review and gstack-upgrade work again when you name them. (#4510)
- gstack knows when Codex is running unattended. (#4510)
- Codex reviewers start with a clean context. (#4510)
- Docs no longer say Codex has no hook support. (#4510)
- A command whose output was cut off no longer counts as a finished read. (#4492)
- A folder marked as published data can no longer hide source code or agent files from /ship's review. (#4516)
- Correction to the on-by-default helper hooks entry: the hook still routes only to /review, /qa and /verify, so skills you've installed yourself aren't suggested yet. With gstack's skills it routes 14 of 60 real bug reports (was 17), and long prompts are no longer skipped. (#4505)
- /sync-gbrain's read check now works when the first page in your code source is over 64 KB. (#4497)
- Free-suite CI no longer fails before any test runs when Ubuntu's package mirror is slow. (#4530)
- Syncing a second repo no longer makes the first one ask for /sync-gbrain again. (#4532)
- gstack's helper hooks are now on by default in Claude Code, OpenClaw and Hermes, and the prompt-routing hook fires on real bug reports. (#4503)
- `gstack-pregate clear --receipt` accepts a remote gate run from before a merged release when the release only regenerated a declared release output. (#4483)
- The second-model review now keeps the reviewer's own result, and reports a used-up budget as a budget stop. (#4515)
- When the reviewer wrote its review to the result file it was asked for, Codex then replaced that file with its short closing message ("Done, I wrote the review"), so the review was thrown away and reported as missing its markers. (#4515)
- When the provider refuses the call with HTTP 402 Payment Required (usually a metering proxy that hit its allowance, or an account out of credits or quota), gstack used to record only "exit 1". (#4515)
- The pre-commit /verify check now fails a check that times out, and its checks share one time budget (GST-3201). (#4527)
- /ship's review collector no longer reads a reviewer's own scope list or list of passed checks as findings (GST-3201). (#4527)
- Merge-queue stack tests fail when git cannot list a PR's added test files (GST-3201). (#4527)
- /ship can now review results PRs that publish raw session data. (#4511)
- /ship's review pass works when the checkout you ship isn't the project's default checkout. (#4507)
- A second review round no longer reports done when nothing was reviewed. (#4520)
- The prompt-routing hook now suggests skills you install yourself, and no longer sends ordinary bug reports to /qa (GST-3123). (#4506)
- gstack's script runner and merge-queue checks now also refuse cut-off output. (#4502)
- A failed second-model review reports the cause that actually stopped it, and the runner never deletes its own prompt. (#4519)
- `gstack-ship-queue ready` now fills in the trial merges and the second-model trail read instead of printing lines to fill. (#4529)
- Five small ship-tool fixes. (#4529)
- A ruling the owner gives while a `/ship` run is open can be relayed. (#4529)
- /ship no longer kills a working test run as stalled when the test command starts its workers in their own session. (#4533)
- /ship no longer stops a review because the state-machine reader started its reply the way its instructions say. (#4504)
- When Claude Code runs /verify right before a commit, it now gets a quick check instead of the full fix loop (GST-3150). (#4508)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant