fix(docs): correct Replace-mode write guidance for Claude Code (#1091) - #1118
Closed
andig wants to merge 1 commit into
Closed
fix(docs): correct Replace-mode write guidance for Claude Code (#1091)#1118andig wants to merge 1 commit into
andig wants to merge 1 commit into
Conversation
…e#1091) The Claude Code CLAUDE.md Replace-mode block said "Write and Delete — use native tools normally", but under Replace mode native Read/Grep/Glob are denied, and Claude Code's native Edit gates on a prior native Read of the same path — so Edit is unreachable, and native Write only succeeds for brand-new files. ctx_patch is the actual edit path. Correct the block to say so, and bump the shared block version v6 -> v7 so existing CLAUDE.md blocks get rewritten on next setup/doctor. The MCP block is unchanged (native Read -> Edit works there). Other harnesses are left as-is: their read-before-write semantics differ (e.g. Pi's native edit/write stay available). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
|
Cherry-picked to main as de4097b. Thank you for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1091.
Problem
The Claude Code CLAUDE.md Replace-mode block says:
Under Replace mode native
Read/Grep/Globare denied. Claude Code's nativeEditgates on a prior nativeReadof the same path, soEditis unreachable; and nativeWriteto an existing file is rejected (File has been modified since read) becausectx_readdoes not satisfy the harness read-precondition. Net:Editnever works andWriteonly works for brand-new files —ctx_patchis the real edit path.Fix
ctx_patchis the edit path, nativeEditneeds a prior nativeRead(denied), nativeWriteonly for brand-new files,op=createfor new files, Delete native.lean-ctx-claude-v6->v7so existing CLAUDE.md blocks are rewritten on nextsetup/doctor(the staleness check keys off the version tag).v7.The MCP block is unchanged — native
Read->Editworks there. Other harnesses are intentionally left alone: their read-before-write semantics differ (Pi's replace template already documents that nativeedit/writestay available).Test
cargo test --test setup_ci_smoke— 5 passed.🤖 Generated with Claude Code