Local-first CLI for AI coding-agent session logs.
Search past work, inspect usage, estimate cost, and export sessions from Claude Code, Codex, and Gemini CLI logs. No telemetry. No runtime network calls.
npm install -g logsesh
logsesh doctorRequires Node.js >=22.
Screenshots use mock data.
logsesh list
logsesh search 'project:myapp auth middleware'
logsesh stats --since 7d --estimate-cost
logsesh export --format markdown --since 30d --out sessions.mddoctor is the best first command on a new machine. It checks log discovery, adapter health, export defaults, and bundled pricing data.
| command | purpose |
|---|---|
doctor |
check log access, adapters, export defaults, and pricing data |
list |
show matching sessions |
search |
find transcript text with snippets |
stats |
summarize activity, tokens, and cost |
export |
write JSON, JSONL, Markdown, or CSV |
Run logsesh <command> --help for all options.
Human output is rich by default when stdout is a TTY. Use --json for scripts and --plain for stable text.
logsesh stats --since 7d # rich dashboard
logsesh stats --since 7d --json # machine-readable envelope
logsesh stats --since 7d --plain # stable textThe same query syntax works across search, list, stats, and export.
| query | meaning |
|---|---|
auth middleware |
match transcript text |
auth AND middleware |
require both terms |
"rate limit" |
exact phrase |
project:myapp |
match project directory name or path segment |
project:myapp auth |
project filter plus text search |
--project myapp is shorthand for project:myapp.
Transcript exports redact known sensitive patterns by default. Paths are anonymized unless you opt out.
| flag | effect |
|---|---|
--allow-sensitive / --no-redact |
export full transcript text |
--redact-pattern <regex> |
add a custom redaction pattern |
--include-reasoning |
include reasoning blocks |
--no-anonymize-paths |
keep raw filesystem paths |
--unsafe-raw |
disable Markdown injection neutralization |
Summary-only CSV keeps path anonymization on by default. Pass --redact to apply pattern redaction to summary rows too.
| tool | default location |
|---|---|
| Claude Code | ~/.claude/projects/*/*.jsonl |
| Codex | ~/.codex/sessions/**/rollout-*.jsonl |
| Gemini CLI | experimental adapter |
Override discovery with --roots tool:path and repeat it for multiple roots.
npm install @logsesh/coreimport { runPipeline, sanitizeForExport } from "@logsesh/core";
for await (const { session, warnings } of runPipeline({ toolFilter: ["codex"] })) {
for (const warning of warnings) console.warn(warning.message);
if (!session) continue;
console.log(sanitizeForExport(session));
}Schemas are published under @logsesh/core/schemas/*.
Pricing data is published under @logsesh/core/pricing/*.
MIT


