Repository navigation
fix(agent): keep the memory a conversation started with when it resumes - #537
Merged
kalaspuff merged 2 commits intoNov 14, 2026
Merged
Conversation
Claude Code keeps what its memory files said in the conversation and, as it starts, takes in whole again each file that changed. fctl-agent wrote ~/AGENTS.md anew at every run, with the notes added since and new ages, so each resume cost the conversation all of it again: an autopilot's own session, which stops between wakes, took in its 24 KB of notes at almost every wake. fctl-agent now keeps the memory section a conversation started with in its state and writes it again, word for word, when Claude resumes that conversation. A new conversation, in a new sandbox too, gets the notes as they are then; fctl memory lists those added since.
This comment has been minimized.
This comment has been minimized.
…s comment A conversation that resumes with the memory it started with needs no look at whether the sandbox's fctl keeps one: it did then, and a look that timed out once would have dropped the kept section.
This was referenced Nov 13, 2026
kalaspuff
approved these changes
Nov 14, 2026
kalaspuff
deleted the
fctl/1242-i-asked-an-autopilot-for-a-project-calle
branch
November 14, 2026 06:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A session that resumes (a message after it stopped, an autopilot woken between its turns) no longer takes in all of
~/AGENTS.mdagain. Claude Code keeps what its memory files said in the conversation and, as it starts, re-attaches in full every file whose text changed (2.1.323 compares them file by file). fctl-agent wrote~/AGENTS.mdanew at every run, with the notes added since and new ages ("today", "yesterday"), so almost every resume added the whole file, up to 24 KB of notes plus fctl's instructions, to the conversation. An autopilot's own session stops between wakes, so it paid this at nearly every wake: the spaghetti autopilot named it as its biggest context cost.fctl-agent now keeps in its state the memory section a conversation started with, and writes it again word for word when Claude resumes that conversation. A new conversation, including one in a new sandbox, gets the notes as they are then, and
fctl memorylists the ones added since, as~/AGENTS.mdalready says.I checked it in
cargo xtask dev: I stopped a session, added a note and resumed it with a message. Its~/AGENTS.mdstayed byte-identical, itsfctl memorylisted the new notes, and a new session started with all three. A unit test covers the choice.Worth confirming
fctl memory. The alternative, a short "new notes since" message on resume, would still cost something at every wake. I left it out because the instructions already point agents atfctl memory.fctl session
Note
Low risk. It changes only how the project's memory section of
~/AGENTS.mdis built when Claude's conversation resumes, in the agent's supervisor and prompt code.What it does. When an agent resumes Claude's conversation,
~/AGENTS.mdnow keeps the memory section the conversation started with, instead of re-rendering the notes with new ages and newly added notes. Claude Code takes a changed memory file in whole again, so the old behavior cost the conversation the whole file at every resume. A resume that has a kept section also skips thefctl memoryprobe, and a new conversation still gets the notes as they are then.fctl review's first look at
d594cbd· 3 files, +124 −28 · Review agent settings