Skip to content

devshell: keep the AI's session transcripts in the host cache. - #152

Merged
vgvassilev merged 1 commit into
compiler-research:mainfrom
vgvassilev:devshell-keep-transcripts
Oct 29, 2026
Merged

vgvassilev merged 1 commit into
compiler-research:mainfrom
vgvassilev:devshell-keep-transcripts

Conversation

@vgvassilev

Copy link
Copy Markdown
Contributor

Claude writes each session's transcript under ~/.claude/projects/ in the container's HOME. HOME is in the container's own layer, so a re-created container loses every transcript, and claude --resume then says "No conversation found". bin/repro re-creates the container whenever its mounts change, so this happens often. Only memory survived, because it is bound from the host cache.

Bind ai/transcripts/// from the host cache like the memory directory: read-write, this project only. devshell-init points ~/.claude/projects/ at a directory in it, for each of the three cwds it already links memory for, and puts the memory link inside. A session started from any other directory, such as a subdirectory of /patches, is still not kept; memory has the same limit.

Moving to this version re-creates each existing devshell, because its mounts change, and that drops the transcripts it holds. Copy any you want to keep out of ~/.claude/projects/ first.

The posture check now checks that this project's transcripts are writable and that no other project's are visible. The linking moves into a function that devshell-init --link-ai runs alone, without root, so scripts/test_devshell_init.py can check the links.

Claude writes each session's transcript under ~/.claude/projects/ in
the container's HOME. HOME is in the container's own layer, so a
re-created container loses every transcript, and `claude --resume`
then says "No conversation found". bin/repro re-creates the container
whenever its mounts change, so this happens often. Only memory
survived, because it is bound from the host cache.

Bind ai/transcripts/<repo>/<encoded-path>/ from the host cache like
the memory directory: read-write, this project only. devshell-init
points ~/.claude/projects/<cwd> at a directory in it, for each of the
three cwds it already links memory for, and puts the memory link
inside. A session started from any other directory, such as a
subdirectory of /patches, is still not kept; memory has the same
limit.

Moving to this version re-creates each existing devshell, because its
mounts change, and that drops the transcripts it holds. Copy any you
want to keep out of ~/.claude/projects/ first.

The posture check now checks that this project's transcripts are
writable and that no other project's are visible. The linking moves
into a function that `devshell-init --link-ai` runs alone, without
root, so scripts/test_devshell_init.py can check the links.
@vgvassilev
vgvassilev merged commit b91e461 into compiler-research:main Oct 29, 2026
17 checks passed
@vgvassilev
vgvassilev deleted the devshell-keep-transcripts branch October 29, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant