ClaudeMod
ModsContext & MemoryUI Only

TrailBack

A Claude Code mod that draws your conversation's context stack as a live tree, so a session that wanders into side questions always shows the way back.

Install
$claude plugin marketplace add captPython/trailback
$claude plugin install trailback@trailback
Run claude plugin validate to auditGuide →
Access & PermissionsUI Only

Draws UI elements or stores local mod state only. No filesystem, shell, or network access detected.

Draws UI

Statically scanned from hooks & source. Learn how to audit

cp007Added 1 months ago

TrailBack logo: black footprints on white

TrailBack

A Claude Code mod that draws your conversation's context stack as a live tree, so a session that wanders into side questions always shows the way back.

image

Claude keeps the stack up to date itself, through a stack tool the mod gives it: a new step or a nested question is pushed, a resolved one is popped and focus returns to its parent.

Install

In a Claude Code terminal session:

/plugin install trailback --marketplace captPython/trailback

Answer y to add the marketplace, then pick a scope (user scope loads it in every session). Then open the pane:

/trail

The pane is placed beside the conversation; on a narrow terminal it waits until there is room.

States

MarkStateColourMeaning
⠋⠙⠹…Activegreen, spins; badge blinksWhat Claude is working on now
◐SuspendedorangeWaiting for its children to finish, or paused by you (PAUSED)
◌○◎●Follow-upblue, pulsesClaude handed you a step and waits for your answer
✕Blockedred, blinksWaiting on a permission, a decision or an error
○PendinggreyPlanned, not started
✓Donedim, struck throughResolved

The tree's guide lines take a colour per depth, and the path down to the active entry is drawn in green. Colours come from your Claude Code theme, so they follow light and dark themes.

Pick what to work on next

Every open entry has a › in the left margin. Press it (click it, or focus the pane with ctrl+x tab and press Enter on it) and it turns into ➜, with its buttons on the right, while the current entry shows → PAUSE. Press it again to cancel.

Then either:

  • press [ Go ➜ ] on that row (or g): the picked entry becomes active, the old one is paused (orange, PAUSED) rather than dropped, and TrailBack sends a prompt asking Claude to catch you up in 1 to 3 lines and list the action items you still owe on it before carrying on; or
  • press [ ✓ Done ] (or d) to close it yourself, with any open entries under it; the button counts them (✓ Done +2). The focus stays where it is, and Claude is told on your next prompt. The active entry and the entries above it have no Done button: those finish in the conversation; or
  • just type your next prompt: the same switch as Go happens before Claude reads it, and Claude is told.

Arjun Mode: one step at a time

TrailBack ships with Arjun Mode, a working style for long technical sessions:

  • one actionable step per reply, then wait for you
  • nested questions handled last-in, first-out, with the active level named in each reply
  • targeted questions instead of guesses when something is ambiguous
  • a backup or dry run, a one-line impact and your confirmation before anything destructive
  • a short Verification & Confidence block at the end of every reply, rating unverified claims no higher than Medium

TrailBack adds these rules to Claude's instructions only while Arjun Mode is on. It does not read or change your own settings, hooks or memory files.

Arjun Mode is on when you install. At the top of the pane the Arjun Mode badge is green while it is on and red while it is off; the ● before it switches it at any time, from the next reply on (so does /trail arjun on|off). ⓘ says which mode is on and what it does. Off, Claude answers each request in full in one go; the tree keeps working either way. Your choice is remembered across sessions.

Usage and quota

The second line shows your 5-hour and weekly windows as bars and how full the context window is, the same figures as Claude Code's status line. Each turns amber from 50% and red from 80%; a toast warns once when a window passes 90%. A rule as wide as the pane separates the header from the tree. The windows appear on a Claude subscription once the first reply has reported them.

The active entry shows the turns spent on it and their output tokens, its children included. /trail usage on shows that on every row.

Legend and keys

help at the bottom right (or h) shows the marks and the pane's keys; press it again to hide them.

Archive finished work

Pick a row (›) and press Archive (or z) to take it out of the tree together with everything under it; the button counts what goes with it (Archive +3). Done rows can be picked for this too. If any of it was still open, Claude is told on your next prompt that you set it aside. The active entry and the entries above it cannot be archived.

archive N done at the bottom right (or x) archives every branch that is finished all the way down in one go.

Archived entries are kept per chat: /trail archive lists them and /trail unarchive <id> brings one back with everything that went with it.

Archiving keeps the pane short and the tree Claude reads small. The reply Claude gets after each update also folds every finished branch into one line (✓ 1.3 … (+4 done)) and ends with a count, so finished work stops costing tokens on every call even before you archive it.

Across sessions

Each chat keeps its own trail, saved under the chat's session id. Resuming a chat (claude --resume) brings its trail back; a new chat, or /clear, starts an empty one. Chats never share a trail, even when they run in the same folder, and a cd during a chat does not move or copy it. The trails of the 50 most recently used chats are kept. /trail reset clears the current chat's trail.

Trails saved before 1.1.1 were kept per folder, so chats in one folder (or a chat that cd-ed into another) could mix. They are set aside once, under legacy-stack in the plugin's store, and not loaded.

Commands

CommandDoes
/trailOpen the pane
/trail arjun on / offSwitch Arjun without the pane
/trail usage on / offTurns and output tokens on every row, or on the active one only
/trail color rich / calmDepth colours and badges, or a quieter look
/trail motion on / offSpinners and blinking, or still marks
/trail archiveList what was archived in this chat
/trail unarchive <id>Bring an archived entry back, with everything archived under it
/trail resetClear the stack for this chat
/trail closeClose the pane

How it works, and its limits

The mod adds two short sections to Claude's system prompt: how to keep the stack, and either the Arjun rules or a note to answer in one go. Claude updates the tree by calling the stack tool, which answers with the tree as text, so Claude and the pane read the same state.

The tree is only as current as those calls. When a turn ends with the stack untouched, TrailBack shows a toast and reminds Claude at the start of your next prompt. Each update is a small tool call, which adds a little time and a few tokens to a turn.

Development

claude plugin validate .
claude plugin test .

To run a working copy instead of the installed one, start Claude Code with claude --plugin-dir <this folder>.

License

MIT

Details

Sub-category
Context & Memory
License
MIT
Surfaces
terminal
Added
1 months ago
Last synced
3 days ago

Weekly Mods Digest

Top new Claude Code mods and install commands, once a week. No fluff, unsubscribe anytime.

More Mods

Claude Flightdeck
ModsSecurity

Claude Flightdeck

Live agent dashboard pane with context consumption, advisor timeline, permission verdicts, and subagent swimlanes.

Reads Files
by Sam Casella
GitHub
Terminal Browser
ModsInterface

Terminal Browser

Browse documentation, GitHub pull requests, and web pages in a split terminal pane directly beside your Claude Code conversation.

Network
by Zenbu Labs
GitHub
Agent Flow
ModsAutomation

Agent Flow

Interactive visual tree of the active session's subagents, background tasks, and teammates beside the transcript via /flow.

UI Only
by Charlie
GitHub

Command Palette

Search for a command to run...