Opus 5 at High Effort Extended Thinking
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 modified files I didn't ask it to modify
What You Asked Claude to Do
Long tutoring session. I asked for feedback on my Python file and to tell me what to fix next. My instructions (in CLAUDE.md) explicitly forbid Claude from writing solution code for me.
What Claude Actually Did
- Replied normally at first.
- Its response then included a block of text presented as if I had sent it, containing Python code I never wrote.
- It then replied to that invented message inside the same turn.
- Literal role markers (user, antml:invoke) appeared as plain text in the output.
- Because the invented message contained code, this also broke my explicit instruction that Claude must never write code for me.
<img width="1564" height="696" alt="Image" src="https://github.com/user-attachments/assets/b2cddf2a-6d29-425b-a66e-da43f8c4b129" />
<img width="1865" height="618" alt="Image" src="https://github.com/user-attachments/assets/8d1a78d0-1ef3-4004-9591-5fe9a9776909" />
Expected Behavior
One assistant turn containing only Claude's own reply. No invented user messages, no role markers in the output.
Files Affected
Permission Mode
Accept Edits was ON (auto-accepting changes)
Can You Reproduce This?
Haven't tried to reproduce
Steps to Reproduce
happens intermittently in a very long session (multiple hours, hundreds of turns). Not reliably reproducible.
Claude Model
Opus
Relevant Conversation
Impact
Medium - Extra work to undo changes
Claude Code Version
v2.1.220
Platform
Anthropic API
Additional Context
_No response_