← ClaudeAtlas

claude-codesessionlisted

Query Claude Code session history via a DuckDB index over `~/.claude/projects/`. Use when asked about Claude Code activity ("how many tokens today?", "what did I work on this week?") or instead of reading, grepping, or jq-ing session transcripts. Not for codebase search, git log queries, or arbitrary databases.
bendrucker/claude · ★ 15 · AI & Automation · score 76
Install: claude install-skill bendrucker/claude
# Session Search and analyze Claude Code conversation history via a DuckDB index over JSONL session files. **Current Session ID**: `${CLAUDE_SESSION_ID}` ## Arguments Map any arguments to the mechanisms below: - `--refresh`: force a rescan via `refresh.ts --refresh` before querying. Default: incremental refresh keyed on a per-file (mtime, size) catalog, skipped entirely while the freshness stamp is younger than `--max-age`. - `--host <label>`: scope queries to one imported machine through the `host` param. Default: span every host, including `local`. See [Cross-Machine History](#cross-machine-history). - `--since <date>`: pass as the `after_date` param to scope queries from that date forward. Default: the full index. ## Database The session index is a DuckDB database at `${CLAUDE_PLUGIN_DATA}/session.duckdb`. That path is stable: use it directly in every query and agent prompt. `refresh.ts` prints the same path, resolved, for callers outside this skill. ### Refresh Run `refresh.ts` before querying. It scans `~/.claude/projects/**/*.jsonl` plus any imported hosts, imports files whose mtime or size changed, drops rows for deleted files, and prints the DB path. When a prior refresh finished within `--max-age` (default 300 seconds), it prints the path and exits without opening the database, so calling it before every query is cheap. Pass `--refresh` to rescan regardless when the user asks for the latest data. ```bash ${CLAUDE_SKILL_DIR}/scripts/refresh.ts ${CLAUDE_SKILL