Memory & Sessions
How hara remembers across runs — durable memory, resumable sessions, file checkpoints, and rewind.
Durable memory
hara keeps a memory that is always loaded and cwd-independent — global facts in
~/.hara/memory/ plus per-project facts in .hara/memory/. It's the same brain whether you drive
hara from the terminal or a chat app.
hara memory show # the digest injected at session start
hara memory init # scaffold the memory dirs + seed files
hara memory distill # promote recent daily logs → durable MEMORYAs you work, hara records decisions to short-term daily logs; distill consolidates them into
durable MEMORY.md. How eagerly it saves is the evolve setting (proactive · light · off).
A top-level USER.md holds global preferences that apply everywhere.
Sessions
Every conversation is saved and resumable.
hara sessions # list saved sessions
hara -c # resume the most recent session here
hara --resume <id> # resume a specific one
hara export <id> --out session.md # render a session to MarkdownThe gateway uses the same machinery: each (chat, directory) pair gets its own resumable thread.
Recovering an unavailable connection in a Serve client
An authenticated hara serve client can feature-detect sessions.readonly-history.v1 and call
session.history to display a saved transcript without initializing its provider. The response is
explicitly read-only. This means a revoked organization connection or a model removed from its allowlist
does not hide history stored on the user's machine; session.resume still rejects new work on that
unavailable route.
To continue elsewhere, feature-detect sessions.cross-profile-fork.v1 and call session.fork with the
source sessionId, an exact targetProfileId and targetModel, and transferHistory: true after the
user consents. Hara checks that the target model is authorized and that any native-image history remains
compatible, then creates a separate writable conversation. The source is unchanged, and the target
provider receives no copied conversation content until the user explicitly sends the next message.
Checkpoints & rewind
hara snapshots your files before each turn into a shadow git store outside your repo
(~/.hara/checkpoints/), so you can always step back — your real git history stays clean.
| In the REPL | Does |
|---|---|
/undo | revert the last file change(s) this session |
/checkpoint · /checkpoint restore <n> | list / restore a file-state snapshot |
/rewind <n> | fork the conversation back to an earlier turn (files untouched) |
Disable snapshots with fileCheckpoints false if you prefer.
Auto-compaction
Long sessions don't fall over: when the context window approaches full, hara summarizes the
conversation so far and keeps going (the same thing /compact does on demand). Turn it off with
autoCompact false or HARA_AUTO_COMPACT=0.
The summary is an eight-section structured brief — goal, key technical concepts, decisions, files & code, errors & fixes, current state, all your messages verbatim and in order (so however hard the history is squeezed, your intent never drifts), and the next step with a direct quote of your latest request.
Attention refresh
During long tasks the agent keeps its own focus: if its checklist has unfinished items and goes five
tool-rounds untouched, a silent system-reminder re-shows the authoritative list and asks for a
status pass — so multi-step work doesn't quietly abandon its plan. Reminders are visible to the model
only (never rendered in your transcript) and always carry an "ignore unless relevant" note.