claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Feature Request] Allow a user to specify an arbitrary command prepended to every bash command.

Open rescrv opened this issue 10 months ago • 0 comments

It would be useful to me to be able to sandbox every command that's run so that I can, in a custom manner, ensure that Claude only runs things that I care about, in a way that I care about. Concretely I'm working in rust. I want to disallow editing of files outside tests/, examples/, orsrc/, and generally run a sandbox (e.g. docker, a linux container, or just using ptrace to shut down any exec that's not a binary under target/.

I envision this working by allowing a single configuration parameter called CLAUDE_WRAPPER that gets shlex'd to create an array of strings. Prepend said array to the execve call to make it always invoke the wrapper.

rescrv avatar May 22 '25 19:05 rescrv