Cursor Hooks
How Intentra integrates with Cursor IDE.
Overview
Cursor supports external hooks that fire on AI actions.
Hook Configuration
The CLI creates ~/.cursor/hooks.json:
{
"onAIAction": {
"command": "intentra",
"args": ["hook", "cursor"]
}
}Event Format
When Cursor fires the hook, it passes:
{
"action": "chat",
"tokens": {
"input": 500,
"output": 750
},
"model": "gpt-4",
"timestamp": "2024-01-15T10:30:00Z"
}Supported Actions
| Action | Description |
|---|---|
chat | Chat interaction |
complete | Code completion |
edit | AI-powered edit |
search | Semantic search |
Installation
intentra install cursorThis:
- Locates Cursor config directory
- Creates hooks.json if missing
- Adds Intentra hook configuration
- Verifies hook is active
Troubleshooting
If hooks aren’t firing:
- Restart Cursor
- Check hooks.json exists
- Run
intentra hooks status