Skip to main content
Cursor sessions — both interactive IDE sessions and cursor-agent runs — surface in Terma as first-class activity. Hook events capture session boundaries and file edits on all Cursor plans, while the Cursor Enterprise export adds token counts and cost to complete the picture.

How it works

Terma registers three hooks in .cursor/hooks.json:
  • sessionStart — opens a Terma session record when Cursor begins a coding session
  • afterFileEdit — fires after each file is modified, forwarding the file path to Terma for attribution
  • sessionEnd — closes the session record and flushes buffered events
Spend data — token counts and USD cost — arrives separately through the Cursor Enterprise telemetry export, which terma setup points at Terma’s OTEL ingest endpoint. The two streams are joined on session ID automatically.

Requirements

On non-Enterprise plans, Cursor sessions appear in attribution and file activity but cost figures are not available.

Setup

Run terma setup once per developer machine. It writes .cursor/hooks.json and configures the OTEL export endpoint if you are on Cursor Enterprise.
After setup, your .cursor/hooks.json will contain:
.cursor/hooks.json

Enterprise export

If you are on a Cursor Enterprise plan, terma setup automatically configures Cursor to export telemetry to Terma’s OpenTelemetry endpoint. You can also set this manually in Cursor Settings → Telemetry → Export endpoint. Once configured, token usage and cost flow into Terma alongside hook events, giving you full spend visibility per session and per user.

What’s captured

Verifying the connection

After running terma setup, confirm that Cursor is wired correctly:
Cursor should appear as connected. Run a deeper end-to-end check with:
terma doctor verifies that session hooks are firing, that file edit events are reaching Terma, and — on Enterprise plans — that the OTEL export is reachable and delivering spend data. Any gaps appear as actionable findings.