Skip to main content
Step Code saves sessions automatically and supports restoring, navigating branches, forking, and exporting. Compact context as it approaches the model’s window to retain important information and continue working.

Starting and restoring sessions

The Ultracode switch persists per session: restoring the same session restores its previous state, and a new session without saved state defaults to off. Check it with /ultracode status.

Switching sessions in the TUI

Type to search in the session picker. Ctrl+S changes sorting, Ctrl+N filters named sessions, Ctrl+R renames, and Ctrl+D deletes. Confirm that you no longer need a record before deleting it. See Interaction and task control for input controls and permission modes.

Session trees and forks

In /tree, navigate with arrow keys, select with Enter, cycle filters with Ctrl+O, and edit labels with Shift+L. Filters include default, no tools, user messages only, and labeled only. Selecting a user message can restore its text to the input box; edit and resend to form a branch. When switching branches, you can generate a summary of the branch you are leaving. Configure this under [branchSummary].
Session branches separate conversation records. They do not undo disk changes or create Git branches. Use Git branches or worktrees to isolate code experiments. Summaries and subsequent model calls may still consume tokens.
See Common use cases for project task examples.

Manage context

From v0.1.4, when automatic compaction is enabled and no context mode is specified, CLM (Context Language Models) is used by default. The model selectively trims earlier working context without overwriting the original session log. When trimming fails or is insufficient, Step Code falls back to summary compaction. Model usage is included in session statistics. /clm reset does not undo summary compaction that already happened. Organization adds model calls, counted in session statistics.

Context compaction

Summary compaction retains recent messages and summarizes earlier content. For manual compaction, specify what should be preserved:
For automatic summary compaction, reserved context, and retained recent messages, see Configuration files. Keep important agreements and acceptance results in project files as well.

Exporting and sharing

You can also export from the command line:
/export [file] defaults to HTML; a .jsonl extension exports JSONL. Exports can contain code, command output, and paths; review them before sharing.

Import a session

Import a saved JSONL session from the interactive interface:
Replace the filename with your session file. HTML exports are for reading; session restoration uses JSONL.

Search sessions

Web and desktop clients search session content through a SQLite full-text index. JSONL remains the only data source and the index can be rebuilt at any time. Subagent sessions are excluded from search. Use step session-index status, step session-index reindex, and step session-index clear to inspect, rebuild, or clear the index.

Session storage

Sessions are grouped by working directory. Use /session to find the current file. --session-dir selects a directory; --no-session disables saving for that session. See Data paths for storage and cleanup.