Request: Hooks support (post-edit, pre-edit, etc...)

Hey all - was wondering if there are any plans to support something like Hooks - Anthropic in Claude Code?

I’ve been building an extension to git blame that lets enterprises track the code in their repositories that was generated by AI vs Humans. It needs to be triggered after your fast apply step runs and a few of the early users have been asking me for Cursor support. I tried building a VSCode extension but none of the Cursor specific events seem accessible.

Hooks would go a long way towards this (and other) use cases.

Here’s an example of what they do with Claude Code

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Write|Edit|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "git-ai checkpoint"
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Write|Edit|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "git-ai checkpoint --author \"Claude Code\""
          }
        ]
      }
    ]
  }
}
12 Likes

I love this request! We need this in Cursor!

2 Likes

+1 love this.

2 Likes

+1, would really love to define custom hooks that either run code or send a request to a model with a predefined prompt. I love the way the new Kiro IDE does hooks - Hooks - Docs - Kiro

if you guys could clone this into cursor, that would be fantastic!

2 Likes

Fully support this request. Depending on the AI model, it’s common to re-trigger certain actions, especially around code edits or session resets. Having hooks would make it much easier to automatically run tests across the entire codebase or implement custom logic to save tokens and reduce redundant operations. This would unlock a lot of flexibility for more advanced workflows.

1 Like

+1 there are a ton of uses for this.

2 Likes

Do we know when it will be added? I would love to implement a memory MCP server that is always fired at the beginning of AI thinking and at the end.

+1
we need this

Seems that they have added this (at least somewhat) Changelog · Cursor

Add the same to Cursor CLI (aka cursor-agent)

2 Likes

I would really like this myself - I would like to be able to hook onto the summarization event - at the moment it’s like programming with the guy from memento. I have to repeatedly re-inject my preferred tdd programming style after each summarization (which btw, I would like to be interactive and approved by me) even when I have tdd instructions coming out or Cursor’s rule ears. It seems like the only reliable way to adjust behaviour is to reinject into the prompt via slash commands, but why do I need do that manually each time? surely if I could hook a slash commend to auto-fire on summarisation …?

but do we already have them? Hooks | Cursor Docs