Skip to content

fix(agent): keep the memory a conversation started with when it resumes - #537

Merged
kalaspuff merged 2 commits into
mainfrom
fctl/1242-i-asked-an-autopilot-for-a-project-calle
Nov 14, 2026
Merged

kalaspuff merged 2 commits into
mainfrom
fctl/1242-i-asked-an-autopilot-for-a-project-calle

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A session that resumes (a message after it stopped, an autopilot woken between its turns) no longer takes in all of ~/AGENTS.md again. 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.md anew 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 memory lists the ones added since, as ~/AGENTS.md already says.

I checked it in cargo xtask dev: I stopped a session, added a note and resumed it with a message. Its ~/AGENTS.md stayed byte-identical, its fctl memory listed the new notes, and a new session started with all three. A unit test covers the choice.

Worth confirming

  • Decision: a resumed session no longer sees notes added since its conversation started unless it runs 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 at fctl memory.

fctl session


Note

Low risk. It changes only how the project's memory section of ~/AGENTS.md is 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.md now 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 the fctl memory probe, 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

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.
@fctl-sh
fctl-sh Bot requested a review from kalaspuff as a code owner November 13, 2026 22:21
@fctl-review

This comment has been minimized.

Comment thread crates/fctl-agent/src/supervisor.rs Resolved
Comment thread crates/fctl-agent/src/supervisor.rs Resolved
…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.
@kalaspuff
kalaspuff merged commit 09c3a87 into main Nov 14, 2026
13 checks passed
@kalaspuff
kalaspuff deleted the fctl/1242-i-asked-an-autopilot-for-a-project-calle branch November 14, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant