[MODEL] Claude paraphrases docstrings instead of reading function source, gives confidently wrong technical answers
Preflight Checklist
- [x] I have searched existing issues for similar behavior reports
- [x] This report does NOT contain sensitive information (API keys, passwords, etc.)
Type of Behavior Issue
Claude made incorrect assumptions about my project
What You Asked Claude to Do
Working in a Python notebook repo. Asked Claude what a scoring function (modellability_score) computed. The function lives in a file Claude had already imported — 200
lines from code it had just read.
Instead of reading the function body, Claude paraphrased the inline comments at the call site and the notebook's narrative docstring, and confidently told me the score was
a discrete 3-tier {0.0, 0.5, 1.0}. That's the intent of one component of the score — not the score.
I pushed back twice with concrete visual evidence:
- "How is there so much variation in §1 if all 3 tests reject?" — Claude added more detail to the wrong model.
- "The points on the line do not overlap... they would stack" — only on this turn did Claude actually read the function body and discover the score is a continuous
rank-percentile composite of three averaged components (block_p magnitude, the concord tier, class balance), capped if block_fallback, then rank-percentile-transformed.
Cost: three turns of misdirection, lost trust in subsequent explanations, and I had to be the one to notice the answer was inconsistent with the chart on screen.
The fix should be obvious — when the user asks "what does X do" for a function in a file Claude has access to, read the source, don't paraphrase the docstring. Especially
when the user is staring at a chart that contradicts the answer.
Model: claude-opus-4-7 (1M context). Claude Code CLI.
What Claude Actually Did
Working in a Python notebook repo. Asked Claude what a scoring function (modellability_score) computed. The function lives in a file Claude had already imported — 200
lines from code it had just read.
Instead of reading the function body, Claude paraphrased the inline comments at the call site and the notebook's narrative docstring, and confidently told me the score was
a discrete 3-tier {0.0, 0.5, 1.0}. That's the intent of one component of the score — not the score.
I pushed back twice with concrete visual evidence:
- "How is there so much variation in §1 if all 3 tests reject?" — Claude added more detail to the wrong model.
- "The points on the line do not overlap... they would stack" — only on this turn did Claude actually read the function body and discover the score is a continuous
rank-percentile composite of three averaged components (block_p magnitude, the concord tier, class balance), capped if block_fallback, then rank-percentile-transformed.
Cost: three turns of misdirection, lost trust in subsequent explanations, and I had to be the one to notice the answer was inconsistent with the chart on screen.
The fix should be obvious — when the user asks "what does X do" for a function in a file Claude has access to, read the source, don't paraphrase the docstring. Especially
when the user is staring at a chart that contradicts the answer.
Model: claude-opus-4-7 (1M context). Claude Code CLI.
Expected Behavior
don't paraphrase the docstring
Files Affected
Permission Mode
Accept Edits was ON (auto-accepting changes)
Can You Reproduce This?
Sometimes (intermittent)
Steps to Reproduce
NA.
Claude Model
Opus
Relevant Conversation
Impact
Low - Minor inconvenience
Claude Code Version
2.1.123 (Claude Code)
Platform
Anthropic API
Additional Context
Interacting with python notebooks have been really frustrating for a while.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗