{"version":"2.1.334","anchor":"write-refuses-stale-reads-with-distinct-messages-and-a-post","canonical_anchor":"write-refuses-stale-reads-with-distinct-messages-and-a-post","heading":"Tool refusals carry structured reasons, and file writes explain stale reads","tier":"notice","area":"File Editing","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334\/e\/write-refuses-stale-reads-with-distinct-messages-and-a-post","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334","markdown":"### Tool refusals carry structured reasons, and file writes explain stale reads\n\nTool results now record who refused a call and why, and the file write check separates never-read files from files changed since reading\n\n**What**\n\nA tool call is one action Claude takes, such as reading or writing a file. When a call is refused or does not run, Claude Code now attaches structured details saying why, instead of leaving that only in message text.\n\n- `refused_by` says whether a rule, a hook (a command you set up to run automatically) or `auto_mode` refused the call.\n\n- `file_refusal` gives the reason a file tool refused.\n\n- `input_invalid` marks a call that did not run because its input was invalid.\n\n- `uploaded_files` is also recorded on the tool result.\n\n- These are marked `@internal` in the SDK message schema, the format programs that embed Claude Code receive.\n\n- The record of each tool result now holds these alongside the existing `remedy`, `input_changed` and `permission_decision`, and drops a `remedy` that conflicts with a plugin rewrite.\n\n- The file write check now tells apart a file that was never read from one that changed after it was read, with a different message for each, and returns a `fileRefusal` code with every refusal.\n\n- When an internal condition is true, or a file is named during compaction (when Claude Code summarises a long conversation to free space), the write check keeps the reads made before compaction and compares them with the file's current content. That comparison decides whether the write is allowed.\n\nBefore, the write check had a single \"read it first\" message.\n\n**Why**\n\nPrograms built on Claude Code can tell why a tool call was refused without parsing text. For people editing files in long conversations, writes after compaction are now judged against what was read before it, and a refused write says which of the two problems it hit.\n\n- Area: File Editing\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}