@afffun/codexsess
v0.0.17
Published
Terminal viewer for Codex sessions with search, export, and npm self-update checks
Readme
Codexsess
Codexsess is a read-only terminal viewer for Codex session history stored under .codex.
It is built for large real-world sessions: you get a session list, normalized timeline, detail view, search, filtering, Markdown export, copy helpers, and npm-based self-update checks in one TUI.
Install
Global install:
npm install -g @afffun/codexsess
codexsessOne-off run:
npx @afffun/codexsessWhat It Does
- Reads session index data from
state_5.sqlitewhen available. - Falls back to scanning
sessions/**/*.jsonldirectly. - Shows a three-pane TUI for sessions, timeline, and detail.
- Switches to a compact layout on narrow terminals such as iPhone terminal apps.
- Supports search, paging, newest-first timeline browsing, follow mode, copy helpers, and Markdown export.
- Checks npm for a newer
@afffun/codexsessrelease on startup.
Basic Usage
Open the default Codex home:
codexsessIf the machine exposes multiple .codex homes, Codexsess opens a source picker at startup so you can choose which one to browse.
Codexsess remembers the last selected source and restores that source's browsing state independently.
Open a specific Codex home:
codexsess --codex-home /path/to/.codexOpen with raw detail enabled:
codexsess --rawSkip sqlite and scan JSONL only:
codexsess --no-sqlitePre-filter sessions or timeline:
codexsess --session-query deploy --timeline-query errorExport one session without entering the TUI:
codexsess export --session <session-id> --format markdown --output session.mdManage known Codex homes:
codexsess sources list
codexsess sources current
codexsess sources use /path/to/.codex
codexsess sources add /path/to/.codex
codexsess sources remove /path/to/.codexPer-source state that is restored automatically includes:
- the last selected session
- session search text
- timeline search text
- timeline order
- timeline filters
Updating
Check for a newer version without installing:
codexsess update --checkCheck npm and install the latest release if one exists:
codexsess updateWhen Codexsess starts, it also checks npm in the background. If a newer version exists, the startup prompt gives you three choices:
u: install the update nows: skip only for the current runi: ignore that specific version until something newer is published
The persistent ignore state is stored locally under the Codexsess config directory.
In-App Controls
Tab/Shift-Tab: cycle focusCtrl-H/Ctrl-L: previous / next paneUp/Down/j/k: move selectionCtrl-P/Ctrl-N: move selection up / downPageUp/PageDown: page through the active paneHome/End/g/G: jump to the start or endsorCtrl-S: session search/orCtrl-F: timeline searchp: jump to a timeline page when Timeline is focusedt: toggle timeline order between newest-first and oldest-firstc: open the Codex home source picker1-7: toggle timeline filters0: restore default filtersa: enable all filtersEnter: load a deferred large session, or drill down in compact model: load the selected deferred large sessionr: toggle normalized/raw detailf: toggle follow modeR: reload sessions?: open helpq: quit
Copying And Export
y: copy selected Detail text, or the current item body when nothing is selectedo: copy the current raw JSONY: copy the current session export as Markdownx: export the current session to Markdown after entering a directoryX: export the current timeline item to Markdown after entering a directory
Desktop terminals often block native text selection while the TUI owns the alternate screen and mouse capture. On desktop, use in-app Detail selection instead:
- Drag inside the
Detailpane. - Press
y.
Markdown exports include the session ID, rollout path, working directory, and Codex home. If the export directory prompt is left empty, Codexsess uses the current working directory.
Notes
- Codexsess is strictly read-only against
.codex. - When more than one Codex home is available, Codexsess treats each one as a separate source. It does not merge sessions across sources.
- Codex storage formats are internal and may change between CLI versions.
- Hidden/internal reasoning items may exist only as encrypted payloads and cannot be reconstructed.
- Very large sessions are intentionally not auto-loaded on startup. Select them and press
Enterorlwhen you actually want to parse them.
Clipboard behavior depends on the local terminal environment:
- Wayland: ideally with
wl-clipboard(wl-copy) - X11:
xcliporxsel - tmux:
set -g set-clipboard on - Terminal protocol fallback: OSC52 support in the terminal emulator
In headless Linux shells without X11, Wayland, tmux clipboard integration, or OSC52 support, in-app selection can still work while desktop clipboard copy may not.
Local Development
Run the Rust binary directly:
cargo run --Typical local npm wrapper workflow:
npm run build:bin
node ./bin/codex-session-viewer.jsPackage Layout
The npm entry package is @afffun/codexsess. Public release packaging is split into:
- Root meta package:
@afffun/codexsess - Linux x64 binary package:
@afffun/codexsess-linux-x64 - macOS Intel binary package:
@afffun/codexsess-darwin-x64 - macOS Apple Silicon binary package:
@afffun/codexsess-darwin-arm64 - Windows x64 binary package:
@afffun/codexsess-win32-x64
The npm wrapper resolves the binary from:
CODEX_SESSION_VIEWER_BINARYdist/codex-session-viewer- an installed optional platform package such as
@afffun/codexsess-linux-x64 vendor/<platform>-<arch>/codex-session-viewertarget/release/codex-session-viewertarget/debug/codex-session-viewer
Release Packaging
The repository includes platform package manifests under npm/ and a release workflow under .github/workflows/release.yml.
Expected release order:
- Build and publish each platform package first.
- Publish the root
@afffun/codexsessmeta package after the platform packages are available.
Current platform matrix:
- Linux x64 via
x86_64-unknown-linux-musl - macOS x64 via
x86_64-apple-darwin - macOS arm64 via
aarch64-apple-darwin - Windows x64 via
x86_64-pc-windows-msvc
