3 ms·
Anthropic, if you're listening, please allow zoned access enforcement within files. I want to be able to say "this section of the file is for testing", delineat
by zarzavat 1y ago
Anthropic, if you're listening, please allow zoned access enforcement within files. I want to be able to say "this section of the file is for testing", delineated by comments, and forbid Claude from editing it without permission.
My fear when using Claude is that it will change a test and I won't notice.
Splitting tests into different files works but it's often not feasible, e.g. if I want to write unit tests for a symbol that is not exported.
- geeunits 1y agoDoes already, read the docs
- boie0025 1y agoI think a link would have been far more helpful than "RTFM". Especially for those of us reading this exchange outside of the line of fire.
- geeunits 1y agoDon't put the onus (Opus!) on me! Just a dad approach to helping. If there's enough time to writ prose about the problem you could at least rtfm first!
- simonw 1y agoIf you know something is covered by the documentation it's useful to provide a link, especially if that documentation is difficult to find. (I couldn't find that documentation when I went looking just now.)
- geeunits 1y agoStep 1: https://docs.anthropic.com https://docs.anthropic.com Step 2: Type 'Allowed Tools' Step 3: Click: https://docs.anthropic.com/en/docs/claude-code/sdk/sdk-headless#configuration-options https://docs.anthropic.com/en/docs/claude-code/sdk/sdk-headl... Step 4: Read Step 5: Example --allowedTools "Read,Grep,WebSearch" Step 6: Profit?
- simonw 1y agoThe original question was about this: > allow zoned access enforcement within files. I want to be able to say "this section of the file is for testing", delineated by comments, and forbid Claude from editing it without permission.
- holbrad 1y agoSo you've completely misunderstood what the discussion is about... Maybe rtft ? Read the fucking thread.
- boie0025 1y agoI think you missed a critical step: 1.5: know that "allowed tools" is the correct incantation required to summon the relevant documentation; which, at least to me, is not obvious at all in the context of the OP.
- blyat 1y agoI've had some middling success with this by utilizing CLAUDE.md and language features. Two approaches in C#: 1) use partial classes and create a 'rule' in CLAUDE.md to never touch named files, e.g. User.cs (edits allowed) User.Protected.cs (not allowed by convention) and 2) a no-AI-allowed attribute, e.g. [DontModifyThisClassOrAttributeOrMethodOrWhatever] and instructions to never modify said target. Can be much more granular and Claude Code seems to respect it.