Skip to content

Sessions

A session is the unit of conversation in Lime. Each session captures the full role/tool fidelity of every turn — text, tool_use (with arguments), and tool_result (with is_error) — so a resumed session is byte-identical to the original.

Where sessions live

ScopePath
Project.lime/sessions/
Global~/.lime/sessions/

Sessions are written as JSONL. Files rotate at 256 KB, retaining up to 3 rotated copies per session. Old rotations are pruned automatically.

Resuming

Terminal window
lime --continue # most recent session
lime --resume latest # likewise
lime --resume <session-id> # by id (8-char prefix is enough)
lime --resume path/to/file.jsonl # by path

Inside the REPL:

/resume latest
/resume <session-id>

Resume rebuilds the in-memory conversation from the JSONL log, including tool calls, tool results, reasoning items, and any provider-specific state (such as OpenAI’s encrypted reasoning items, which are persisted and echoed back).

Forking

Forking is not exposed as a slash command. It is available programmatically through the bridge protocol (session.fork), so the VS Code extension and the Web companion (PWA) can offer a one-click fork.

Inside the REPL the relevant primitives are:

/new Start a new managed session
/clear Reset the current local REPL session

Auto-compaction

Long sessions hit the active model’s context window eventually. Lime tracks input-token usage and triggers compaction proactively:

  • Auto-compaction is scheduled at the model’s auto_compact_threshold from the catalog.
  • Microcompaction prunes the least-load-bearing turns continuously to keep memory pressure low.
  • Time-based microcompaction runs after a long idle gap (default 60 minutes; tune with LIME_TIME_BASED_MICROCOMPACT_MIN, set 0 to disable).
  • In-flight compaction runs concurrently with the streaming turn so a compaction event doesn’t block the user.

You can also compact manually:

/compact Roll the local history into a summary
/rename <title> Rename the current session

The global override LIME_CODE_AUTO_COMPACT_INPUT_TOKENS forces a specific token threshold across all models — primarily a knob for testing the compaction path.

Bash mode persistence

!-shell exchanges in the REPL are stored as <bash-input> / <bash-stdout> triples in the JSONL log so resume reconstructs them exactly. The transcript builder folds the triple back into a single LocalShell row when shown to the model, so the model sees a clean shell exchange even though the wire log is more granular.

Inspecting a session

/status Session, model, token, workspace, and provider status
/memory Loaded instruction & memory files for this session
/logs Open the current session's JSONL log file

Cleanup

There is no destructive delete-session slash command. Remove ~/.lime/sessions/<id>.jsonl* (and the project equivalent) by hand if you need to purge a session.