[Bug] @-mentioned file content not persisted across session restarts
Bug Description
Bug Report: @-Mentioned File Content Not Persisted Across Sessions
Summary
File content loaded via @filename mentions is not persisted in conversation history and becomes unavailable
after the application restarts, causing the model to lose access to previously referenced file content.
Description
When a user mentions a file using the @filename syntax, Claude loads and processes the file content during
that session. However, this content is not preserved in the conversation transcript. When the application is
closed and later resumed, Claude no longer has access to the file content from the previous session, even
though the conversation history shows the file was referenced.
Reproduction Steps
- Start a new conversation with Claude
- Reference a file using
@filenamesyntax - Ask Claude to acknowledge the file was loaded but NOT to describe its contents
- Verify Claude confirms the file was received
- Close the application completely
- Reopen the application and resume the same conversation
- Ask Claude to recall or describe the content of the previously @-mentioned file without reading it again
Expected Behavior
Claude should retain access to file content from @filename mentions across session restarts, just as it
retains access to:
- File content from explicit Read tool invocations
- Conversation text and context
- Other tool results
Actual Behavior
After restarting the application:
- Claude reports the file content is not available
- Claude may provide incorrect information about the file
- Claude states it cannot access the previously referenced file
- The conversation history shows the file was mentioned but the content is missing
Impact
User Experience
- Users must re-attach or re-mention files after each restart
- Loss of context in long-running conversations spanning multiple sessions
- Confusion when conversation history references files the model can no longer access
Workarounds
- Use explicit Read tool instead of
@filenamementions (but this is verbose) - Re-mention files after each restart (tedious, uses unnecessary tokens)
- Avoid closing the application during file-intensive work (impractical)
Technical Context
The issue appears to be that @filename mentions trigger file loading at the application level, but the loaded
content is:
- Stored only in ephemeral session memory
- Not serialized to the persistent conversation transcript
- Not reconstructed when resuming a conversation
In contrast, explicit tool use (like Read operations) appears to persist both the tool invocation and its
results in the conversation transcript, making that content available across session restarts.
Comparison with Working Behavior
Working (Persistent):
User: [Uses Read tool on file.txt]
Model: [Receives file content]
[Application restart]
Model: [Still has access to previously read content]
Broken (Ephemeral):
User: @file.txt here is my file
Model: [Receives file content]
[Application restart]
Model: [No longer has access to file content]
Suggested Fix
File content loaded via @filename mentions should be persisted in the conversation transcript using the same
mechanism as explicit tool results, ensuring the content remains available across session restarts.
Severity
Medium - The feature works within a single session but fails across restarts, limiting its utility for
persistent conversations and forcing users to adopt less ergonomic workarounds.
Environment Info
- Platform: linux
- Terminal: vte-based
- Version: 2.0.37
- Feedback ID: 5176259c-761e-497b-a8bc-8f659a1c4add
Errors
[]This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗