Skip to content

Sessions & memory

Every conversation is durable. Each REPL turn snapshots the full conversation to ~/.hipmmcode/sessions/<id>.json, including the active model, agent persona, and legion — so resuming restores the whole working context.

Resume

bash
hipmmcode resume                 # list recent sessions (current project)
hipmmcode resume sess_abc123     # restore by id (or any unique suffix)
hipmmcode resume daimao          # restore by the name you gave it with /rename
hipmmcode -c                     # continue the most recent session
hipmmcode resume --all           # list across every project

Inside the REPL:

/sessions                  # list
/resume sess_abc123        # hot-swap the current chat into a saved session
/resume daimao fork        # resume as a NEW branched session
/rename refactor-sprint    # give the session a memorable name
/branch                    # fork right here and keep going in the copy
/fork <prompt>             # run a prompt on a background copy of the conversation

v0.11.0+: /resume now restores the exact context gauge instead of showing 0% until the next turn. The last turn's real prompt-token count is persisted and restored on both --resume (launch) and in-session /resume, so the bottom bar shows the same percentage it had before the session closed.

Bare /resume opens the session picker — id, name (from /rename), age, and turn count per row:

hipmmcode
 /resume

Sessions  this project · newest first
 refactor-sprint  sess_9f2c… · 12 turns · 5m ago · deepseek-anthropic/deepseek-v4-flash
  daimao           sess_a3b1… · 41 turns · 2h ago · anthropic/claude-opus-4-8
  (unnamed)        sess_77e0… · 3 turns · yesterday

Enter resume · f fork · Esc cancel

Fork & rewind

  • --fork-session (CLI) / fork (REPL) — branch into a new session id with copied history, leaving the original untouched.
  • /rewind [n] — drop the last N user turns; choose to restore the conversation, the code, or both.
  • --resume-session-at <n> — resume a session rewound to just after its Nth user turn.

Context management

Long sessions hit model context limits. hipmmcode manages this on several levels:

  • Context HUD — the status bar shows live pressure per turn: [████░░░░░░] 42% 85k/200k, aware of each model's real window.
  • /compact [focus] — summarizes history into a structured brief and replaces the log with a single compacted turn. Trades ~150K tokens for ~5K. Pass a focus (/compact the auth refactor) to bias the summary.
  • Auto-compaction (autoCompactEnabled, default on) — compacts automatically when approaching the ceiling; autoCompactWindow forces it earlier.
  • Micro-compaction (apiMicrocompactEnabled, default on) — silently evicts stale tool-result payloads first, which is much cheaper than a full compact.
  • /context — token breakdown by category; /tokens for totals; /cost for estimated spend.

Persistent memory

hipmmcode keeps a file-based memory per project under ~/.hipmmcode/projects/<key>/memory/:

  • MEMORY.md — the index, loaded into context each session.
  • One markdown file per fact, with frontmatter (name, description, type: user|feedback|project|reference).

How memories get written:

TriggerConfig
/remember — extract from the recent conversation now
On /exit / Ctrl+DautoMemoryOnExit (default on)
At the end of headless exec runsautoMemoryOnExec (default off) or --auto-memory
After every turnautoMemoryOnEveryTurn (default off; token-hungry)

Reading: relevant memories are injected at session start. memoryRelevanceSelector=true uses a cheap model to pick the ≤5 most relevant files instead of the token-overlap heuristic. Manage files with /memory list and /memory <name> (opens your editor). Master switches: autoMemoryEnabled=false or HIPMMCODE_DISABLE_AUTO_MEMORY=1.

The model can also save memories itself mid-conversation via the SaveMemory tool.

Compatible memory layout

Project memory is also read from ~/.claude/projects/<key>/memory/ when present, so an existing memory tree keeps working.

Project instructions

At session start hipmmcode loads project instructions from the workspace: HIPMMCODE.md, AGENTS.md, CLAUDE.md (and .claude/CLAUDE.md, CLAUDE.local.md), plus rule fragments under .hipmmcode/rules/ / .claude/rules/. /init generates or improves the instructions file by scanning the project. Exclude patterns via instructionExcludes.

Transcripts & export

  • Ctrl+O / /transcript — fullscreen transcript view.
  • /export [file] — write the conversation to Markdown.
  • /copy [n|all] — copy the last (or Nth, or all) assistant message to the clipboard.
  • /history — print the raw message log.
  • /recap — one-line session summary; an automatic "welcome back" recap appears after ≥5 min idle (awayRecap).

Cost tracking

bash
hipmmcode cost           # aggregate usage across saved sessions (this project)
hipmmcode cost --all     # across all projects
hipmmcode cost --json    # machine-readable

In-session, /cost gives live token + $ estimates.