What survives when the model window ends?
A long-running agent eventually fills its context window. When the model context resets, what survives? Below: the identical agent task hits the identical reset. One side has nothing on disk; the other ran remaind transfer start.
Live demo screens
Same reset. Two outcomes.
The finished state is shown first so the comparison is obvious. Press Replay to watch the reset unfold, or step through it manually.
- Goal
- Migrate billing from Stripe webhooks v1 → v2
- Decisions
- Keep v1 behind a feature flag for instant rollback
- Constraints
- Refund path off-limits — pending legal review
- Next step
- Wire v2 into the router
Without Remaind
The reset wipes the working state. The fresh agent re-asks what it was doing, re-opens a settled decision, and walks into a constraint the user had already set.
With Remaind
The reset happens the same way — but the goal, decisions, constraints, evidence, and next step were on disk. The handoff packet loads them into the fresh context.
Illustrative — a scripted comparison of one agent task across a context reset. Remaind does not run your agent and does not prevent the reset; it is the durable .context/ your agent resumes from.
Try it locally
Run the proof path in your terminal.
This is the shortest copy-paste path from page claim to local proof: install the current PyPI package, confirm the offline plan boundary, initialize local memory, check readiness, run the finance handoff fixture, then run the continuity proof suite. If you have a local or private OpenAI-compatible model, the optional last command checks whether the model can continue from the Remaind packet and cite source evidence.
python3 -m pip install --upgrade remaind
remaind plan
remaind init
remaind doctor
remaind demo finance-handoff \
--force
remaind proof
# Optional local-model proof:
REMAIND_OPENAI_BASE_URL="<your-openai-compatible-model-url>" \
REMAIND_OPENAI_MODEL="<your-model-id>" \
REMAIND_OPENAI_API_KEY="<optional-local-or-private-key>" \
REMAIND_OPENAI_API=auto \
remaind demo agent-continuity --forceThe finance handoff command is the exact local version of the scored proof below. Jump to the finance proof details.
What this proves
What it does not prove
model rejects input above its context limit
late facts survive, distant facts disappear
all tested facts and adversarial flags recover
What this demo actually proves
The memory is a local handoff layer, not a magic chat recorder.
The finance proof is intentionally strict, but the same machinery is what a software agent uses: append source-linked events, derive the current state, build a markdown packet, and inject that packet into a fresh model context.
Transfers are explicit
Remaind does not scrape arbitrary chats in the background. Use remaind transfer start when one model hands off work, then transfer finish to preserve the receiver output.
The packet is markdown
The model-facing handoff packet is compact markdown. The source of truth stays structured: events.jsonl, state.json, artifacts, reviewed memories, and source hashes.
Code projects are first-class
For software work, Remaind records user instructions, file changes, command output, test results, decisions, blockers, and next steps. Large files can stay on disk while packets carry the relevant evidence.
Integration friction depends on hooks
If your agent has pre-run, post-run, tool, or message callbacks, wiring is small. If your agent is a closed chat box, use the receiver guide and paste the markdown packet yourself.
Packet format
The model sees markdown because markdown is easy for any model or agent shell to consume. The durable records behind it remain structured and source-linked.
# Remaind Handoff Packet
## Current goal
Migrate billing from Stripe webhooks v1 to v2.
## Decisions
- Keep the v1 handler behind a feature flag for rollback.
## Constraints
- Do not touch the refund path until legal review completes.
## Recent evidence
- file_change: webhooks/v2.py mapped all 6 event types
- tool_result: test suite passed
## Next step
Wire v2 into the router.Software project state
The simulator uses a code migration on purpose. These are the code-work signals Remaind carries through reset:
Integration effort
Remaind-aware means your loop gives Remaind the moments worth preserving, then places the packet when a fresh context starts.
# One model hands work to another:
remaind transfer start \
--from-model "source model" \
--to-model "receiving model" \
--target codex \
--from-file source-output.md
# The receiving model hands its result back to Remaind:
remaind transfer finish \
--from-model "receiving model" \
--from-file receiver-output.mdReal local-model proof
Source model to receiving model is a tested handoff path.
The simulator above is illustrative. This proof is executable: it builds a Remaind packet from local software-agent state, sends that packet to a configured local or private model, and checks whether the receiving model recovered the right continuation.
export REMAIND_OPENAI_BASE_URL="<your-openai-compatible-model-url>"
export REMAIND_OPENAI_MODEL="<your-model-id>"
export REMAIND_OPENAI_API_KEY="<optional-local-or-private-key>"
export REMAIND_OPENAI_API=auto
remaind demo agent-continuity --forceWhat passed in the saved run
The saved proof pattern records a real local/private model run. It is separate from the golden proof because this one measures model honor behavior.
# Agent Continuity Local-Model Demo
- Status: PASS
- Model: configured local/private OpenAI-compatible model
| Check | Status |
|---|---|
| local model action | PASS |
| next step recovered | PASS |
| decision retained | PASS |
| constraint retained | PASS |
| blocker retained | PASS |
| source evidence cited | PASS |The handoff loop
The same continuity layer, tested where a wrong handoff is costly.
Remaind captures reviewed exceptions into the local ledger, rebuilds scoped packets from persisted memory, fails closed on ambiguity, and escalates conflicts before a model acts.
remaind demo finance-handoff \
--forceThe demo writes a local artifact pack. The stable output line to look for is the generated customer-validation walkthrough.
- Customer validation walkthrough: .../finance_handoff_artifacts/customer-validation-walkthrough.md
- Packet Recall: 5/5 (100.0%)
- False Application Rate: 0/5 (0.0%)
- Honor Rate: 5/5 (100.0%)