feat: add verified-code-answers plugin to fix unverified assertions (fixes #29753)#29755
Open
HarshalJain-cs wants to merge 4 commits intoanthropics:mainfrom
Open
feat: add verified-code-answers plugin to fix unverified assertions (fixes #29753)#29755HarshalJain-cs wants to merge 4 commits intoanthropics:mainfrom
HarshalJain-cs wants to merge 4 commits intoanthropics:mainfrom
Conversation
Adds a new plugin that injects a SessionStart hook instructing Claude to always read source files before answering factual questions about code behavior. If Claude cannot read a file, it must explicitly caveat the answer as unverified. Fixes: anthropics#29753
This script implements a SessionStart hook for the Verified Code Answers plugin, providing guidelines for verifying code behavior before answering user questions.
This README introduces the Verified Code Answers Plugin, detailing its purpose, rules for code behavior assertions, installation instructions, and file structure.
This was referenced Mar 1, 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
Fixes #29753 — Claude Code presents unverified assertions with the same confidence as verified ones.
Problem
When Claude Code answers a question about code behavior, there is no discernible difference in tone, confidence, or presentation between:
The existing system prompt instruction "Do not say things you haven't verified" is insufficient on its own, as Claude still generates confident unverified answers.
Solution
This PR adds a new plugin
verified-code-answersthat injects aSessionStarthook with three explicit behavioral rules:Rule 1: Read Before You Assert
Claude must use file reading tools (
Read,Glob,Grep) to inspect actual source code before answering any factual question about code behavior.Rule 2: Caveat Unverified Answers
If Claude cannot read the relevant source file, it must explicitly caveat its answer (e.g., "I haven't read the source file, but based on common patterns...").
Rule 3: Never Present Unverified Information as Verified
Code-behavior questions must never be answered with the same confidence as verified answers unless the code was actually read.
Files Added
Testing
This plugin works identically to the existing
explanatory-output-styleplugin in structure and hook mechanism. Install by copying to your Claude Code plugins directory.