Remaind is a local-first context ledger, compaction pipeline, and resume substrate. A future agent starts with a clean model context, loads the local .context/ directory, understands what happened before, and continues — without asking the user to reconstruct the work.
pip install remaind # PyPI release pending — for now: git clone + pip install -e .Not on PyPI yet — get an email the moment it lands.
Naive summarization loses important details. Stale summaries override newer instructions. Fresh runs restart work incorrectly. Remaind separates immutable raw truth from derived state, with mechanical gates at every boundary.
Every user message, tool call, decision, and file change lands in a JSONL log validated against a JSON Schema before write. The raw log is the source of truth — never rewritten, never lossy.
Nine secret patterns (OpenAI, Anthropic, JWT, AWS, private keys, bearer tokens, …) replaced with deterministic hashes before the event ever touches disk. Same secret → same hash, no leakage.
Compaction proposes; a six-check structured validator decides. Any required boolean false → reject and keep the prior handover. No stale summary can override newer user intent.
Resume is internal and seamless until raw log, state, and handover conflict — or the next planned tool has mutates / spends_money / external_side_effect flagged in tools.yaml.
Every state and handover write atomically snapshots the prior version. `remaind rollback --to <timestamp>` restores derived files; events.jsonl stays untouched. Rollback is itself reversible.
Write target.tmp + fsync, rename over target, fsync parent dir. POSIX-correct, no partial writes, history captured on every replacement.
A single .context/ directory per project. Append-only raw log + derived working state + compact human-readable handover. When sources disagree, an explicit authority order resolves truth.
.context/
├── README.md
├── CONTRACT.md # the contract — read this first
├── active/
│ ├── state.json # derived working state (atomic replace)
│ ├── handover.md # compact continuity document
│ └── (resume_packet.md, history/ — runtime)
├── logs/
│ └── events.jsonl # append-only raw timeline
├── schemas/
│ ├── event.schema.json # JSON Schema Draft 2020-12
│ ├── state.schema.json
│ ├── memory.schema.json
│ ├── validation.schema.json
│ ├── thresholds.yaml # 40k/60k/70k/80k band math
│ ├── redaction.yaml # 9 default secret patterns
│ ├── tools.yaml # mechanical risk flags
│ └── migrations/{state,events}/
└── (db/context.sqlite, artifacts/ — runtime)From bootstrap to rollback. Every state-mutating command snapshots the prior version atomically, so the system is self-healing.
Bootstrap a .context/ in the current directory.
remaind initInspect what's there.
remaind validate
remaind statusWhen the token band climbs, run a validated compaction.
remaind compactBuild a resume packet for a fresh agent run.
remaind resume --next-tool deploy_prodRoll back if something went wrong.
remaind rollback --to 2026-05-14T03:54:33ZPython 3.11+. No services to run, no cloud to provision. Everything lives in .context/.
Get the launch email: