Context & memory·terminal·MIT
cc-traj-seg
Phase cards of what the agent did and why, written by Haiku every six steps.

cc-traj-seg keeps a running outline of a long Claude Code session in a pane on the right: short phase cards, each with a title, a one-sentence summary and the decisions the agent made in that stretch, with the reason behind each one. A small model, Haiku by default, writes the cards every six steps, so you can read what the agent did and why instead of scrolling back through the transcript. It costs tokens: one short completion per look, billed to your session’s own account.
What it does
- Phase cards. One card per thing the agent did: a step range, a one-line title and a summary. Click the title to expand it. Below the summary, each decision is listed as the choice and, under it, the why.
- steps and btw. On an expanded card,
stepsopens the exact steps it covers in a second pane.btwasks a side question about that phase, answered by a separate model (Sonnet by default) that never enters the agent’s context; the thread stays on the card. The X dismisses a card. - Backfill. Rebuilds the phases over the whole conversation or the last 40 or 100 steps with the current model and interval, for sessions where you switched the plugin on late or want a cleaner pass with a stronger model.
- Settings frame. The on/off switch, the phase model, the interval, the window, the btw model, the tokens used this session and the four prompts the plugin sends, editable in a pane or through a file.

Install
Needs Claude Code 2.1.287 or later and an interactive terminal. The pane docks on the right in the fullscreen layout at 110 columns or more; narrower, it sits above the prompt.
claude plugin marketplace add lucastononro/cc-traj-seg
claude plugin install cc-traj-seg@cc-traj-seg
It is off by default and makes no model calls until you run /traj, which turns the looks on and opens the pane. /traj off stops them and closes the pane; the phases are kept. The switch persists across sessions. /traj help lists the rest of the commands.
How it works
The module hooks tool.call and turn.complete. After each, it reads the session transcript through the engine and flattens it into steps: a prompt you typed, an assistant message, or one tool call with the beginning of what it returned. Once six new steps have piled up (N, the default interval), it runs a look. For each six-step chunk it sends the model every phase written so far (title, summary, decisions) plus the last 40 steps as one-line entries, and asks for one of three answers: NEW opens a card, AMEND rewrites the current one, SKIP changes nothing. A single trigger handles at most eight chunks; whatever is left waits for the next tool call. The completion runs in the background, so the turn does not wait for it.
Model calls go through $.model.complete, the engine’s own completion call, with the session’s credentials: no separate API key and no network of its own. Replies are capped at 400 tokens per look, 500 in backfill and 600 for a btw answer. The prompt is bigger: the phases so far plus 40 steps of your transcript, including tool inputs and the start of tool results. The author gives no per-session figure and describes it as “deliberately cheap to run”. Because a plugin never sees the usage of its own completions, the settings frame shows an estimate counted from characters at about four per token, per model and per purpose (live looks, backfill, btw), next to the exact per-model numbers the API reports for the agent’s turns. /traj tokens prints the same lines. A backfill is capped at 80 calls: over a longer range the chunks grow to fit.
Settings (model, interval, window, btw model, prompts, on or off) live in the plugin’s store and persist across sessions. Phases and token counts are stored per session id, so claude --resume shows the session’s own. Cards are capped at 60. The only file it writes is ~/.claude/cc-traj-seg/prompts.md, and only when you press export to file.
To tune it, open the settings frame with /traj settings or the settings button in the pane. The model names and numbers are fields: click a value, type, Enter applies. look every accepts 1 to 500 steps, model sees 5 to 400, and a model is haiku, sonnet, opus or a full id; an out-of-range value is refused with a toast. The same from the keyboard: /traj every N, /traj window N, /traj model NAME, /traj btw model NAME. A smaller N means finer phases and more calls. The author suggests sonnet for a run you care about, or a whole-conversation backfill with sonnet at the end, and a larger window when a phase misreads something that happened a little earlier.

Limitations
- One chunk yields at most one phase, so the finest grain is one phase per N steps.
- The model sees only the last 40 steps plus its own earlier phases, so a phase can misread something further back.
- Docking needs the fullscreen layout and 110 columns. Otherwise the pane draws above the prompt.
- Nothing draws in
claude -p, the desktop app or mobile. - Version 0.3.2, from 17 September 2026, is still the current release. The author notes that the function hooks API can change between releases.
Similar Claude Mods
context-inspector
What fills the context window, what is waste and what compaction kept, with advice.
ContextSaver
Spots repeated waste in a session, prices it in context and time, fixes it in one click.
transcripted-live
The call you are recording in Transcripted, as Claude context, live notes and a wrap-up.
token-weather
Context window fill as a weather forecast above the prompt, with a chart of recent turns.
Popular Claude Mods
The whole directory →claude-latex
TeX math, TikZ diagrams and LaTeX blocks typeset in Claude's replies, in the desktop app.
claude-carbon
Estimated grams of CO2 for each answer and session, with a molecule and warming stripes.
context-bar
Your context window as one stacked bar above the prompt, a color per category.
claude-toons
Cartoons of Clawd under the spinner that change with what Claude is doing.






