Allow specifying allowedTools for all projects

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 4 comments · opened Apr 28, 2025 · closed May 8, 2025
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

It's very helpful that claude-code remembers allowedTools for a single repo by storing the permitted tools in ~/.claude.json, but everytime I start work in a new repo, I start from scratch and have to either educate claude, or run the CLI with a long list of options. It'd be helpful if there was a configuration option for specifying allowedTools that applied globally.

View original on GitHub ↗

4 Comments

ericaltendorf · 1 year ago

I've spent a good hour or two trying to figure out how to set this up in various of the config files, the command line options. Claude itself has led me in circles on this.

Is this really not possible currently? That's kind of mind-boggling.

dave-shawley · 1 year ago

I used the /allowed-tools command within claude code to do this. When adding a new rule, you are prompted for the scope -- project (local), project, or user. If you add a tool at the user scope, it is stored in ~/.claude/settings.json currently. A co-worker and I stumbled into this solution yesterday and it is documented in the Claude Code Settings page.

!Image

Empirically we discovered that the "permission required" column from https://docs.anthropic.com/en/docs/claude-code/security#tools-available-to-claude is ignored for relative references to parent directories. For example, Read(../../parent/item) prompts for permission whereas Read(path/to/child/item) does not. Adding Read to the list of allowed tools in ~/.claude/settings.json "fixes" this.

Important note the allowed / rejected tools configuration exists in ~/.claude/settings.json. Settings that are managed by claude config (ls|set|get) -g are in ~/.claude.json.

bcherny collaborator · 1 year ago

Yep, exactly^

github-actions[bot] · 1 year ago

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.