codex

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 9 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregate

func Aggregate(targets []agent.Target) agent.Usage

Aggregate rolls up Codex usage across the given repos. Builds the index once.

func Home

func Home() string

Home is $CODEX_HOME, else ~/.codex.

func PrettyModel

func PrettyModel(model string) string

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

func SearchSessions(targets []agent.Target, query string, limit int) []agent.SessionHit

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

func Sessions(repoPath string, limit int) []agent.Session

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

func Summary(repoPath string) (sessions int, last time.Time)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL