Skip to content

Add Cursor IDE hook support#7

Open
terraboops wants to merge 1 commit intomainfrom
feat/cursor-hooks
Open

Add Cursor IDE hook support#7
terraboops wants to merge 1 commit intomainfrom
feat/cursor-hooks

Conversation

@terraboops
Copy link
Owner

Summary

  • Adds automatic normalization of Cursor hook events so existing boopifier configs work with both Claude Code and Cursor
  • Maps Cursor's camelCase event names to PascalCase (preToolUsePreToolUse, beforeShellExecutionPreToolUse, stopStop, etc.)
  • Synthesizes missing fields: conversation_idsession_id, and tool_name for Cursor-specific hooks (beforeShellExecutionBash, beforeReadFileRead, afterFileEditEdit)
  • Includes .cursor/hooks.json setup docs in README

Test plan

  • All 72 existing tests pass (no regressions)
  • 16 new unit tests covering event mapping, detection, field normalization, and edge cases
  • Verified Claude Code events are not affected by normalization
  • Manual test: pipe Cursor hook JSON through boopifier and verify webhook fires

🤖 Generated with Claude Code

Cursor uses camelCase event names (preToolUse, beforeShellExecution, stop)
and different field names (conversation_id instead of session_id). This
adds automatic normalization so existing boopifier configs work unchanged
with both Claude Code and Cursor hooks.

Event mapping: camelCase → PascalCase (e.g., preToolUse → PreToolUse).
Cursor-specific hooks like beforeShellExecution/afterFileEdit are mapped
to PreToolUse/PostToolUse with synthesized tool_name fields (Bash, Read,
Edit). conversation_id is mapped to session_id for webhook templates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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