English translation
Permissions, Configuration, and Security Boundaries in Claude Code: Which Commands to Allow and Which to Block

The biggest difference between Claude Code and ordinary chat tools is that it can actually interact with your project: reading files, modifying files, executing commands, and connecting to external tools. As its capabilities grow, security boundaries must be defined in advance.
My principle is simple:
- Reading code may be permitted more broadly;
- Modifying code should be scoped carefully;
- Deleting files, uploading assets, deploying, or altering databases must be handled with extreme caution.
I never enable all commands by default. Commands like reading files, running linters, or editing local source code belong in one category—while commands like deleting files, modifying databases, connecting to servers, or deploying to production belong in another, higher-risk category—and must be handled separately.
Explaining this layered approach in detail—as opposed to simply saying “be careful with security”—delivers far greater practical value. Readers can use it as a concrete framework to define permission boundaries for their own projects.
Why Permissions Matter
Letting Claude Code run npm run build is usually safe. But letting it execute rm -rf, git reset --hard, scp, systemctl restart, or database migrations requires serious scrutiny.
When configuring permissions for Claude Code, start by classifying operations into distinct risk tiers:
- Reading files
- Modifying code
- Installing dependencies
- Accessing the network
- Deleting files
- Deploying applications
These commands aren’t inherently forbidden—but you must understand their impact. Especially on production servers, user data, payment systems, secrets, keys, and certificates: never grant access just because “the AI says it’s needed.”
Managing Rules with /permissions
The official command reference includes /permissions, a built-in command for managing allow, ask, and deny rules. You can add common low-risk commands to the allow list, while reserving high-risk ones for explicit confirmation (ask) or outright blocking (deny).
When reading “Permissions, Settings, and Security Boundaries: Which Commands to Allow—and Which to Block”, treat the accompanying diagrams as navigation cards:
- First, grasp the overall flow;
- Then examine why each step matters;
- Finally, verify edge cases and boundary conditions.
Here’s my typical tiered rule set:
- Allow:
git status,git diff,rg,ls, reading files, running existing project tests. - Ask: Installing dependencies, modifying configuration files, executing deployment scripts, establishing remote connections.
- Deny: Reading private keys, printing
.envcontents, deleting large directories, resetting Git history, directly manipulating production databases.
This isn’t a rigid template—you must adapt it to your specific project context.
Don’t Copy settings.json Blindly
Claude Code settings can reside in files like .claude/settings.json. The official documentation lists many configurable options—including MCP server allowlists, hooks URL allowlists, permission rules, and auto-memory toggles.
New users shouldn’t copy-paste someone else’s full settings file right away. Instead, begin with only the minimal essential rules:
{
"permissions": {
"deny": [
"Bash(rm -rf *)",
"Read(.env)",
"Read(**/*.pem)"
]
}
}
Exact syntax depends on the official documentation and your current Claude Code version. The key idea here is progressive hardening: block obvious dangers first, then incrementally add convenience rules as needed.
Handling Sensitive Files
Common sensitive assets in projects include:
.envfiles.pemand.keyfiles- Certificate directories
- Database dumps
- Server passwords
- OAuth tokens
- Payment webhook secrets
These files must never appear in tutorials, logs, or version control history—and should never be printed out by Claude Code “for debugging.” You can let it read variable names, configuration examples, or .env.example, but never real credential values.
Tiered Deployment Commands
A failed local build causes minimal impact. A failed production deployment affects real users. So I recommend splitting deployments into three distinct phases:
To apply “Permissions, Settings, and Security Boundaries: Which Commands to Allow—and Which to Block” to your own tasks, start small: isolate and rigorously validate one critical decision point.
After studying “Permissions, Settings, and Security Boundaries: Which Commands to Allow—and Which to Block”, try adapting it to a scenario of your own—focusing specifically on whether inputs, processing logic, and outputs align coherently.
- Ask Claude Code to describe the intended deployment command.
- Have it perform local builds or tests first.
- Only then decide whether to proceed with remote deployment.
For team projects, deployment scripts should be documented and integrated into CI pipelines—not left to individual memory or ad-hoc execution.
The more familiar you become with Claude Code, the more precisely you should codify its security rules. Its purpose is to save time—not to bypass authority.
Next up: Skills and custom commands. Don’t rewrite the same prompt repeatedly for repetitive tasks—instead, formalize them as reusable tools.
References:
Continue