What it is

/session-log writes the prompt and response text exposed by the current harness to a local Markdown transcript. It supports exactly five host identities: Claude Code, Codex, Cursor, OpenCode, and OMP.

The same five commands control every harness, but their reports are deliberately not identical. Each adapter uses only its native lifecycle and usage records: Cursor exposes per-turn token counts in hook payloads but not in transcripts, while Codex exposes token totals through native rollout records.

What you get

The five commands

Run /session-log with one of these. With no argument it defaults to status.

CommandWhat it doesTypical output
on Installs the current harness adapter and turns logging on. <label>: on or on — restart required; Codex uses on — trust review/restart required
off Turns logging off for the current harness. <label>: off
status default Repairs an enabled adapter if needed, then reports whether it is active. on / off / on — adapter missing / on — restart required; Codex uses on — trust review/restart required
usage Runs the current harness's native usage report. <label>: usage and a native report
repair Removes duplicate and stale session-log hook registrations for the current harness and restores the missing ones of a partial set: Claude Code settings.json hooks, Codex and Cursor hooks.json entries, and dangling OpenCode and OMP adapter links that point into the claude-goodies plugin cache. It registers no hooks where none exist; on runs the same repair first. <label>: removed … duplicate or stale hook registration(s) from <path>, <label>: restored … missing hook registration(s) in <path>, <label>: removed dangling adapter link <path>, <label>: repair skipped: <reason>, or <label>: repair found no duplicate or stale registrations

The exact labels are Claude Code, Codex, Cursor, OpenCode, and OMP. Without a target, usage reports the session you are working in: among the current project's top-level sessions it picks the one with the newest user prompt, so a parallel session that is still writing output is never chosen; OMP's /session-log command passes its own session directly. Pass a session ID, or a transcript path where that adapter accepts one, to report another session. OpenCode accepts only an ID or --latest. Claude Code alone accepts --check to compare with ccusage when installed.

Good to know

What a logged turn looks like

Scenario: one full turn — you submit a prompt, a background sub-agent finishes, the assistant answers, and you had switched model and effort since the previous turn. This is what lands in the session file (Claude Code, ~/.claude/prompt-logs/<project>/session_….md):

## 14:02:11

Implement the next uncompleted task in plans/FEAT-001.md

---

14:03:05 sub-agent finished: general-purpose (agent-9f3c2a1b), jsonl: /Users/…/<sid>/subagents/agent-9f3c2a1b.jsonl

### 14:05:53 response

<the assistant's final message, verbatim>

working time: 00:03:42
est. used token: input: 2000, output: 1000, cache_create: 150000, cache_read: 0, total_tokens: 153000, price: $2.32, model: claude-opus-5, effort: max
switched: model claude-sonnet-5 → claude-opus-5, effort high → max

---

Reading top to bottom: the prompt, then the sub-agent that ran, then the reply, then the measurements. total_tokens is input + output + cache-write + cache-read. The switched: line here explains the large cache_create: changing models forced a full cache write on this turn.

What a Claude Code usage report looks like

Command: /session-log usage in Claude Code (totals the current session — the project's session with the newest user prompt). Other harnesses keep their native report shapes described above.

Claude Code: usage

1. 14:02:11  Implement the next uncompleted task…   est. used token: … price: $2.32
2. 14:12:40  Fix the failing test in auth_test…      est. used token: … price: $0.41
   sub-agent general-purpose (agent-9f3c2a1b)         est. used token: … price: $0.77

TOTAL (2 requests, 1 sub-agent)  input: … output: … total_tokens: …  price: $3.50

One numbered line per turn, one line per sub-agent transcript found under the session, then a merged TOTAL. Every transcript is counted once, no matter how deeply sub-agents nest.

Related tools