[Claude] Harden allow/deny lists and clarify dev server behavior#3373
Merged
[Claude] Harden allow/deny lists and clarify dev server behavior#3373
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Claude Code configuration to allow routine read-only git inspection while hardening deny rules against destructive/irreversible CLI operations, plus a small docs clarification about dev server reload behavior.
Changes:
- Allowlisted
git diff,git status, andgit logfor non-destructive repo inspection. - Expanded deny patterns to cover additional destructive git/shell/GitHub CLI commands and broadened pattern matching with wildcards.
- Clarified in
AGENTS.mdthatnpm run devauto-reloads on code changes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| AGENTS.md | Clarifies dev server behavior (auto-reload) in the developer command reference. |
| .claude/settings.json | Expands allow/deny command patterns for Claude Code to enable read-only git commands and block destructive operations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
adamziel
reviewed
Mar 11, 2026
Co-authored-by: Adam Zieliński <adam@adamziel.com>
adamziel
reviewed
Mar 12, 2026
Contributor
The previous deny rule `Bash(*rm -rf *)` only blocked one specific form of recursive force-delete, but `-rf` can be expressed equivalently as `-fr`, `-r -f`, `-prv`, or via shell expansion — making the rule trivially bypassable. ## Changes - **`.claude/settings.json`**: Replaced `"Bash(*rm -rf *)"` with `"Bash(*rm *)"` to deny any invocation of `rm`, regardless of flags or argument ordering. <!-- START COPILOT CODING AGENT TIPS --> --- 📍 Connect Copilot coding agent with [Jira](https://gh.io/cca-jira-docs), [Azure Boards](https://gh.io/cca-azure-boards-docs) or [Linear](https://gh.io/cca-linear-docs) to delegate work to Copilot in one click without leaving your project management tool. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bgrgicak <1199991+bgrgicak@users.noreply.github.com>
adamziel
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation for the change, related issues
Updates Claude Code settings to add read-only git commands to the allow list and expand the deny list with additional destructive/irreversible operations.
Claude Code was not pre-authorized to run basic git inspection commands (
git diff,git status,git log), requiring manual approval for routine read-onlyoperations. Additionally, the deny list was incomplete — it didn't block force pushes, hard resets,
rm -rf,sudo, or merging/closing PRs via the CLI.Implementation details
Allow list additions
Added
git diff,git status, andgit logto the allow list so Claude can inspect repository state without prompting.Deny list hardening
*wildcards (e.g.*npm run release*) so they match regardless of command prefixgit push --force/-f,git push * trunk,git reset --hard,git clean -f,rm -rf,sudo,gh pr merge, andgh pr closeAGENTS.md cleanup
npm run devauto-reloads on code changes (no restart needed)Testing Instructions