Repository navigation
Conversation
The Git hooks' policy reader took a Hook value. The agent stop hook needs the same proofline.hook.<name>.* keys, parsing and errors with its own defaults, so the reader now takes the name and the defaults. The Git hooks behave exactly as before.
The agent stop hook sends the report in a JSON reply instead of printing it, so the report builder returns lines and the Git hooks print them.
The store's symlink, repository, lock and change checks were tied to one MCP client's file and edit. It now takes the file's path and the edit, so the Claude Code settings file can be written under the same guarantees. MCP registration is unchanged.
`proofline hook agent-stop` reads a Claude Code Stop hook's input, reviews the checkout's local changes, untracked files included, through the same preflight and patch-review request as the Git hooks, and answers with one JSON decision: hold the turn and hand the agent the findings at or above the threshold, or let it end with a note for the developer. A record in the Git directory stops the same changes being reviewed or handed back twice, and the hook never holds an agent that is already continuing; findings withheld for that reason go back at the next stop that may hold it. It is silent outside connected repositories, and its policy uses the Git hooks' `proofline.hook.agent-stop.*` keys with environment overrides for the wait, the gap and the findings cap.
`agent install claude-code --review-hook` adds one Stop group to ~/.claude/settings.json that runs this executable's `hook agent-stop`, in exec form so a path with spaces needs no quoting, with a timeout above the hook's own cap. `--max-findings` lands in its arguments, and a second review hook with other settings is refused. `agent uninstall claude-code --review-hook` removes only that exact entry, drops `Stop` and `hooks` only when it empties them, and leaves an edited entry in place. Both use the installer's existing preview, confirmation, lock and repository checks, and a refusal names the settings file and what is wrong with it.
`hook agent-stop` keeps its decisions in agent_stop.rs and moves Claude Code's input and reply format to agent_stop/claude.rs, the checkout's record to agent_stop/record.rs, and the policy to agent_stop/policy.rs, so another agent needs only a module like claude.rs. The settings.json edit moves from agent/config.rs to agent/config/settings.rs, leaving config.rs with the MCP entries. Code moves only; behaviour is unchanged.
`hook agent-stop --agent codex|gemini|cursor` reads that agent's stop input and answers in its own form: Codex shares Claude Code's contract, Gemini CLI keeps the agent working with `decision: "deny"`, and Cursor with `followup_message`, taking the checkout from `workspace_roots` and treating `loop_count` above 0 as continuing. The decisions stay agent-neutral; each agent module only translates. `agent install|uninstall <agent> --review-hook` writes or removes the entry in ~/.codex/hooks.json, ~/.gemini/settings.json or ~/.cursor/hooks.json, as one quoted shell command with a timeout above the hook's cap. Codex's success message names its `/hooks` trust step. Kiro, whose stop hook cannot continue the agent, is refused, as are GEMINI_CLI_HOME and, for the shell-string agents, Windows.
- A hook is the review hook only when its command runs the `hook agent-stop` words, so an unrelated hook whose command mentions agent-stop no longer blocks install. - The duplicate-hook refusal names the agent to uninstall instead of a placeholder, and encoding errors name the agent being edited. - Uninstall works on Windows for every agent: it only compares JSON, so it can remove an entry added by hand from --print.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Who this helps
Teams using coding agents (Claude Code, Codex CLI, Gemini CLI, Cursor) in repositories connected to
Proofline. Findings now arrive at commit or PR time, after the agent has finished. This hook
reviews the checkout when the agent tries to stop and hands the serious findings back while it
still has the context to fix them.
How it works
sequenceDiagram participant A as Coding agent participant H as proofline hook agent-stop participant G as Git checkout participant P as Proofline API A->>H: stop input (working directory, already continuing?) H->>G: policy (git config), record (.git/proofline/agent-stop.json) H->>G: local changes incl. untracked, fingerprint alt no changes, same changes, or repository not connected H-->>A: {} (silent) else new changes H->>H: secret preflight H->>P: resolve repository, request patch review H->>P: poll the review (up to the timeout) alt findings at or above the threshold, block mode, not already continuing H-->>A: keep working: findings + review link A->>A: fixes or rebuts, tries to stop again else otherwise H-->>A: a note for the developer end endDecisions
request_patch_review, repositoryresolution. Policy reuses the Git hooks'
proofline.hook.<name>.*keys.reviewed or handed back twice, and the hook never holds an agent that is already continuing.
failures never hold the agent unless
onIncomplete=block.CLI.
hook agent-stop --agent <agent>decides inagent-neutral types;
agent_stop/{claude,codex,gemini,cursor}.rsonly translate input and reply.Codex shares Claude Code's contract, Gemini CLI says
deny, Cursor sends afollowup_message.Cursor take one shell string, so install quotes every part. Timeouts sit above the hook's 1800 s
cap in each agent's units.
Left out
install refuses it with that reason.
for every agent, so install refuses and
--printshows the entry to add by hand.findings handed to the agent still arrive.
Verification
report modes, the once-only guard, still-running reviews, unknown repositories, missing sign-in,
preflight refusal, invalid settings, and each agent's input and reply form.
executable path with a space and a quote, which they run through
shas the agent would.cargo test --locked: 208 passed. fmt and clippy clean; dependencies unchanged./hooks; the install message says so.Questions
proofline reviewskips untracked files unless--include-untrackedis passed. Should it includethem by default, as this hook does?
loop_countas counting follow-ups "for this conversation". If it never resets,the hook holds a Cursor conversation at most once in total. Is that acceptable?