Discussion about this post

User's avatar
Andy Wheeler's avatar

Scott, these are good posts, but this does not 100% stop your agent from editing those files. It merely prevents it from using those specific tools on those specific files. It does not make it impossible to edit those files using other tools.

So if you were say having the agent write R code, the R code could modify/overwrite those files. The hook logic *cannot* prevent that, because the hook just looks at the arguments, not the actual code inside the R script.

Besides just having backups, for "you cannot edit" certain things, it has to be inherited by the claude code terminal. Like making a directory read only entirely (without sudo) is the simplest mechanism.

Alexis's avatar

So, prose is not constraints, but hooks are constraints, subject to Andy Wheeler's caveats?

5 more comments...

No posts

Ready for more?