Skip to content

fix: change agent hook default from PostToolBatch/postToolUse to Stop/stop - #1648

Open
skoshx wants to merge 2 commits into
mainfrom
cursor/triage-1647-fb45
Open

fix: change agent hook default from PostToolBatch/postToolUse to Stop/stop#1648
skoshx wants to merge 2 commits into
mainfrom
cursor/triage-1647-fb45

Conversation

@skoshx

@skoshx skoshx commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes the default agent hook timing from PostToolBatch/postToolUse to Stop/stop for better performance and token efficiency.

Problem

On long agent sessions with many uncommitted files, react-doctor was running after every tool batch (Claude) or tool use (Cursor), causing ~4s scans repeatedly throughout the session. This was:

  • Token inefficient (agent sees output many times)
  • Slow (multiple 4s delays per session)
  • Poor UX for users working on larger changes

Solution

Install hooks on the Stop/stop event instead, which fires once when the agent finishes responding. Benefits:

  • Runs once at session end instead of many times during
  • More token efficient
  • Faster overall
  • --scope changed already filters to edited files, so no tool filtering needed

Changes

  • Claude Code: PostToolBatchStop
  • Cursor: postToolUsestop
  • Removed tool name filtering (no longer needed)
  • Updated hook script output format for Stop event (followup_message)
  • Strip legacy hooks from both old and new event types during install
  • Updated all tests

Closes #1647

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 13, 2026 23:05
…/stop

- Change Claude Code hook from PostToolBatch to Stop event
- Change Cursor hook from postToolUse to stop event
- Remove tool name filtering since stop fires once at session end
- Update hook script to use followup_message format for Stop event
- Update all tests to reflect new hook behavior
- Strip legacy hooks from both new and old event types during install

Closes #1647

Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Aug 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@1648
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@1648
npm i https://pkg.pr.new/react-doctor@1648

commit: a4e47e8

@github-actions

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit a4e47e8.

@skoshx
skoshx marked this pull request as ready for review August 13, 2026 23:13
@github-actions

Copy link
Copy Markdown
Contributor

Interactive terminal E2E

Terminal Control verified the built CLI at a4e47e8 in a real PTY:

  • selected a project interactively and observed Scanning... before the three-second Git delay completed
  • waited for the clean result and exercised the compact report
  • opened copy context and the GitHub Actions confirmation, then cancelled safely

Download the edited MP4 and PNG evidence

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.

improvement: change default agent hook installation top stop hooks

2 participants