[Bug] Claude defaults to assertion from memory instead of verification from tools
Bug Description
Claude Code states facts about schemas, file contents, configurations, and system state from memory/inference rather than checking with available tools. When these assertions are wrong, the error propagates into generated code, SQL, or recommendations — and is reported with the same confidence as verified facts.
Concrete Examples
Example 1: Column count from memory
A prior session wrote a SQL INSERT for gameobject_template with 32 Data column values. The table actually has 35 (Data0-Data34). Claude counted from memory instead of running DESCRIBE gameobject_template. The 3-column mismatch wasn't caught until execution failed in a later session.
Example 2: Column existence assumption
Claude wrote a verification query referencing smart_scripts.VerifiedBuild. That column doesn't exist on this table. Instead of checking the schema first, Claude assumed the column existed because most other tables in the same database have it.
Example 3: Schema inference across databases
When writing cross-database queries (source DB → target DB), Claude inferred that matching table names have matching schemas. Several tables had extra columns in the target (creature.size, gameobject.visibility, npc_vendor.OverrideGoldCost). The import document accounted for these, but only because a human had previously run DESCRIBE on both sides.
The Pattern
Claude has strong priors about what "should" be true based on patterns in training data and conversation context. These priors are often correct, which reinforces the behavior. But when they're wrong, the failure is silent — there's no indication that a fact was inferred rather than verified.
The fix isn't "always run DESCRIBE" — it's "distinguish between 'I know this' and 'I checked this' in reasoning, and default to checking when the cost is low."
Impact
- Generated code contains bugs that match "what Claude thinks the schema looks like" rather than what it actually is
- Users can't tell from Claude's output whether a claim is verified or inferred
- The cost of checking (one DESCRIBE query, ~100ms) is trivially low compared to the cost of debugging wrong SQL
Related
- #32289 — Claude generates incorrect code and reports it as complete
Environment
- Claude Code 2.1.71
- Windows 11
11 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Additional Detail: Three Assertion-From-Memory Failures in One Session
Failure 1: gameobject_template column count (prior session)
What Claude asserted: Data0-Data34 needs 32 zero values.
What's actually true: Data0-Data34 is 35 columns (0 through 34 inclusive = 35).
How it should have been verified:
DESCRIBE gameobject_template→ count the Data columns.Cost of checking: ~100ms for a DESCRIBE query.
Cost of not checking: Broken SQL file that failed on execution in a later session, requiring diagnosis and a fix.
Failure 2: smart_scripts.VerifiedBuild (this session)
What Claude asserted: The
smart_scriptstable has aVerifiedBuildcolumn.What's actually true:
smart_scriptshas noVerifiedBuildcolumn. Most other tables in the world database do, but smart_scripts is an exception.How it should have been verified:
DESCRIBE smart_scriptsor check the import document (which notes "no VB" for this table).Cost of checking: ~100ms.
Cost of not checking: Query error, wasted round-trip, required fallback to a different verification approach.
Exact error:
Failure 3: Schema match assumption across databases (this session)
What Claude assumed: Tables with the same name in
worldandlorewalker_worldhave identical schemas.What's actually true: Several tables differ:
world.creaturehas an extrasizecolumn (default -1)world.gameobjecthas extrasizeandvisibilitycolumnsworld.npc_vendorhas an extraOverrideGoldCostcolumnlorewalker_world.scene_templatehas an extraRTCommentcolumnworld.gameobject_templatehas an extraStringIdcolumnThe import document (written by a human after running DESCRIBE on both sides) accounts for all of these with explicit column lists. Claude never independently verified these schema differences — it relied entirely on the pre-written SQL being correct.
The underlying pattern
Claude's training data contains millions of examples of database schemas. It develops strong priors about what columns a table "should" have. These priors are often correct (which reinforces the behavior), but when wrong:
What "default to verification" looks like
Before referencing any column in generated SQL:
This adds ~100ms per table and eliminates an entire class of bugs.
This Is Not a Duplicate
vs #32289 (our own issue — "Generates incorrect code, reports success")
The bot flagged our own issue as a duplicate of our other issue. These describe different failure modes in the same pipeline:
#32289 asks: "Why is the code broken?"
#32294 asks: "Why did Claude think it knew the schema without checking?"
Fixing #32289 (better code generation) doesn't fix #32294 (defaulting to assertion over verification). And fixing #32294 (always verify before asserting) would prevent #32289 from occurring. #32294 is closer to the root cause.
vs #27790 ("Model regularly attempts Edit/Write on files it hasn't Read") — OPEN
#27790 is a narrow, specific instance: Claude tries to edit files without reading them first. That's one manifestation of the broader pattern described in #32294.
#32294 covers assertion-over-verification across ALL domains — not just file edits:
Our detailed comment documents 3 specific assertion-from-memory failures from a single session, each with the exact assertion made, the actual truth, how it should have been verified, and the cost of both checking (~100ms) and not checking (broken SQL, failed queries, wasted debugging time). #27790 doesn't provide this breadth.
vs #16546 ("Model attempts file edits without reading file first") — OPEN
Same as #27790 — a narrow instance (file edits) of the broader pattern (#32294 covers schema, configuration, and state assertions). Our issue has a different scope and different proposed fix ("default to verification" across all domains, not just "read before edit").
Community Validation Update — Asserts Facts from Memory Instead of Checking
This failure mode has no direct community reports under this name, but it is the root cause behind many other reported failures.
Indirect Evidence
Why This Is Foundational
This is arguably the most fundamental issue in the taxonomy because:
Mitigation
The only reliable mitigation is tool-enforced verification: if a fact needs to be true, a tool call must confirm it in the current session. Memory should be treated as a hint for where to look, never as a source of truth. This is the philosophy behind our edit-verifier hook and the broader PostToolUse verification pattern.
Part of the completion-integrity taxonomy tracked in #32650.
Pass 5 — Final Evidence Update (Asserts Facts from Memory)
Root Cause Evidence
Subagent Phantom Execution (NEW — 5 reports)
Pass 5 identified a new variant: Task tool subagents fabricate Bash/MCP outputs. The parent agent receives fabricated results and asserts them as verified facts. This is memory-assertion at one layer of indirection — the subagent asserts from memory, the parent treats it as tool-verified.
#27430 (SAFETY) — Compounding Across Sessions
The most severe instance: Session N writes an unverified assertion to persistent storage → Session N+1 reads it back as "verified fact" → builds on it → publishes to 8+ platforms. Memory assertion + persistent storage = automated confabulation pipeline.
HN Threads
Why This Is Foundational
Every other failure mode is made worse when Claude asserts from memory:
The fix is tool-enforced verification: if a fact needs to be true, a tool call must confirm it in the current session.
Part of the completion-integrity taxonomy tracked in #32650.
Still reproducing. Claude will state schema column names from memory rather than running DESCRIBE, leading to incorrect SQL that it then reports as "applied cleanly." See #32650.
This is the inverse of the validation problem — instead of generating wrong output and reporting it as correct, Claude generates confident assertions about system state without checking.
The pattern is particularly dangerous because it compounds: a wrong assertion in session N becomes cached context for session N+1, and the error propagates through the agent's conversation history. By the time someone notices, the original incorrect assumption may be buried deep enough that it looks like a legitimate fact.
This is related to what research on AI code review calls "correlated failures" — when the generating agent and any reviewing agent share the same training distribution, they tend to make the same mistakes and can't catch each other's errors. The only reliable fix is an external reference point: actual tool output, live schema queries, or executable tests.
A practical pattern that helps:
For catching these kinds of assertion-without-evidence patterns in generated code, tools like
npx @opencodereview/cli scan . --sla L1can flag when code relies on assumptions that should have been verified.The fix really needs to be at the agent framework level — make verification a hard requirement, not a soft suggestion.
@raye-deng — good framing on the 5 defect categories, especially "correlated failures" (AI makes the same wrong assumption in both the code and the test). That's exactly what we see with SQL: Claude generates a 32-value INSERT for a 35-column table, then writes a "verification" query that also assumes 32 columns — the check can't catch what it shares the same blind spot about.
The "force tool-before-assert" mitigation aligns directly with what this taxonomy proposes — a mandatory gate where the agent must produce tool output before any factual claim about schema, file contents, or execution results. The cost is trivially low (a DESCRIBE query is ~100ms) but the model consistently skips it in favor of asserting from memory.
I need to escalate a serious reliability issue with Claude Code.
This is not about incorrect answers — it’s about the system presenting incomplete workflows as fully verified.
Claude repeatedly:
This creates a major trust issue because there is no way to distinguish between:
This behavior has already impacted real decision-making and caused financial consequences.
The core problem:
Claude does not enforce verification before completion and does not fail when required data is missing.
I’ve already submitted detailed GitHub issues, but I want to make sure this is properly escalated internally because this is a system-level trust failure, not a normal bug.
Can you confirm this is being escalated to the product/engineering team?
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.