feat: Add session-file-validator plugin for stale image detection on resume#20662
Open
CameronImmesoete wants to merge 1 commit intoanthropics:mainfrom
Open
feat: Add session-file-validator plugin for stale image detection on resume#20662CameronImmesoete wants to merge 1 commit intoanthropics:mainfrom
CameronImmesoete wants to merge 1 commit intoanthropics:mainfrom
Conversation
…resume Adds a new plugin that validates file content when resuming sessions. When images were read in a previous session, the plugin warns Claude about potentially stale cached data and instructs it to re-read files when asked about them. Key features: - SessionStart hook with resume matcher - Parses transcript to find image file reads - Checks if files still exist on disk - Injects context warning about cached content - Security: path traversal protection, symlink validation Co-Authored-By: Claude <[email protected]>
|
@claude PTAL 🤖 Generated with Claude Code |
mrmrcode
approved these changes
Feb 10, 2026
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
This PR adds a new plugin that validates file content when resuming sessions. When images were read in a previous session, the plugin warns Claude about potentially stale cached data and instructs it to re-read files when asked.
Problem: When using
--resumeto continue a session, Claude may describe cached image content from the original session instead of reading new files. This is because image data is stored as base64 in the transcript and replayed on resume without re-reading the actual files.Solution: A SessionStart hook that:
Changes
plugins/session-file-validator/.claude-plugin/plugin.json- Plugin metadataplugins/session-file-validator/hooks/hooks.json- Hook configuration (SessionStart with resume matcher)plugins/session-file-validator/hooks/session-resume-validator.py- Main validation logicplugins/session-file-validator/README.md- Documentationplugins/README.md- Added plugin to the directory tableSecurity
Path.resolve()and pattern checksTest Plan
Related
--resumesession shows wrong image content when reading new files with unique paths #15285🤖 Generated with Claude Code