claude-code - 💡(How to fix) Fix [MODEL] Opus 4.8 fabricated a present-tense user request and persisted on an invented task context

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

In a long Claude Code session, Opus 4.8 switched away from the active coding task to an unrelated scraping task that I had not requested.

The invented task first appears in the model's own thinking. It states that the user is "switching gears" to a scraping task, claims there is an HTML file named aste.html in Downloads, and attributes a quote to the user: butta tutto la.

No corresponding user message exists in the session. I verified this by parsing the JSONL, separating real user-authored messages from tool_result records, and searching for scraping/auction/aste.html references in user messages.

The model then acted on the invented task for many tool calls: looking for aste.html, building/reworking scraping scripts, reasoning about hundreds of auction lots, and writing README/script content around the invented workflow. Later filesystem/tool evidence contradicted the premise: ~/scraping did not exist and ~/Downloads/aste.html was not present. The model eventually admitted that the task and user message were invented.

Root Cause

This supporting case is not the primary proof. It is useful because it shows the same task-framing/user-intent fabrication pattern outside the original long-context/cancellation storm. In that case, the failed edits and duplicate-check script stopped the narrative quickly, so the severity was lower.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I searched for related issues before filing
  • This report does not contain secrets, API keys, or private credentials
  • This is a model-behavior report, not only a tool/harness report

Type of Behavior Issue

Model behavior: fabricated user intent / autonomous task switch / persistent fabricated context.

Environment

  • Claude Code versions visible in the local JSONL: 2.1.154 and 2.1.156
  • Model: claude-opus-4-8
  • Platform: macOS
  • Session type: long Claude Code agentic session with many tool calls
  • Context size, measured from message.usage (input + cache_read + cache_creation):
    • last genuine user turn before the failure: ~540k tokens
    • fabrication onset: ~607k tokens
    • collapse/admission: ~693k tokens

Summary

In a long Claude Code session, Opus 4.8 switched away from the active coding task to an unrelated scraping task that I had not requested.

The invented task first appears in the model's own thinking. It states that the user is "switching gears" to a scraping task, claims there is an HTML file named aste.html in Downloads, and attributes a quote to the user: butta tutto la.

No corresponding user message exists in the session. I verified this by parsing the JSONL, separating real user-authored messages from tool_result records, and searching for scraping/auction/aste.html references in user messages.

The model then acted on the invented task for many tool calls: looking for aste.html, building/reworking scraping scripts, reasoning about hundreds of auction lots, and writing README/script content around the invented workflow. Later filesystem/tool evidence contradicted the premise: ~/scraping did not exist and ~/Downloads/aste.html was not present. The model eventually admitted that the task and user message were invented.

Evidence timeline from the local JSONL

Line numbers below refer to my local Claude Code JSONL transcript. I can provide a redacted excerpt if useful.

  • L1680: last genuine user turn before the switch. The session is still in the original coding task context; no scraping request.
  • L1841-L1850: cluster of Cancelled: parallel tool call ... errored results from parallel tool calls.
  • L1851: model thinking fabricates a present-tense user switch:
    • says the user is "switching gears" from the active task to a scraping task;
    • says the user needs auction data extracted from aste.html in Downloads;
    • attributes butta tutto la to the user.
  • L1852+: the model starts acting on that invented task.
  • L1914: contrary evidence: ~/scraping does not exist.
  • L2021: Downloads listing does not contain aste.html.
  • L2028 / L2035: the model collapses the premise and states that the scraping work/task/user message were not real.

Why I think this is distinct

This is related to the parallel-tool cancellation and fabricated tool-output reports, but the distinctive failure here is stronger than a single hallucinated fact or a bad command result.

The model fabricated the active user intent itself. It represented a nonexistent current user request as real, attributed words to the user, switched goals on that basis, and preserved that invented context after contrary tool/filesystem evidence.

Even if an old scraping-related topic had existed earlier in context, the behavior would still be wrong: the model framed the event as a present-tense user switch during an active unrelated task, and it acted without re-grounding.

Supporting recurrence during later analysis

A separate Opus 4.8 session reproduced the same shape while helping me prepare this report.

At moderate context, while editing a markdown dossier about the first incident, the model fabricated a file-state premise: it believed the file contained duplicated sections that needed cleanup. It attempted edits based on that premise. Tool evidence then contradicted it:

  • a duplicate-check script reported total duplicate-run sites: 0;
  • grep -c reported only one matching heading;
  • the attempted cleanup edits failed with String to replace not found.

For several lines, the model still tried to preserve the premise by saying the original duplications were "definitely real." It then collapsed the premise and admitted it had been acting on a fabricated premise.

The same supporting session also showed user-intent fabrication inside the model's reasoning. It reasoned that I was asking it to "rewrite thinking" and generated a clarification question for a task I had not requested. Later, when I only wrote fermo to stop it, the model inferred a reason I had not given: that I was editing the file in the IDE and it should avoid overwriting my work.

This supporting case is not the primary proof. It is useful because it shows the same task-framing/user-intent fabrication pattern outside the original long-context/cancellation storm. In that case, the failed edits and duplicate-check script stopped the narrative quickly, so the severity was lower.

Related issues

This seems closest to:

  • #64049: fabricated external premise/prompt-injection narrative, then multi-turn action
  • #64048: fabricated external content before grounding
  • #64047: parallel-tool cancellation ambiguity, likely a trigger/amplifier here
  • #63538: fabricated tool output and user instruction after parallel-batch cancellation

Working interpretation

The repeated pattern is not merely "the model got a fact wrong." The problem is task-framing persistence: the model can construct an invented explanation of what the user is asking now, or why the user said something, then use that invented frame to guide action.

The dangerous variable is persistence after contrary evidence. In the primary incident, persistence lasted many tool calls. In the supporting recurrence, tool evidence stopped it quickly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [MODEL] Opus 4.8 fabricated a present-tense user request and persisted on an invented task context