MusePi

/tree Command Reference

English | 中文 /tree opens the interactive Session Tree navigator. It lets you jump to any entry in the current session file and continue from that point.

This is an in-file leaf move, not a new session export.

What /tree does

Primary implementation:

How to open it

Any of the following opens the same selector:

Tree UI model

The tree is rendered from session entry parent pointers (id / parentId).

Example tree view (active path marked with •):

├─ user: "Start task"
│  └─ assistant: "Plan"
│     ├─ • user: "Try approach A"
│     │  └─ • assistant: "A result"
│     │     └─ • [milestone] user: "Continue A"
│     └─ user: "Try approach B"
│        └─ assistant: "B result"

The selector recenters around current selection and shows up to:

Keybindings inside tree selector

Filters and search semantics

Filter modes (TreeList):

  1. default
  2. no-tools
  3. user-only
  4. labeled-only
  5. all

default

Shows conversational nodes plus any entry types not explicitly suppressed. It hides these setting/bookkeeping entry types:

Other internal entry types that are not rendered specially may appear as blank rows in current code.

no-tools

Same as default, plus hides toolResult messages.

user-only

Only message entries where role is user.

labeled-only

Only entries that currently resolve to a label.

all

Everything in the session tree, including bookkeeping/custom entries.

Tool-only assistant node behavior

Assistant messages that contain only tool calls (no text) are hidden by default in all filtered views unless:

Search behavior

Selection outcomes (important)

navigateTree computes new leaf behavior from selected entry type:

Selecting user message

Selecting custom_message

Selecting non-user node (assistant/tool/summary/compaction/custom bookkeeping/etc.)

Selecting current leaf

Selection decision (simplified):

selected node
   │
   ├─ is current leaf? ── yes ──> close selector (no-op)
   │
   ├─ is user/custom_message? ── yes ──> leaf := parentId (or resetLeaf for root)
   │                                     + prefill editor text
   │
   └─ otherwise ──> leaf := selected node id
                    + no editor prefill

Summary-on-switch flow

Summary prompt is controlled by branchSummary.enabled (default: false).

When enabled, after picking a node the UI asks:

Flow details:

navigateTree internals:

Note: if user requests summary but there is nothing to summarize, navigation proceeds without creating a summary entry.

Labels

Label edits in tree UI call appendLabelChange(targetId, label).

/tree vs adjacent operations

Operation Scope Result
/tree Current session file Moves leaf to selected point (same file)
/branch Usually current session file -> new session file By default branches from selected user message into a new session file; if doubleEscapeAction = "tree", /branch opens tree navigation UI instead
/fork Whole current session Duplicates session into a new persisted session file
/resume Session list Switches to another session file

Key distinction: /tree is a navigation/repositioning tool inside one session file. /branch, /fork, and /resume all change session-file context.

Operator workflows

Re-run from an earlier user prompt without losing current branch

  1. /tree
  2. search/select earlier user message
  3. choose No summary (or summarize if needed)
  4. edit prefilled text in editor
  5. submit

Effect: new branch grows from selected point within same session file.

Leave current branch with context breadcrumb

  1. enable branchSummary.enabled
  2. /tree and select target node
  3. choose Summarize (or custom prompt)

Effect: a branch_summary entry is appended at the target position before continuing.

Investigate hidden bookkeeping entries

  1. /tree
  2. press Alt+A (all)
  3. search for model, thinking, custom, or labels

Effect: inspect full internal timeline, not just conversational nodes.

Bookmark pivot points for later jumps

  1. /tree
  2. move to entry
  3. Shift+L and set label
  4. later use Alt+L (labeled-only) to jump quickly

Effect: fast navigation among durable branch landmarks.