#8900: fix: improve default memory flush prompts with urgency and specifics
stale
Cluster:
Memory Compaction Improvements
## Problem
The default memory flush prompts before compaction are too vague:
**Before:**
```
Pre-compaction memory flush. Store durable memories now
(use memory/YYYY-MM-DD.md; create memory/ if needed).
If nothing to store, reply with NO_REPLY.
```
This doesn't:
- Communicate urgency
- Specify what to capture
- Explain what will be lost
- Motivate the model to actually do it
## Solution
New prompts with:
- Visual urgency indicators (⚠️, 🚨)
- Specific checklist of what to capture
- Clear explanation of consequences
- Warning that summarizer won't preserve active work
**After:**
```
⚠️ COMPACTION IMMINENT - Save your work NOW.
Write to memory/YYYY-MM-DD.md (create memory/ if needed):
1. ACTIVE TASKS: What are you currently working on? Status of each.
2. RECENT REQUESTS: Last 2-3 things the user asked for.
3. IN-PROGRESS WORK: Any batch operations, their progress.
4. BLOCKERS: Anything stuck or waiting.
5. PENDING COMMITMENTS: Promises made that need follow-up.
This context will be LOST after compaction. The summary alone
won't preserve task state.
```
## Why This Matters
Models treat vague instructions as optional. When memory flush says 'store durable memories' without specifics, the model often replies NO_REPLY because it doesn't know what's durable.
By being explicit about what to save and why, we increase the likelihood that active work survives compaction.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the default pre-compaction memory flush prompts in `src/auto-reply/reply/memory-flush.ts` to be more urgent and specific, switching from a single-line, generic instruction to multi-line prompts with an explicit checklist of what to persist (tasks, recent requests, batch progress, blockers, commitments) and clearer consequences if not saved. The behavior remains configuration-driven via `resolveMemoryFlushSettings`, with the prompts still passed through `ensureNoReplyHint()` to guarantee the silent-reply token guidance is present.
<h3>Confidence Score: 4/5</h3>
- This PR is low risk and mainly updates prompt strings.
- Changes are confined to string constants used for memory flush prompts; no control flow or data handling changed. The main potential downside is UX/compatibility around emoji rendering and slightly mixed instruction wording, but there are no obvious runtime or type-safety risks.
- src/auto-reply/reply/memory-flush.ts
<!-- greptile_other_comments_section -->
**Context used:**
- 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))
<!-- /greptile_comment -->
Most Similar PRs
#8903: fix: improve compaction summary instructions to preserve active work
by joetomasone · 2026-02-04
81.8%
#8919: Pr/memory flush improvements
by shortbus · 2026-02-04
80.5%
#8896: fix: improve compaction fallback message with recovery hints
by joetomasone · 2026-02-04
79.8%
#20713: fix(compaction): trigger memory flush after missed compaction cycles
by zerone0x · 2026-02-19
79.2%
#20075: feat(compaction): improve merge summary instructions for better nua...
by jlwestsr · 2026-02-18
79.1%
#10644: feat: add runDuringHeartbeats option for memory flush (AI Assisted)
by tripphillips · 2026-02-06
77.5%
#4999: fix(memory-flush): use contextTokens instead of totalTokens for thr...
by Farfadium · 2026-01-30
77.5%
#14128: config: add readable durable/off mode for pre-compaction memory flush
by vpesh · 2026-02-11
77.1%
#22220: feat(bootstrap): cache session's bootstrap files so we don't invali...
by anisoptera · 2026-02-20
76.5%
#18997: fix: improve context overflow error messages and docs
by realhoratiobot · 2026-02-17
76.4%