feat(metrics): score Cursor sessions like Claude Code - #265
Conversation
Add per-session usage accounting for Cursor — graft vs source reads and token savings — via repo-local .cursor hooks, a `graft stats` readout, and host-attributed `session_summary` telemetry. - consolidate the Codex/Cursor/MCP config writers onto a shared ConfigWrite type and a readJsonObject load-or-skip helper (src/hosts/config-write.ts) - force-close the just-ended conversation on Cursor's sessionEnd instead of waiting for the idle sweep, and stamp the recording host on each session - anchor graft MCP-tool detection to the real tool-name list rather than a loose "graft" substring (src/mcp/tool-names.ts)
🌱 graft blast radius5 areas changed → 3 areas can be affected. 5 dependent symbols, depth 2. flowchart TB
A0(("Claude Initialization<br/>2 symbols"))
A1(("MCP Server<br/>2 symbols"))
A2(("Wiring Configuration<br/>1 symbol"))
classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
class A0,A1,A2 reached;
Who knows this code — 2 people across 8 areas
Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no All 5 dependent symbols, grouped by areaClaude Initialization — 2 symbols in 2 files
MCP Server — 2 symbols in 1 file
Wiring Configuration — 1 symbol in 1 file
Test signal per changed area — 3 ✓ · 1 ⚠ · 1 –Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.
15 test suites also reference this code17 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.
Open the interactive graph → — click an area to see its dependent symbols at file:line. |
|
Verified locally on top of current Real session scoring for Cursor, mirroring Claude Code: |
Add per-session usage accounting for Cursor — graft vs source reads and token savings — via repo-local .cursor hooks, a `graft stats` readout, and host-attributed `session_summary` telemetry. - consolidate the Codex/Cursor/MCP config writers onto a shared ConfigWrite type and a readJsonObject load-or-skip helper (src/hosts/config-write.ts) - force-close the just-ended conversation on Cursor's sessionEnd instead of waiting for the idle sweep, and stamp the recording host on each session - anchor graft MCP-tool detection to the real tool-name list rather than a loose "graft" substring (src/mcp/tool-names.ts)
Add per-session usage accounting for Cursor — graft vs source reads and token savings — via repo-local .cursor hooks, a
graft statsreadout, and host-attributedsession_summarytelemetry.