agent_data

Eine in Rust geschriebene DuckDB-Erweiterung zum Abfragen, Analysieren und Prüfen der Historie von KI-Coding-Agenten. Lesen Sie Unterhaltungen, Pläne, Todos, Verlauf und Nutzungsstatistiken direkt aus den lokalen Agentendatenverzeichnissen.

Maintainer: axsaucedo

Installation und Laden

INSTALL agent_data FROM community;
LOAD agent_data;

Beispiel

-- How many conversations have I had with Claude?
SELECT COUNT(DISTINCT session_id) AS sessions,
COUNT(*) AS total_messages
-- Calling the functions without params defaults to Claude folder.
FROM read_conversations();
-- What did I work on this week?
SELECT date, message_count, tool_call_count
FROM read_stats()
ORDER BY date DESC
LIMIT 7;
-- Which tools does github copilot use most?
SELECT tool_name, COUNT(*) AS uses
FROM read_conversations('~/.copilot')
WHERE tool_name IS NOT NULL
GROUP BY tool_name
ORDER BY uses DESC
LIMIT 10;
-- What are my active todos in my custom claude path?
SELECT content, status
FROM read_todos('~/work_folder/.claude')
WHERE status != 'completed'
ORDER BY item_index;
-- Compare activity across Claude and Copilot
SELECT source, COUNT(DISTINCT session_id) AS sessions, COUNT(*) AS messages
FROM (
SELECT * FROM read_conversations(path='~/.claude')
UNION ALL
SELECT * FROM read_conversations(path='~/.copilot')
)
GROUP BY source;

Über agent_data

Unterstützte Agenten: Claude Code (~/.claude), Claude Desktop, GitHub Copilot CLI (~/.copilot), OpenAI Codex (~/.codex) und Gemini CLI (~/.gemini).

Geschrieben in 🦀 Rust.

Standardverhalten

Wird eine Funktion ohne Argumente aufgerufen, liest sie vom Standardpfad des jeweiligen Anbieters:

Function Default path Detected as
read_conversations() ~/.claude Claude Code
read_plans() ~/.claude Claude Code
read_todos() ~/.claude Claude Code
read_history() ~/.claude Claude Code
read_stats() ~/.claude Claude Code

Um die Daten eines anderen Agenten zu lesen, übergeben Sie den Pfad ausdrücklich:

FROM read_conversations(path='~/.copilot');
FROM read_conversations(path='~/.codex');
FROM read_conversations(path='~/.gemini');

Verfügbare Funktionen

Alle Funktionen akzeptieren zwei optionale Parameter:

  • path — Pfad zum Datenverzeichnis (Standard: ~/.claude). Wird anhand der Ordnerstruktur erkannt (projects/ → Claude, session-state/ → Copilot, datierte sessions/ → Codex, tmp/ + installation_id → Gemini).
  • source — ausdrückliche Anbieterüberschreibung: 'claude', 'claude-desktop', 'copilot', 'codex' oder 'gemini'. Verwenden, wenn die automatische Erkennung fehlschlägt oder das Verzeichnislayout unüblich ist.

Jede Tabelle enthält als erste Spalte eine Spalte source ('claude' oder 'copilot').

read_conversations([path (opt)], [source (opt)])

Join-Schlüssel

Tabellen lassen sich innerhalb derselben Quelle verbinden:

-- Conversations ↔ History (via session_id)
SELECT c.*, h.display
FROM read_conversations(path='~/.claude') c
JOIN read_history(path='~/.claude') h ON c.session_id = h.session_id;
-- Cross-source: always filter by source
SELECT * FROM (
SELECT * FROM read_conversations(path='~/.claude')
UNION ALL
SELECT * FROM read_conversations(path='~/.copilot')
) WHERE source = 'copilot';
Join Left Key Right Key Notes
conversations <-> history session_id session_id Same source only
conversations <-> todos session_id session_id Same source only
conversations <-> plans slug plan_name Claude only
conversations <-> history project_path project Claude only

Die vollständige Dokumentation finden Sie im GitHub-Repository.

Hinzugefügte Funktionen

function_name function_type description comment examples
read_conversations table Read conversation messages and tool calls from AI coding agent sessions Supports Claude Code and GitHub Copilot CLI with auto-detection [SELECT * FROM read_conversations(path=‘~/.claude’) LIMIT 10;]
read_plans table Read plan and strategy markdown files from agent sessions Claude: plans/.md, Copilot: session-state//plan.md [SELECT plan_name, file_size FROM read_plans();]
read_todos table Read todo and checklist items with status tracking Claude: todos/*.json, Copilot: checkpoint markdown checklists [SELECT content, status FROM read_todos() WHERE status != ‘completed’;]
read_history table Read command and prompt history Claude: history.jsonl, Copilot: command-history-state.json [SELECT display FROM read_history() ORDER BY line_number DESC LIMIT 10;]
read_stats table Read daily activity statistics (message, session, and tool call counts) Currently Claude only — returns empty for Copilot [SELECT date, message_count FROM read_stats() ORDER BY date DESC;]

Überladene Funktionen

Diese Erweiterung fügt keine Funktionsüberladungen hinzu.

Hinzugefügte Typen

Diese Erweiterung fügt keine Typen hinzu.

Hinzugefügte Einstellungen

Diese Erweiterung fügt keine Einstellungen hinzu.