Agent Sessions & Telemetry Harvesters

Discover how Qodewk scans local transcripts from Claude, Cursor, Codex, and Windsurf to extract AI tokens.

Qodewk's core engine (@qodewk/core) incorporates non-invasive Agent Footprint Harvesters that detect local session transcripts generated by AI coding assistants.


1. Supported Harvesters

Qodewk includes native harvesters for the major AI coding agents:

Coding AssistantDetection TargetExtracted Data
Claude Code~/.claude/sessions/*.jsonlSession timestamps, input/output tokens, cache hit reads
CursorworkspaceStorage/**/state.vscdbComposer chat turns, model selections, token consumption
Codex CLI~/.codex/history.jsonExecuted prompts, generated completions
Windsurf~/.windsurf/sessions/Cascade conversation history, touched files
Aider.aider.chat.history.mdModel usage summaries, prompt/response counts
Antigravity~/.gemini/antigravity/brain/Multi-agent trajectory transcripts, tool calls

Graceful Degradation:
If a developer has not installed a particular assistant, or if transcripts are missing, harvesters gracefully return empty footprints without throwing errors or adding latency.


2. Commit Correlation & Footprint Scoring

When a commit occurs, Qodewk identifies which agent was primarily responsible using an attribution scoring heuristic:

  1. Temporal Proximity:
    Calculates the time delta between the commit timestamp and the agent's last active transcript turn (preferred window: within 15–30 minutes).

  2. File Path Overlap:
    Compares the files modified in the Git diff against files cited or written by the agent in its session turns.

  3. Composite Scoring Function:

    const score = (fileOverlapCount * 3.0) + Math.max(0, 1.0 - (timeDeltaMinutes / 60));

    The candidate session with the highest score is designated as the primary agent session.


3. Dual-Engine Fallback

What if no transcript exists (e.g. an agent was used in a proprietary web browser, or logs were purged)?

Qodewk automatically activates Engine B (AST & Diff Fallback):

  1. Calculates net insertions and deletions per file extension.
  2. Applies language-specific token density multipliers (e.g. TypeScript ~3.8 tokens/line, Python ~3.2 tokens/line).
  3. Assigns provenance: estimated with a lower confidence rating (typically 0.45–0.60).