[BUG] /resume inside a running session keeps stale CLAUDE.md and auto-memory context (claude --resume and /clear reload it)

Status Open
Reported on v2.1.283
Maintainer reply None cached
Activity 0 comments · opened Sep 28, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Switching sessions with /resume <id> inside a running Claude Code doesn't reload CLAUDE.md or the auto-memory index (MEMORY.md). The resumed session's instructions context stays whatever was captured before:

  • The resumed transcript already has an instructions block: no new block is added, so the old copy stays in context.
  • The resumed transcript has none, e.g. one written by a PreCompact hook that forks the conversation: the first message stores the running process's copy, taken at that process's first turn, rather than the files on disk.

Starting with claude --resume <id>, or running /clear, re-reads both files and stores a fresh instructions block. So the three ways into a session disagree.

The "…changed on disk since you last read it" notices partly cover for this. For the edits I tested (up to a ~22 KB CLAUDE.md rewrite and a ~13 KB MEMORY.md rewrite), the notice carried the diff and the model answered from it. But the stale copy stays in context beside the notice. And in one real session, the notice for a rewritten ~16 KB MEMORY.md carried no diff:

…/memory/MEMORY.md changed on disk since you last read it. … The changes are not shown here; use Read if you need the current content.

That session's instructions held the old index (158 entries, 58 of them pointing at memory files that had since been deleted) plus that one-line hint.

What Should Happen?

/resume inside a running session should reload CLAUDE.md files and the auto-memory index the way claude --resume and /clear already do, so the resumed session's instructions match the files on disk at the moment of the switch.

Error Messages/Logs

No error. The evidence is in the session transcript (~/.claude/projects/<project>/<session>.jsonl): the instructions attachment is the line containing Contents of …/CLAUDE.md and Contents of …/MEMORY.md.

Steps to Reproduce

No plugins needed. <project> is the folder's absolute path with every non-alphanumeric character replaced by -. Use a folder that isn't inside a git repo.

  1. Create ~/cc-resume-repro. Put - MEMMARK: four as the first line of ~/.claude/projects/<project>/memory/MEMORY.md.
  2. In that folder, run claude -p "Reply OK" --output-format json and note the session_id (call it S). Its transcript stores an instructions block containing four.
  3. Start claude in the same folder and send any message.
  4. Rewrite MEMORY.md so the first line is - MEMMARK: five.
  5. In the running session: /resume S, then send: "Without using any tools, quote the MEMMARK line from the memory index in your context."
  6. Open S.jsonl. It still has exactly one instructions block, and that block says four; nothing new was stored. (The reply may still say five, taken from the change notice.)
  7. /exit, run claude --resume S, and send the same message. S.jsonl now has a second instructions block, and it says five.

Swapping CLAUDE.md for MEMORY.md gives the same result.

Fork variant (how I hit it): a PreCompact hook that forks the transcript (the context-compacto plugin does this) produces a transcript with no instructions block. Resuming it in place stores the process's first-turn copy. Measured on 2.1.283:

| After the fork is written | Instructions block stored | Background shell | Background agent |
|---|---|---|---|
| /resume <fork> | stale (process's first-turn copy) | survives | survives |
| /clear, then /resume <fork> | fresh | survives | cut off |
| /exit, then claude --resume <fork> | fresh | stopped | stops* |

\*Not tested with an agent; the exit dialog says background work stops unless you choose "Move to background and exit".

So right now, the only ways to get fresh CLAUDE.md and memory into a resumed session also cut off running background agents.

Claude Model

Not sure / Multiple models. Reproduced with Haiku 4.5, first noticed on Opus; the model doesn't affect it.

Is this a regression?

I don't know

Claude Code Version

2.1.283 (Claude Code)

Platform

Anthropic API (Claude Max subscription)

Operating System

macOS

Terminal/Shell

Other: zsh inside tmux

View original on GitHub ↗