> ## Documentation Index
> Fetch the complete documentation index at: https://asymptotelabs-claude-cursor-token-usage-6sui0o.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cursor

> Asymptote support details for Cursor endpoint telemetry

## Runtime Overview

Asymptote supports Cursor through native hook payloads sent to `beacon-hooks`.
For provider-managed Cursor cloud sessions, see
[Cursor Cloud Agents](/runtimes/cursor-cloud-agents).

## Prerequisites

Before enabling Cursor hooks, make sure:

* Cursor is installed for the user or the `~/.cursor` directory exists.
* `beacon endpoint install` has run so shared endpoint config and runtime log paths exist.
* Asymptote hooks are installed with `beacon endpoint hooks install --harness cursor`.
* For project-level collection, install hooks from the target project with `--level project`.
* Cursor is restarted after hook install or removal so new sessions load the updated hook configuration.

## Collection path

Cursor invokes Asymptote's hook adapter from Cursor hook configuration. The adapter writes normalized endpoint events to the configured runtime JSONL log.

## Discovery and status

Asymptote detects Cursor through the Cursor binary or `~/.cursor`, then checks Asymptote hook configuration.

Use `beacon endpoint hooks status --harness cursor` to inspect Cursor hook status.

## Install or configuration support

`beacon endpoint install` prepares shared endpoint config and runtime log paths. Install Cursor hooks separately:

```bash title="Install runtime hooks" theme={null}
beacon endpoint hooks install --harness cursor
```

For project-level hooks, run:

```bash title="Install project-level hooks" theme={null}
beacon endpoint hooks install --harness cursor --level project
```

## Telemetry coverage

| Area                              | Support                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Prompt telemetry                  | Supported for local Cursor through `beforeSubmitPrompt` hooks; not available in Cursor Cloud Agents because Cursor submits the prompt before the cloud VM exists. See [Cursor's Cloud Agent hook support matrix](https://cursor.com/docs/hooks#cloud-agent-support).                                                                                                                                                                  |
| Command, tool, and file telemetry | Supported for tool, shell command, MCP-like, approval, and file edit payloads where Cursor exposes them; Cursor Cloud support is limited to Cursor's [cloud-supported command hooks](https://cursor.com/docs/hooks#cloud-agent-support).                                                                                                                                                                                              |
| Agent reasoning telemetry         | Supported for local Cursor through `afterAgentThought` hooks. Each completed thinking block is recorded as an `agent.reasoning` event carrying the reasoning text in the OpenTelemetry GenAI output-messages shape (`gen_ai.output.messages` with a `reasoning` part), plus a `content` marker with the original text's hash and byte count. Reasoning is only available for models/modes where Cursor exposes visible thinking text. |
| Repository and branch context     | Events include the workspace path as `repository`, and `branch` is resolved from the workspace's local git checkout (`.git/HEAD`) when Cursor does not supply one; disable local git resolution with `BEACON_DISABLE_GIT_METADATA=1`.                                                                                                                                                                                                 |
| Token usage                       | Supported through [`beacon token-usage sync-cursor`](/cli/token-usage-sync-cursor), which extracts runtime-recorded token counts from Cursor's local state store into canonical `gen_ai.usage` events. Cursor's hook payloads carry no token counts today; if Cursor adds them, the hook adapter normalizes them into `gen_ai.usage` automatically and hook-reported usage takes precedence over synced usage in rollups.             |
| Local JSONL and dashboard         | Supported                                                                                                                                                                                                                                                                                                                                                                                                                             |
| MDM deployment                    | Supported for the endpoint agent; Cursor hooks are installed separately in the logged-in user's context.                                                                                                                                                                                                                                                                                                                              |

## Deployment notes

Restart Cursor after installing or removing hooks so the updated hook configuration is picked up by new sessions.

Hook events include metadata such as file path, operation, language, diff hash, and diff byte count. Raw diffs and reasoning text are subject to Asymptote's redaction, sanitization, truncation, and event-size limits before writing.

## Token usage

Cursor's hook payloads do not include token counts today, so hook telemetry
alone cannot power the token views for Cursor sessions. Two mechanisms close
the gap:

* **Local state-store sync.** [`beacon token-usage sync-cursor`](/cli/token-usage-sync-cursor)
  reads a private snapshot of Cursor's local state store (`state.vscdb`) and
  appends the runtime-recorded per-generation token counts to the runtime log
  as `token.usage` events attributed to the `cursor` harness, keyed by the
  same conversation id the hooks record. The store is undocumented and
  best-effort: generations without recorded counts are skipped, and Beacon
  never estimates token counts or derives cost locally.
* **Hook passthrough.** If a Cursor release starts including usage fields in
  hook payloads, the hook adapter normalizes them into `gen_ai.usage`
  automatically, and rollups prefer hook-reported usage over synced usage for
  the same session, so the two sources never double count.

After syncing, Cursor usage appears in [`beacon token-usage`](/cli/token-usage)
and the dashboard token view alongside other harnesses.

## Related

<Columns cols={2}>
  <Card title="Supported agent harnesses" icon="list-check" href="/runtimes">
    Return to the runtime support overview.
  </Card>

  <Card title="Hooks" icon="plug" href="/cli/hooks">
    Install, inspect, and uninstall runtime hook integrations.
  </Card>

  <Card title="Cursor Cloud Agents" icon="cloud" href="/runtimes/cursor-cloud-agents">
    Capture Cursor cloud agent telemetry with sandbox-local hooks and GCS upload.
  </Card>
</Columns>
