Maxxing Code
Documentation · SessionsGetting startedModels and providersInstruction filesPermissionsToolsSessionsSkills, commands, sub-agentsMCPScriptingACPConfigurationArchitectureDesign decisions

Sessions

Every conversation is saved as it happens, in one file: ~/.maxxing-code/sessions/<folder>/<id>.jsonl. Plain JSON lines: readable, greppable, repairable.

maxxing-code -c            # continue the last session of this folder
maxxing-code -r 2f9a       # resume by id (a part of it is enough)
maxxing-code sessions      # list the sessions of this folder

In the terminal: /resume (a list that narrows as you type) and /new.

A tree, not a list

Each line has an id and a parentId. The conversation is the path from the current entry up to the first one. Nothing is ever rewritten:

  • /fork moves back before an earlier message of yours and puts its text in the editor. Change it, send it: the conversation continues on a new branch. The old branch stays in the file.
  • /undo restores every file the last turn changed (created files are removed) and moves the conversation back before that turn. Run it again to undo the turn before. File contents are kept under ~/.maxxing-code/checkpoints/<session>/. Only changes made through write and edit are tracked: what a shell command did is not undone.

Interruptions and crashes

Esc stops the turn cleanly: the running command is stopped, calls that did not start are marked as not run, what the model had said is kept. Messages you had queued return to the editor.

If the process dies between a tool call and its result (crash, power cut), the session is repaired when it is opened again: the missing result is recorded as "interrupted, effects unknown" so the model checks before assuming.

Passing errors of the provider (rate limits, overload, network) are retried three times with a growing delay.

Compaction

When the conversation nears the model's context window, its older part is replaced by a summary, and work goes on.

  • At about 60% of the window, a summary of the older part starts being written in the background, next to the work in progress.
  • At about 85%, it is applied: the summary takes the place of the older messages; the recent ones (about 20,000 tokens) are kept as they are. A tool call is never separated from its result.
  • If the provider refuses a call because the context is too long, a compaction runs at once and the call is retried.
  • /compact does it on demand; /compact keep the database decisions steers what the summary retains.

The summary is one more entry in the session file: the original messages remain there, and /context shows what is in the window.

Export

/export notes.md or maxxing-code export <id> [file]: the conversation, the tool calls and the cost, as a document.

File format

{"type":"session","version":1,"id":"20260114-ab12cd34ef56","cwd":"/work/shop","createdAt":1768400000000}
{"id":"a1","parentId":null,"ts":1768400001000,"type":"message","message":{"role":"user","content":[{"type":"text","text":"fix the tests"}]}}
{"id":"a2","parentId":"a1","ts":1768400004000,"type":"message","message":{"role":"assistant","content":[{"type":"tool_call","id":"c1","name":"bash","input":{"command":"npm test"}}]},"usage":{"input":812,"output":36,"cacheRead":0,"cacheWrite":0,"reasoning":0},"cost":0.0031,"model":"anthropic/claude-sonnet-4-5"}
{"id":"a3","parentId":"a2","ts":1768400009000,"type":"message","message":{"role":"tool","content":[{"type":"tool_result","id":"c1","name":"bash","output":"…"}]}}
{"id":"a9","parentId":"a8","ts":1768400300000,"type":"compaction","summary":"…","firstKeptId":"a7","tokensBefore":181000}
{"id":"b1","parentId":"a9","ts":1768400400000,"type":"leaf","target":"a1"}

Entry types: message, compaction (the summary and the first entry still kept), leaf (the conversation continues from target: fork, undo), meta (title, model, task list, sub-agent costs).

Edit this page on GitHub