Adding a prompt prevents Claude Code from forgetting instructions during layered compacting

Agents & Dev✍ TextPublished: Source: Zenn (Claude Code)

#Anthropic #Claude Code

Key point

When conversations become long and summaries (compacting) are layered in Claude Code, decided items were being lost, but adding one prompt resulted in zero lost instructions even after 3 layers.

When performing long tasks with Claude Code, a summary (compact) is inserted as the conversation grows long. In this process, an issue occurred where Claude would not remember things that had been decided a short while ago. Even if instructions were explained again, they would disappear during the next summary.

By adding one prompt, the number of disappeared instructions became 0 items, even when the compacting was layered 3 times. The author is developing an extension to use Claude Code within VS Code, assuming a future where human design work is omitted and the LLM creates and fixes directly from certain requirements. During this development, the author repeatedly encountered this problem of "decided things disappearing."

This item is a summary. The full, checkable version is at the original source:

Read the original at Zenn (Claude Code) ↗