Skip to content

feat(cursor): Add real-time capture via ~/.cursor/hooks.json #114

Description

@aktasbatuhan

Background

PR #113 added Cursor adapter support by reading the SQLite chat store (globalStorage/state.vscdb). This works for retroactive discovery but doesn't provide real-time session capture.

Goal

Add real-time capture for Cursor sessions so curation can fire without waiting for the next scan, matching the experience for Claude Code and Codex.

Approach (corrected)

Cursor does have a hooks mechanism (https://cursor.com/docs/hooks, v1.7+), but it is NOT a drop-in equivalent of Claude Code's transcript_path. The hooks are event-based and fire-and-forget: sessionStart, beforeShellExecution, afterFileEdit, stop, etc. There is no single JSONL transcript file emitted that we can tail the way we do for the JSONL agents.

So real-time capture here likely means one of:

  • a stop / sessionEnd hook that triggers a re-scan of the just-finished composer in state.vscdb (cheapest, reuses the existing SQLite adapter), or
  • reconstructing a transcript from the event stream itself (more work, and the events carry less than the store does).

Worth scoping which one is actually worth it before committing. The store reader from #113 already covers the data; the open question is purely latency.

Acceptance Criteria

  • Document the actual ~/.cursor/hooks.json event format and what each event carries
  • Decide: re-scan-on-stop vs reconstruct-from-events (lean re-scan unless events add something the store lacks)
  • Wire the chosen path into the existing Cursor adapter / scan pipeline
  • Add setup docs for enabling the hook
  • Test with a real Cursor session

/cc @goktugecertastan-cyber - you mentioned wiring this as a follow-up. Heads up that the hooks look event-based rather than a transcript file, so a stop-hook that re-scans the store may be the simplest route. Curious if that matches what you saw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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