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 Assistant | Detection Target | Extracted Data |
|---|---|---|
| Claude Code | ~/.claude/sessions/*.jsonl | Session timestamps, input/output tokens, cache hit reads |
| Cursor | workspaceStorage/**/state.vscdb | Composer chat turns, model selections, token consumption |
| Codex CLI | ~/.codex/history.json | Executed prompts, generated completions |
| Windsurf | ~/.windsurf/sessions/ | Cascade conversation history, touched files |
| Aider | .aider.chat.history.md | Model 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:
-
Temporal Proximity:
Calculates the time delta between the commit timestamp and the agent's last active transcript turn (preferred window: within 15–30 minutes). -
File Path Overlap:
Compares the files modified in the Git diff against files cited or written by the agent in its session turns. -
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):
- Calculates net insertions and deletions per file extension.
- Applies language-specific token density multipliers (e.g. TypeScript ~3.8 tokens/line, Python ~3.2 tokens/line).
- Assigns provenance:
estimatedwith a lower confidence rating (typically0.45–0.60).