Coding Session Tracker (CST)
A session tracker for Claude Code and Codex CLI with an interactive TUI for
browsing and resuming sessions from either agent.
Features
- Multi-agent session tracking via Claude Code and Codex lifecycle hooks
(
SessionStart, UserPromptSubmit, and SessionEnd)
- Prompt history - stores the last 10 user prompts per session for context
- Interactive TUI with search, preview pane, and keyboard navigation
- Client attachment detection - distinguishes attached sessions from
idle, resumable threads
- Cross-platform - pure Go binary, no CGO required
- Concurrent-safe - SQLite WAL mode handles simultaneous sessions from multiple agents
- Wezterm layout snapshot + restore (optional) - captures windows, tabs,
CWDs, and linked agent sessions; restores them with
claude --resume <id> or
codex resume <id>. See Wezterm Integration.
Installation
1. Install the binary
From releases:
# Linux (amd64)
curl -L https://github.com/imyousuf/claude-session-tracker/releases/download/dev/cst-linux-amd64.tar.gz | tar xz
mv cst ~/.local/bin/
# macOS (Apple Silicon)
curl -L https://github.com/imyousuf/claude-session-tracker/releases/download/dev/cst-darwin-arm64.tar.gz | tar xz
mv cst ~/.local/bin/
From source:
git clone https://github.com/imyousuf/claude-session-tracker.git
cd claude-session-tracker
make install # installs to $GOPATH/bin
2. Enable lifecycle hooks
For Claude Code, enable the plugin:
Clone the repo (if not done already) and enable it in Claude Code:
git clone https://github.com/imyousuf/claude-session-tracker.git ~/projects/claude-session-tracker
Then in Claude Code, use /plugin to add and enable session-tracker.
For Codex CLI, merge CST's hooks into your user configuration:
cst setup-codex
Start Codex, run /hooks, and review and trust the three CST command hooks.
Codex requires explicit trust before non-managed hooks run. The installer
preserves any existing hooks in $CODEX_HOME/hooks.json (normally
~/.codex/hooks.json). See the official Codex Hooks guide.
Usage
TUI Launcher
cst # Sessions for current project
cst --all # All sessions across all projects
cst --project /path/to/proj # Sessions for a specific project
Key bindings:
| Key | Action |
|---|
j/k or ↑/↓ | Navigate sessions |
Enter | Resume selected session |
Tab | Toggle current project / all projects |
/ | Search/filter sessions |
d | Delete session entry |
q / Esc | Quit |
Non-Interactive List
cst list # Table output
cst list --all --json # JSON output for scripting
Maintenance
cst cleanup # Remove inactive sessions older than 30 days
cst cleanup --days 7 # Custom age threshold
cst version # Show version info
How It Works
CST uses the lifecycle hooks from Claude Code and Codex CLI together with the
shell integration:
- SessionStart - Records the session and marks its CLI client as attached
- UserPromptSubmit - Captures the user's prompt (skipping slash commands) and updates activity timestamp
- Shell precmd - Runs as soon as the foreground CLI exits, marks the client
detached, and makes the session resumable in CST
- SessionEnd - Records the separate provider lifecycle end without deleting
the resumable session
For Codex these last two moments are intentionally different. Switching away
or detaching a connected client can leave the thread open, and SessionEnd may
not run until the thread has no connected client for 30 minutes. CST uses
the shell exit for the immediate attached/idle status and stores the later
lifecycle event separately. See the official Codex Hooks guide.
Session data is stored in ~/.cst/sessions.db with a provider field. The TUI
and cst list combine all providers and order them by most recent activity.
When launching the TUI, CST validates the interactive CLI process for both
providers. Because Codex hooks run under a long-lived app-server, CST resolves
the actual terminal-backed Codex frontend and its wezterm pane instead of
trusting the hook process environment.
Architecture