Ability to tightly constrain which files must or may be read or edited
Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 6 comments · opened Mar 4, 2025 · closed May 8, 2025
💡 Likely answer: A maintainer (bcherny, collaborator)
responded on this thread — see the highlighted reply below.
We'd like to be able to pass in list of glob patterns (e.g. bla.txt or **/boop.md etc) that tell claude which file paths
- _must be edited_
- _may be edited_
- _may be created_
- _may be read_ (or perhaps in that case may _not_ - like
.cursorignore) - _must be read_ (meaning they are always included in the context
Our specific usecase is non-interactive, so it'd be great if this could be passed in via CLI
6 Comments
Oh interesting. Will keep this open for tracking. Would love to hear if others have similar use cases.
In general, prompting should work well for this. Have you tried just adding all of this to your prompt?
This is a no brainer. Please add it. Cursor implements this nicely. Maybe look at their implementation for inspiration?
I wanted to note a couple things here:
.aiignoreand this could be a nice standardised format for the 4th category of suggested controls (as opposed to proliferating standards for .cursorignore .claudeignore etc.)> "a dynamic resource... The client application can send the application some information about the user about the file system that they're working in, and the server can interpolate that into this more complex data structure and send that back to the client application. Inside Claude for Desktop, resources manifest as attachments, so when you interact with a [MCP] server, when you click into our UI and then select a resource, it gets attached to the chat and optionally sent to the model for whatever the user is working on. Resources could also be automatically attached, you could have the model decide "Hey I see that there's this list of resources, this one is super relevant to the task we're working on right now, let me automatically attach this to the chat", or send it to the model, and then proceed from there..."
Also in case it's worth mentioning, the point of this section of the talk is that resources are application controlled (as opposed to model/user-controlled), which I imagine would determine where this would go. In the example above indeed it is the agent (CLI), but in another scenario it could also be the IDE.
Absolutely critical for a next addition TBH.
Prompting is okay but we all know how it can get when context is long and it's dealing with multiple changes in one go.
Having hard-and-fast deterministic rules for context management as well as targeted edits are crucial. Without this, I will not be able to use CC for anything beyond small toy projects.
You can now do this with read/write permission rules! Would love your feedback: https://docs.anthropic.com/en/docs/claude-code/settings#permissions
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.