#7896: docs: enforce immediate memory persistence in AGENTS.md
docs
stale
Cluster:
Memory Compaction Improvements
Updates AGENTS.md template to explicitly instruct agents to persist important context to disk immediately. This prevents memory loss upon session restarts/gateway resets, addressing a common user pain point where context is lost because it was only held in the context window.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the `docs/reference/templates/AGENTS.md` workspace template to explicitly instruct agents to persist important user context to disk immediately (e.g., updating `MEMORY.md` or `memory/YYYY-MM-DD.md`) rather than relying on the chat context window. This aligns the template’s “Write it down / no mental notes” guidance with the common failure mode of context loss after session restarts or gateway resets.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Single-line documentation-only change in the AGENTS template; no code paths or tooling behavior are modified, and the new instruction is consistent with existing memory guidance in the same file.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<details><summary><h4>Context used (3)</h4></summary>
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
- Context from `dashboard` - docs/reference/templates/AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=ef691cbd-a005-4c3e-998b-6fcd72f2d312))
</details>
<!-- /greptile_comment -->
Most Similar PRs
#11743: fix: remove redundant file reads from AGENTS.md template
by shogunsea · 2026-02-08
82.1%
#7196: docs: Agent continuity - the 'stranger problem' and lighter approach
by sincere-arjun · 2026-02-02
78.6%
#5876: docs(AGENTS): add absolute dates convention for memory files
by heybeaux · 2026-02-01
77.1%
#9829: Fix MCP transport reconnect and SSE header handling
by mabengda · 2026-02-05
77.0%
#8903: fix: improve compaction summary instructions to preserve active work
by joetomasone · 2026-02-04
76.7%
#11761: fix(gateway): expose memory/ directory files in agents.files RPC
by advaitpaliwal · 2026-02-08
76.2%
#14576: Fix/memory loss bugs
by ENCHIGO · 2026-02-12
75.5%
#22220: feat(bootstrap): cache session's bootstrap files so we don't invali...
by anisoptera · 2026-02-20
75.3%
#8919: Pr/memory flush improvements
by shortbus · 2026-02-04
74.4%
#19560: docs: refactor agent workspace default location & bootstrap configu...
by ashinkuniyil · 2026-02-17
74.2%