The short answer

AgentSight v1.0.35 scans five provider-owned roots: Claude Code under ~/.claude/projects, Codex under $CODEX_HOME/sessions or ~/.codex/sessions, Gemini CLI under~/.gemini/tmp, Cursor under ~/.cursor/projects, and CodeBuddy CLI under~/.codebuddy/projects or an absolute CODEBUDDY_CONFIG_DIR override. Discovery recognizes provider-specific transcripts, orders candidates by freshness, and bounds the normal list to at most 25 sessions. It is not a generic recursive scanner of every JSONL file on disk.

Two providers also have read-only database paths that avoid treating every list operation as a full transcript parse. Codex can use state_5.sqlite as a thread index. Cursor can use its localstate.vscdb to enrich an already-discovered transcript with composer timestamps, model, workspace, and token counts. Those databases are optimizations and enrichment sources, not replacements for provider-owned transcript files.

What AgentSight scans before it parses anything

AgentDiscovery rootRecognized transcriptSession-ID path
Claude Code~/.claude/projectsJSONL beneath .claudeThe transcript file stem is the session ID.
Codex$CODEX_HOME/sessions when CODEX_HOME is absolute; otherwise ~/.codex/sessionsJSONL beneath .codex; state_5.sqlite can provide the recent-thread index.The scanner extracts session_meta.id from a bounded header; the SQLite path already supplies the thread ID.
Gemini CLI~/.gemini/tmpJSON session files beneath .geminiThe bounded JSON header supplies sessionId.
Cursor~/.cursor/projectsJSONL under agent-transcripts, plus sibling subagent JSONL filesThe parent transcript file stem is the composer/session ID; duplicate candidates are collapsed.
CodeBuddy CLI~/.codebuddy/projects or an absolute CODEBUDDY_CONFIG_DIR/projectsProject .jsonl session transcripts; history.jsonl is not a sessionProject transcript file stem, checked against the parsed source session ID when hydrating detail.

Path ownership and format are part of classification. AgentSight does not recursively treat every JSON or JSONL file in the home directory as agent history. That reduces false positives, but it also means an upstream storage-layout change can make a real provider session temporarily undiscoverable until the parser is updated.

Discovery is an index first, transcript parsing second

The list path is intentionally bounded. The native analysis layer asks the session cache for recent candidates, optionally substitutes the Codex SQLite index, sorts by update time, truncates to limit.clamp(1, 25), removes duplicate display IDs, enriches Cursor rows, and only then applies optional PID or text filters.

Direct detail lookup follows a different path so the 25-row list cap does not make an older known session impossible to open. AgentSight keeps an ID-to-path candidate index. If the ID is missing or its path vanished, it rebuilds that index from discovered session files, refreshes only the matching candidate, parses it through the shared cache, verifies that the parsed session_id still matches, and then hydrates detail.

For Codex and Gemini, the ID index reads only the first 64 KiB when it needs the provider-native session ID. Claude, Cursor, and CodeBuddy can use the transcript file stem directly. This is a useful troubleshooting distinction: list discovery, ID resolution, and full transcript parsing are separate failure points.

Codex uses a read-only SQLite fast path

When state_5.sqlite is readable, AgentSight opens it with SQLite read-only flags and selects recent rows from threads ordered by updated_at_ms. The query reads the thread ID, rollout path, model, token total, preview, working directory, and created/updated timestamps. That is enough to construct a useful recent-session row without first parsing the whole rollout.

The implementation still consults the rollout for summary fields that are not reliably represented by the thread row. It reads at most the final 1 MiB, extracts the latest token usage and plan information, and caches that summary by path, file length, and modification time. The summary cache is bounded to 64 entries and is cleared before accepting a new path when already full.

If the Codex database is absent or cannot be opened, discovery falls back to cached transcript scanning rather than failing all native-session discovery. Likewise, CODEX_HOME is honored only when it resolves to an absolute path; otherwise AgentSight falls back to ~/.codex.

Cursor has two layers: transcript discovery and state-database enrichment

Cursor discovery starts from ~/.cursor/projects. A parent transcript's freshness includes the newest sibling subagents/*.jsonl modification time, so delegated work can keep the parent session recent. If more than one Cursor candidate has the same file stem, AgentSight prefers a candidate outside the special empty-window tree and otherwise keeps the newer candidate.

After discovery, AgentSight looks for Cursor's state.vscdb in the standard macOS, Linux, or Windows application-data locations and opens the database read-only. For the matching composer ID it can usecomposerHeaders for created/updated timestamps and cursorDiskKV composer data for the selected model and workspace path. If those records are missing, the transcript-derived row remains usable.

Token enrichment also comes from Cursor's local key-value records. AgentSight sums input and output tokens for the parent composer's bubbleId records, then rolls up the same counters for discovered subagent IDs. That detail matters for delegated Cursor runs: reading only the parent transcript or only the parent composer counters can under-report the session that delegated the work.

CodeBuddy CLI: why a fifth provider needs its own parser

CodeBuddy CLI is a Node.js command-line agent, not the CodeBuddy IDE plugin. In the pinned v1.0.35 native session parser, discovery walks ~/.codebuddy/projects by default and recognizes project .jsonl transcripts. CODEBUDDY_CONFIG_DIR substitutes a different home only when it is an absolute path. A relative value falls back to ~/.codebuddy, as a source regression test confirms. The separate ~/.codebuddy/history.jsonl is a prompt index, not a session transcript; counting its entries as agent sessions would inflate activity.

A project JSONL file is only a candidate. The CodeBuddy-specific parser recognizes message, ai-title, summary, and turn-metrics records. It reads user turns, model messages, tool calls, tool results, timestamps and available token usage into the shared session representation. A file containing only session-meta is rejected as an empty session. This differs from simply displaying any file discovered beneath a provider directory.

Which CodeBuddy fields survive normalization?

Source recordAgentSight interpretationEvidence boundary
sessionId, numeric timestamp, cwdProvider session identity, millisecond clock and working directoryThe file's existence does not prove the parsed transcript has a valid task
providerData.rawUsage, providerData.usage, message usagePreferred token fields with fallbacks; separate cache creation/read counters when presentMissing provider usage is not a measured zero-cost call; fields are provider-reported
Assistant tool_use or function_callTool name, call ID, command/path hints and source timestampAn invocation is not independent proof of an executed file operation
User tool_result linked by tool_use_idA matching result changes tool status to ok or fail from is_errorUnmatched calls remain observed, not proven successful
turn-metrics.durationMs, ai-title, summaryAccumulated reported duration and optional human-readable previewThese are transcript fields, not host CPU measurements

The implementation prefers rawUsage.prompt_tokens andcompletion_tokens when available, then checks camel-case provider usage and finally the message usage object. Cache creation and cache read counts remain separate in session aggregates. Tool-result status is applied only when its call ID matches an earlier Tool event. An empty assistant message after a completed tool sequence does not generate a fake LLM response.

Reproducibility: what the CodeBuddy tests establish

The pinned Rust regression tests codebuddy_parser_reads_numeric_timestamps_usage_and_tools, codebuddy_session_meta_only_is_not_a_session, codebuddy_discovery_finds_project_jsonl_and_skips_history, and codebuddy_empty_assistant_after_tools_does_not_emit_blank_responsecover four different gates. The synthetic fixture has one user prompt, one assistant response and one Read invocation, with reported 36,149 input tokens, 18 output tokens,31,864 cache-creation tokens and 4,277 ms turn duration. Those are fixed test inputs and assertions, not customer usage, a runtime benchmark, or a real captured session.

To audit a build, inspect the tag and its fixtures before running the session tests in a disposable environment. A source-level inspection requiring no private transcripts is:

git clone https://github.com/eunomia-bpf/agentsight.git
cd agentsight
git checkout c1574366122a90c451bca6a84713e28813ab95e2
rg -n "AGENT_CODEBUDDY|configured_codebuddy_home|parse_codebuddy_jsonl" ext/session/src/parser.rs
rg -n "fn codebuddy_.*|fn relative_codebuddy_home" ext/session/src/parser.rs
rg -n "CodeBuddy CLI|CODEBUDDY_CONFIG_DIR|history.jsonl" docs/agents.md

If CodeBuddy appears in agentsight top but the session is incomplete, first confirm the CLI's project JSONL and provider schema. agentsight report --local is a native-history path, whereas sudo agentsight record -c codebuddy uses separate Linux process/TLS sensors. The CLI's Node process name need not be codebuddy; the source documents command-line process matching and an SSL filter exception. Neither mode proves that every file/network effect was captured, and the IDE plugin is out of scope. Sensitive prompts, file paths and tool arguments remain local evidence; do not post raw session transcripts publicly for debugging.

Hydrated detail is intentionally bounded

A matching transcript can still be very large, so AgentSight bounds the detail payload after hydration. v1.0.35 retains at most 1,000 prompts, 2,000 LLM responses, and 2,000 tool events. Prompt and response text each share a 2 MiB budget; tool command text gets 1 MiB. Per-tool process chains are capped at 16 entries, while path groups, paths, and domains are capped at 32 each.

The truncation logic keeps the newest events and spends text budgets from newest to oldest. That makes the returned detail a bounded recent representation, not proof that every byte of an arbitrarily large provider transcript was returned. Keep the provider-native artifact when an investigation requires the complete source.

Why a local session can be missing or look incomplete

SymptomImplementation-level check
An old session is not in the normal list.List discovery is bounded to the requested limit and never more than 25 rows; callers can also supply a maximum-age window.
Codex sessions disappeared after moving its home.Verify that CODEX_HOME is an absolute path and that its sessions tree or state_5.sqlite remains readable.
CodeBuddy CLI history seems empty or over-counted.Check the absolute CODEBUDDY_CONFIG_DIR override, projects/*.jsonl, and exclude the prompt-only history.jsonl. A metadata-only transcript does not make a parsed session.
A transcript-shaped file is ignored.Provider path ownership and expected extension matter; an arbitrary JSON/JSONL file is not admitted as native session state.
A Cursor session has no model/workspace/token enrichment.Transcript discovery can succeed even when state.vscdb is absent, unreadable, or lacks the matching composer records.
A delegated Cursor run looks smaller than expected.Check that the sibling subagent transcripts are still present; AgentSight discovers their IDs and rolls their bubble-token counts into the parent when state records exist.
A direct detail lookup returns no session.The indexed path must still exist, the candidate must parse, and the parsed provider session ID must exactly match the requested ID.

Start with the provider's native state and discovery root before assuming an eBPF or network problem. Local session discovery is a provider-state path; system capture is a separate sensor. The no-eBPF evidence guide explains when each boundary is useful.

Provider state is useful evidence, but it is not an independent system trace

Native state can be the strongest source for provider session IDs, prompts, model metadata, tool semantics, token fields, and plan information. It is not independent proof of every process, file, or network effect. A missing native row can mean a discovery/layout/parser boundary; a missing system row can mean a sampling, privilege, process-family, or runtime-coverage boundary. Neither absence should be promoted into a universal claim that an action never happened.

For the normalization step after discovery, read how AgentSight maps provider transcripts into one session model. For independent runtime evidence, see the eBPF agent monitoring boundary map.

Primary sources and research scope

Research scope: released AgentSight v1.0.35 at commit c1574366122a, inspected on 23 November 2026. This is a major evergreen refresh of the existing discovery guide, adding CodeBuddy CLI source classification, parser evidence, field-level mapping, reproducible fixture assertions, and native-versus-system capture limits. Existing Codex/Cursor details remain implementation-scoped; provider storage formats can change independently. No new runtime measurement was performed.