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
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
Runterma setup once per developer machine. It writes .cursor/hooks.json and configures the OTEL export endpoint if you are on Cursor Enterprise.
.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 runningterma setup, confirm that Cursor is wired correctly:
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.