Skip to content

Cursor sessions report zero token usage (stop hook token fields not parsed) #1264

@SnowingFox

Description

@SnowingFox

What happened?

Cursor's stop hook payload includes per-turn token accounting fields (input_tokens, output_tokens, cache_read_tokens, cache_write_tokens), but the CLI does not parse them. As a result, entire status always shows 0 tokens for Cursor sessions, and checkpoint metadata has no token data.
Unlike Claude Code (which embeds usage in the JSONL transcript) or Codex (which has token_count events in the rollout), Cursor's JSONL transcript contains no usage fields at all. The stop hook payload is the only authoritative source.

Steps to reproduce

entire status should display token counts for Cursor sessions, and checkpoint metadata should include token usage.

Entire CLI version

0.6.2

OS and architecture

No response

Agent

cursor

Terminal

No response

Logs / debug output

Additional context

Root cause

  • stopHookInputRaw in cmd/entire/cli/agent/cursor/types.go does not define input_tokens / output_tokens / cache_read_tokens / cache_write_tokens
  • parseTurnEnd in cmd/entire/cli/agent/cursor/lifecycle.go does not populate event.TokenUsage
  • handleLifecycleTurnEnd in cmd/entire/cli/lifecycle.go falls through to agent.CalculateTokenUsage() which returns nil for Cursor (no TokenCalculator implemented)

Token derivation

Cursor reports input_tokens as the total (cache_read + cache_write + fresh). The correct derivation:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions