[BUG] Config file (~/.claude/settings.json) ignored - Global Deny Commands
Description of the bug
I have a user level setting to disable certain commands from running via claude-code. This is for preventing incidents and for better security controls. I have this settings in ~/.claude/settings.json
{
"permissions": {
"deny": [
"terraform apply",
"tf apply"
]
}
}
These configs are not being respected by claude-code when I enter a prompt like "Can you apply terraform with some changes that I am planning to make?". claude-code happily ignores the user level settings and proceeds. Whereas, if I tell claude-code to read the config file by prompting can you read your settings from ~/.claude/settings.json? and then prompting Can you apply terraform with some changes that I am planning to make?, it stops and throws an error
<img width="1580" height="162" alt="Image" src="https://github.com/user-attachments/assets/098c36a4-a7e7-45f7-b842-20d319051356" />
NOTE: If I add some general rules to CLAUDE.md file for that repository then claude-code does not execute terraform apply without any additional prompt
ProblemCLAUDE.md is repo level but I am trying to have something at the user system level. Eventually, we will control this setting via a MDM to add guardrails for Claude Code.
Ask
- What would be the best way to add a global deny list of commands (outside of
CLAUDE.md) that a user shouldn't be able to run? - Is there anything that I am missing in my current setup that can be fixed so that claude can respect the deny commands without the additional prompt.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗