chore: reduce claude permissions #1276
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important
Reduces Bash command permissions in
.claude/settings.jsonby removingcat,head, andtail.Bash(cat:*),Bash(head:*), andBash(tail:*)from theallowlist in.claude/settings.json.Bash(find:*),Bash(rg:*),Bash(grep:*), andBash(ls:*)in theallowlist.This description was created by
for 5e8755c. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Summary
This PR implements a security hardening measure by reducing Claude AI assistant's bash command permissions in the
.claude/settings.jsonconfiguration file. The change removes three direct file content viewing commands (cat,head, andtail) from Claude's allowed bash operations while preserving essential file discovery and search capabilities (find,rg,grep,ls).This modification follows the principle of least privilege by limiting Claude's access to only the minimum permissions necessary for its intended functionality. Claude can still effectively locate files using
findandls, and search through file contents usingrg(ripgrep) andgrep, but it can no longer directly display file contents throughcat,head, ortailcommands.The change fits into the broader codebase security posture by reducing the potential attack surface and limiting exposure of sensitive information that might be contained in files. This is particularly important in a development environment where configuration files, API keys, or other sensitive data might be present.
Confidence score: 5/5