Reference·Sessions and undoIndex

Sessions and undo

Session ids, resume, rename, export, fork, the session tree, undo, crash recovery and throwaway stores.

.mdllms.txt

A session is one conversation in the store, ~/.nodecode/history.db.

Session ids

IdSession
s- and up to 8 letters or digitsA session the shell opened. Example: s-K3F9Q2ZA.
s-GATEWAYThe boot session of the background gateway.

Cells name their own sessions. A session nobody typed in is never stored.

List and resume

DoHow
List sessions/sessions, /agents or Ctrl+S.
Leave a session runningPress Left on an empty composer. The picker opens.
SwitchSelect a row. Press Enter.
Rename in the pickerPress F2 on a row.
Fold or unfold forksLeft and Right.
Resume from the command linenodecode resume SESSION-ID
a shell
nodecode resume s-K3F9Q2ZA

The shell prints the resume line when it exits: To resume: nodecode resume SESSION-ID. resume needs a terminal.

Rename

CommandDoes
/renameShows the session's name.
/rename NAMENames the session. One line, 64 characters at most.
/rename defaultGives back the name the first prompt made.

A session has no name before its first prompt.

Export

/export [path] saves the session as Markdown. It works in the shell only.

ArgumentFile written
NoneA file named after the session, in the shell's folder.
A folderThat file name, inside the folder.
A file pathThat path.
In the fileLeft out
Prompts, answers, plans, one line per callReasoning, the output of calls

Clear

Where/clear or /new does
ShellOpens a fresh session in the shell's folder. The old session stays in /sessions.
Web page, chat room, evalMoves this session back to its start. /redo returns.

Fork

/fork opens a new session at the current head. The shell switches to it.

RuleDetail
HistoryThe fork reads the parent's turns up to the fork point. Nothing is copied.
Later parent changesA rewind in the parent does not change the fork.
FolderThe fork works in the parent's folder.

Tree

/tree shows the session as a tree of turns. Alias: /checkpoints. Esc twice within 0.5 seconds opens it too.

KeyAction
TypingSearch the rows.
RightShow the tool calls of a turn.
LeftHide them.
Enter on a turnOpens the options below.
Enter on a tool callMoves the head to that turn. Restores files to that call.
OptionResult
Continue from this turnThe head moves to the turn. Its answer is kept. New turns branch from it.
Rewind to before this messageThe head moves before the turn. The prompt returns to the composer.
Rewind to before this message + code changesThe same, and the files are restored. Offered when a snapshot exists.

The head row offers the rewinds only.

Undo and redo

CommandDoes
/undoRewinds the last turn.
/redoReturns to the branch the last rewind left.
Where/undo restores
ShellThe conversation and the files.
Web page, chat room, evalThe conversation only. Refused while a turn runs.

A rewind deletes nothing. It records a head move. The branch you left stays in /tree.

Workspace snapshots

Nodecode captures the session's folder at turn and tool boundaries. Undo restores files from these captures.

FactValue
RepositoryA bare git repository at <cwd>/.nodecode/workspace_snapshots.
ToolThe git command. Without git there is no capture. The turn still runs.
ScopeFiles under the session's folder. Writes elsewhere are not captured.
RestorePer file. A file changed by something else is left alone. Nodecode reports the conflict.
Your repository.nodecode/ can show in git status. Nodecode does not add it to .gitignore.
Off switch"workspace": { "captures": false } in the config. Applies at the next start.

After a crash

FactDetail
Open turnsEach interrupted turn resumes at the next boot.
Unanswered tool callsEach gets the result interrupted by process restart.
LimitA turn is resumed on up to 3 boots. Then it is marked failed.
CostA resumed turn calls the model again.
CancelEsc stops a resumed turn like any other.

Ephemeral

a shell
nodecode --ephemeral
FactDetail
StoreA new file: nodecode-ephemeral-<pid>.db in the temp folder (TMPDIR).
Still sharedConfig, layer, cells, memory and skills are the home's.
LayerThe layer is the set of definitions the agent wrote and kept. New ones still land in it.
ChannelsChannel bots do not start.
Refused withserve, resume and --store.

For a throwaway organism, a whole running Nodecode with its own home, run HOME=$(mktemp -d) nodecode.

Esc

    Loading the index…

    ↑↓ moveEnter openEsc close