Documentation
¶
Overview ¶
Package codex reads local Codex CLI session rollouts to surface, per repository, how much it has been worked on with Codex: number of sessions, when it was last used, which model, tokens, and the files it changed.
Codex stores one rollout JSONL per session under $CODEX_HOME/sessions/YYYY/MM/DD/rollout-<ts>-<uuid>.jsonl (default ~/.codex). Unlike Claude, sessions are foldered by date, not by repo: the repo a session belongs to is its session_meta `cwd`, so we index every rollout's first line once and group by cwd.
Index ¶
- func Aggregate(targets []agent.Target) agent.Usage
- func Home() string
- func PrettyModel(model string) string
- func SearchSessions(targets []agent.Target, query string, limit int) []agent.SessionHit
- func Sessions(repoPath string, limit int) []agent.Session
- func Summary(repoPath string) (sessions int, last time.Time)
- func TouchMap(repoPath string, limit int) []agent.TouchedFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrettyModel ¶
PrettyModel shortens a Codex model id for display (e.g. trims a provider prefix). Codex ids are already short like "gpt-5.5", so this is light.
func SearchSessions ¶
SearchSessions does a case-insensitive substring search over the message text of Codex sessions in the given repos and returns matches with a snippet, newest first, capped at limit.
func Sessions ¶
Sessions parses the newest `limit` rollouts for a repo (model, turns, tokens, title). More expensive than Summary; for the detail view and aggregation.
func Summary ¶
Summary is the cheap view: how many Codex sessions ran in the repo and when the most recent one was. Safe to call for every repo during a scan.
func TouchMap ¶
func TouchMap(repoPath string, limit int) []agent.TouchedFile
TouchMap scans the newest `limit` Codex sessions for a repo and returns the files Codex edited there (from patch_apply_end), scoped to the repo root and sorted edits-first. Codex applies changes as patches, so these are writes; reads are not recorded in the rollout.
Types ¶
This section is empty.