Enterprise Security Settings
{ "permissions": { "disableBypassPermissionsMode": "disable", "deny": [ "Bash(curl:*)", "Bash(wget:*)", "WebFetch" ] }, "forceLoginMethod": "console"}
Claude Code’s flexibility comes from its extensive configuration options. This guide covers essential settings to optimize your development workflow, from permission management to model selection strategies.
/Library/Application Support/ClaudeCode/managed-settings.json
(macOS).claude/settings.local.json
(not in source control).claude/settings.json
(checked into source control)~/.claude/settings.json
(applies to all projects)Settings are applied in order of precedence, with enterprise policies overriding all others.
# Launch configuration menu/config
# View current settingsclaude config list
# Set a specific optionclaude config set model claude-sonnet-4
{ "model": "claude-sonnet-4", "permissions": { "defaultMode": "acceptEdits", "allow": [ "Edit", "Bash(npm test:*)", "Bash(git:*)" ] }, "hooks": { "PostToolUse": { "Edit": "npm run lint --fix $CLAUDE_FILE_PATHS" } }}
Claude Code offers several permission modes to balance safety and productivity:
Mode | Description | Use Case |
---|---|---|
default | Prompts for each new tool use | General development |
acceptEdits | Auto-accepts file edits for session | Active coding sessions |
plan | Read-only analysis mode | Code review, architecture planning |
bypassPermissions | Skip all permission prompts | Trusted environments only |
# Launch with permissions bypassedclaude --dangerously-skip-permissions
# Equivalent to setting in configclaude --permission-mode bypassPermissions
This mode eliminates interruptions from permission prompts, significantly improving workflow speed for experienced users.
Claude Code defaults to intelligent model switching, but you can optimize for your use case:
Model | Best For | Cost | Speed |
---|---|---|---|
Claude Opus 4 | Complex reasoning, architecture | 5x | Slower |
Claude Sonnet 4 | General coding, implementation | 1x | Fast |
OpenAI o3 | Debugging complex issues | Varies | Medium |
Gemini 2.5 Pro | Large context scenarios | 2x | Fast |
# Switch models mid-session/model opus # For complex planning/model sonnet # For implementation
# Set default modelclaude config set model claude-sonnet-4
# Override per sessionclaude --model claude-opus-4
{ "model": "claude-sonnet-4", "permissions": { "defaultMode": "acceptEdits" }, "env": { "DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1", "DISABLE_COST_WARNINGS": "0" }}
Create .claude/settings.json
for team-shared settings:
{ "permissions": { "allow": [ "Edit(src/**)", "Bash(npm run:*)", "Bash(git diff:*)", "mcp__github__*" ], "deny": [ "Edit(*.env)", "Bash(rm -rf:*)" ], "additionalDirectories": ["../shared-lib"] }, "env": { "NODE_ENV": "development" }, "hooks": { "PostToolUse": { "Edit": "prettier --write $CLAUDE_FILE_PATHS" } }}
{ "claude-code.autoLaunch": true, "claude-code.defaultMode": "acceptEdits", "claude-code.theme": "dark"}
<component name="ClaudeCodeSettings"> <option name="autoLaunch" value="true" /> <option name="defaultMode" value="acceptEdits" /></component>
Optimize your terminal for Claude Code:
/terminal-setup
to configure key bindingsclaude config set -g preferredNotifChannel iterm2_with_bell
Configure persistent memory across sessions:
## Build Commands- npm run build: Production build- npm run dev: Development server- npm test: Run test suite- npm run typecheck: TypeScript validation
## Code Style- Use functional components with TypeScript- Prefer composition over inheritance- Always handle error cases explicitly
## Architecture- Frontend: Next.js with App Router- API: tRPC with Zod validation- Database: PostgreSQL with Drizzle ORM
# Project-specific settings@docs/conventions.md@~/.claude/personal-preferences.md
# Team member preferences (not in git)@~/.claude/team-configs.md
Enable powerful integrations through MCP:
{ "mcpServers": { "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" } }, "postgres": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb" ] } }}
Enable MCP servers:
# Interactive setupclaude mcp add
# Allow specific serversclaude config set enabledMcpjsonServers '["github", "postgres"]'
Automate workflows with hooks:
{ "hooks": { "PreToolUse": { "Edit": { "type": "command", "command": "echo 'Editing: $CLAUDE_FILE_PATHS'" } }, "PostToolUse": { "Edit": { "type": "command", "command": "npm run lint --fix $CLAUDE_FILE_PATHS" }, "Bash": { "type": "command", "command": "[[ \"$CLAUDE_TOOL_INPUT\" =~ test ]] && echo 'Tests complete!'" } } }}
Key environment variables for fine-tuning:
# Model configurationexport ANTHROPIC_MODEL='claude-opus-4'export ANTHROPIC_SMALL_FAST_MODEL='claude-3-5-haiku'
# Performance tuningexport CLAUDE_CODE_MAX_OUTPUT_TOKENS=8192export MAX_THINKING_TOKENS=50000
# Cost optimizationexport DISABLE_NON_ESSENTIAL_MODEL_CALLS=1
# Securityexport CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
Create reusable workflows:
Analyze this code for performance bottlenecks:- Profile execution time- Identify N+1 queries- Check for unnecessary re-renders- Suggest optimizations
Target: $ARGUMENTS
Usage:
/optimize src/components/Dashboard.tsx
Enterprise Security Settings
{ "permissions": { "disableBypassPermissionsMode": "disable", "deny": [ "Bash(curl:*)", "Bash(wget:*)", "WebFetch" ] }, "forceLoginMethod": "console"}
Token Usage
/clear
frequentlyModel Selection
/cost
command/config # Configuration menu/permissions # Manage allowed tools/model # Switch models/clear # Clear context/cost # Check token usage
High-Speed Development:
claude --dangerously-skip-permissions --model sonnet
Secure Review Mode:
claude --permission-mode plan --model opus
Cost-Conscious Setup:
{ "model": "claude-sonnet-4", "env": { "DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1" }}