Expand description
Portable session IR, parsers, discovery, and process matching for local AI coding-agent transcripts.
The crate currently normalizes Claude Code, Codex, and Gemini CLI sessions. It intentionally stops at session data and process/session correlation; UI, database storage, eBPF collection, and OpenTelemetry export belong in applications that consume this crate.
Structs§
- Agent
Session - A parsed agent session with metadata, token usage, and tool invocations.
- Live
Process Candidate - A live process candidate for session matching.
- Process
Key - Unique identifier for a process (pid + start time).
- Process
Tree - A tree of related processes.
- Session
Cache - Cache for discovered and parsed sessions.
- Session
Candidate - A candidate session file discovered on disk.
- Session
DirStat - Statistics about a session directory.
- Session
Process Input - Input for session-to-process matching.
- Session
Process Match - A match between a session and a process.
- Session
Process Matcher - Stateful matcher for correlating sessions with live processes.
- Session
Process Matches - Collection of session-to-process matches.
- Token
Usage - Token usage statistics for a model or session.
Constants§
- AGENT_
CLAUDE - AGENT_
CODEX - AGENT_
GEMINI - SOURCE_
SESSION_ PROCESS_ MATCH - TRACE_
EBPF_ FILE - TRACE_
PROC_ FD - TRACE_
RECENT_ CWD - TRACE_
STICKY_ BINDING
Functions§
- agent_
source_ for_ path - Detect which agent a session file belongs to based on its path.
- codex_
exec_ prompt - Extract the prompt from a Codex exec command.
- count_
session_ dirs - Count sessions and bytes per agent directory.
- discover_
session_ files - Discover all session files in the user’s home directory.
- discover_
session_ files_ in_ home - Discover session files under a specific home directory.
- fixture_
session_ path - Generate a fixture session path for testing.
- is_
codex_ cli_ entrypoint - Check if a target path is the Codex CLI entrypoint.
- normalize_
session_ log_ path - Canonicalize a session log path.
- parse_
session_ content - Parse session content given raw content string.
- parse_
session_ file - Parse a session file from a candidate.
- parse_
session_ path - Parse a session file by path, detecting the agent type automatically.
- session_
log_ path_ from_ str - Extract a session log path from a string (e.g., from /proc/fd).