0% found this document useful (0 votes)
70 views13 pages

Claude Code Configuration Guide

The document provides a comprehensive guide for configuring Claude Code, including API key setup, model selection, and MCP server configuration. It emphasizes the importance of proper configuration for optimizing AI development workflows and introduces features like Plan Mode and interactive permission management. Additionally, it outlines methods for managing allowed tools and expanding workspaces dynamically across multiple directories.

Uploaded by

rokoman kung
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views13 pages

Claude Code Configuration Guide

The document provides a comprehensive guide for configuring Claude Code, including API key setup, model selection, and MCP server configuration. It emphasizes the importance of proper configuration for optimizing AI development workflows and introduces features like Plan Mode and interactive permission management. Additionally, it outlines methods for managing allowed tools and expanding workspaces dynamically across multiple directories.

Uploaded by

rokoman kung
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Configuration

Configuration
Complete Claude Code configuration with comprehensive setup guides for API
keys, model selection, MCP servers, tool permissions, and multi-directory
workflows. Essential settings for optimizing your AI development experience.

LATEST POSTS
Plan Mode separates research and analysis from execution in Claude Code,
significantly improving safety. Claude won't edit files or run commands until
you approve the plan. Activate with Shift+Tab twice for structured planning
without unwanted changes. Learn more about Plan Mode ↗

VERIFY AT ENTERPRISE SCALE (ad)


Experience Verdent ↗'s reliable verification system with multipass
generate–test–repair cycles until acceptance. DiffLens provides
transparent code review with detailed summaries, timelines, and
causal flows for production-ready results.
Discover Verdent AI (Free Trial) ↗

API Key Setup


To use Claude Code, a user must have a Claude Pro subscription, a Claude Max
subscription, or an Anthropic API key. You can set it up with an API key by following
these methods:
# Option 1: Environment variable (recommended)
export ANTHROPIC_API_KEY="your-api-key-here"

# Option 2: Add to your shell profile


echo 'export ANTHROPIC_API_KEY="your-api-key-here"' >> ~/.bashrc
source ~/.bashrc

Model Selection
Claude Code supports multiple models. You can specify which model to use:
Claude Sonnet 4.5: Latest balanced performance and speed

export ANTHROPIC_MODEL="claude-sonnet-4-5-20250929"

Claude 4.5 Opus: State-of-the-art software engineering with enhanced Plan Mode

export ANTHROPIC_MODEL="claude-opus-4-5-20251101"

Claude 4 Opus: Previous generation maximum capability model

export ANTHROPIC_MODEL="claude-opus-4-20250514"

Claude 3.5 Haiku: Fastest and most cost-effective

export ANTHROPIC_MODEL="claude-3-5-haiku-20241022"

Important limitations: Claude 3.5 Haiku


Alternative Method: You can also specify the model directly when starting Claude
Code:

claude --model claude-sonnet-4-5-20250929


claude --model claude-opus-4-5-20251101
claude --model claude-opus-4-20250514
claude --model claude-3-5-haiku-20241022

Model Switching During Session


You can switch models mid-session using the /model command, which provides an
interactive menu:

/model

Available Options:
1. Default (recommended) - Opus 4.5 with generous limits (Max users have
roughly same tokens as previously had with Sonnet), automatic fallback to
Sonnet 4.5 when needed
2. Opus - Opus 4.5 for state-of-the-art software engineering
3. Sonnet - Sonnet 4.5 for daily use
4. Opus 4.5 Plan Mode - Use Opus 4.5 in plan mode, Sonnet 4.5 otherwise ✔
Opus 4.5 Plan Mode Features
Opus 4.5 brings enhanced Plan Mode with interactive planning:
Clarifying questions upfront - Asks about ambiguous requirements before
planning
Editable [Link] files - Review and modify plans before execution begins
More precise execution - Better task breakdown with 76% fewer tokens
The Opus Plan Mode automatically switches between models based on context,
using Opus 4.5 for research and planning phases, then Sonnet 4.5 for
implementation and execution.
Model Name Validation
Starting with v1.0.111 , the /model command validates provided model names to
ensure they're correctly specified and supported. This prevents errors from typos or
unsupported model requests:

/model claude-4-sonnet # Valid - switches successfully


/model invalid-model # Invalid - shows validation error
/model opus # Valid - uses model alias

Validation ensures immediate feedback rather than failing during actual model
requests.

MCP Configuration
Model Context Protocol (MCP) allows Claude Code to connect to external tools and
services. Configure MCP servers to extend Claude's capabilities:
MCP Server Setup
MCP configuration can be stored in multiple locations:
Project-scoped MCP: .[Link] (in your project directory, version-controlled)
Project-specific: .claude/[Link] (in your project directory)
User-specific local: ~/.claude/[Link]
User-specific global: ~/.claude/[Link]
Main [Link]: ~/.[Link]
Dedicated MCP file: ~/.claude/mcp_servers.json
Example MCP configuration:
// Example: ~/.[Link] (recommended for reliability)
{
"projects": {
"/path/to/your/project": {
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/username/Des
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
},
"fetch": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-fetch"]
}
}
}
},
...
}

Note: If following this example ensure you update the right projects configuration.
For additional tools and integrations beyond MCP, explore our Add-ons ↗.
Project-Scoped MCP Configuration
Project-scoped MCP configuration uses .[Link] files in your project directory,
enabling version-controlled, team-shared MCP server definitions.
Benefits:
Team Collaboration - Share MCP configurations via version control
Project Isolation - Different projects can have different MCP setups
Simplified Onboarding - New team members get MCP servers automatically
Version Control - Track changes to MCP configurations alongside code
Example .[Link] :

{
"mcpServers": {
"reddit": {
"command": "node",
"args": ["/Users/username/reddit/build/[Link]"]
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}

Project MCP Server Control:


To enable project-scoped MCP servers, add one of these settings to your
.claude/[Link] :

{
"enableAllProjectMcpServers": true
}

Automatically approves ALL MCP servers defined in project .[Link] files

{
"enabledMcpjsonServers": ["memory", "github"]
}

Whitelist specific servers from .[Link] files to approve

{
"disabledMcpjsonServers": ["filesystem"]
}
Blacklist specific servers from .[Link] files to reject
Choose the approach that best balances convenience with your security
requirements.

UI Settings
Configure Claude Code's interface behavior and visual elements to match your
workflow preferences.
Spinner Tips Configuration
Control whether helpful tips appear during loading animations by adding the setting
to your project's .claude/[Link] :

{
"spinnerTipsEnabled": false // Disable spinner tips for cleaner interface
}

Benefits of disabling:
Reduced visual distractions during focused work
Cleaner interface for minimalist preferences
Faster visual processing without constant tip notifications

Attribution Settings
Control how Claude Code attributes its contributions to commits and pull requests
( v2.0.62 ):

{
"attribution": {
"commits": true, // Include Co-Authored-By in commits
"pullRequests": true // Include Claude Code footer in PRs
}
}

Note: This setting deprecates the previous includeCoAuthoredBy option. See


Attribution Setting FAQ ↗ for migration details.

Allowed Tools
Allowed Tools Setup
Allowed tools configuration can be stored in multiple locations:
Project-specific: .claude/[Link] (in your project directory)
User-specific local: ~/.claude/[Link]
User-specific global: ~/.claude/[Link]
Main [Link]: ~/.[Link]
Example Allowed Tools configuration:

// Example: ~/.[Link] (recommended for reliability)


{
"projects": {
"/path/to/your/project": {
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/username/Des
}
},
"allowedTools": [
"Task",
"Bash", ⚠️
// Dangerous: allows all system commands
"Bash(git log:*)", // Safer: only allows git log commands
"Glob",
"Grep",
"LS",
"Read",
"Edit",
"MultiEdit",
"Write",
"WebFetch",
"WebSearch"
]
}
},
...
}

Note: If following this example ensure you update the right projects configuration.
Interactive Permission Management
For a more user-friendly approach to managing tool permissions, use the
/permissions command within Claude Code:

# Launch the interactive permissions UI


/permissions

This advanced interface allows you to:


View current permissions - See which tools are currently allowed or denied
Explicitly allow tools - Grant permission to specific tools or tool patterns
Explicitly deny tools - Block access to tools you want to restrict
Navigate visually - Use an intuitive UI instead of manually editing JSON files
The /permissions interface provides real-time permission management with a fluid,
responsive experience that makes configuration changes effortless—no need to
restart Claude Code or manually edit configuration files.

TIP
Multiple configuration locations exist due to legacy compatibility - you might
encounter different file names and directory locations.
Recommendation: Use ~/.[Link] for reliability as shown in the examples
above.

Additional Working Directories / Extended


Workspace
Claude Code can access multiple directories beyond your current working
directory using:
CLI argument: --add-dir (added in v1.0.18 ↗) when starting Claude Code
Slash command: /add-dir mid-session for seamless workflow expansion
This allows you to work across multiple projects or reference external resources
without changing directories or restarting your session.
Usage
CLI Argument (at startup):

# Add a single additional directory


claude --add-dir /path/to/other/project

# Combine with other options


claude --add-dir ~/shared/libraries

# Use with print mode for scripting


claude --add-dir ../backend -p "Validate that API calls in the current directory match e

Slash Command (mid-session):


# Add directory without restarting your session
/add-dir /path/to/other/project

# Add multiple directories as needed


/add-dir ~/shared/libraries
/add-dir ../backend-api

Common Use Cases


Multi-Repository Projects

# At startup: Work on frontend while referencing the backend API


claude --add-dir ../backend-api

# Mid-session: Add backend when you need to reference API endpoints


/add-dir ../backend-api

Shared Resources

# At startup: Access shared configs or documentation


claude --add-dir ~/company/shared-configs

# Mid-session: Add shared resources when needed


/add-dir ~/company/shared-configs

Dynamic Workflow expansion

# Start with current project, then expand as needed


# No need to restart when you realize you need additional context
/add-dir ../related-service
/add-dir ~/templates

Note: The current working directory is always included. [Link] files appear to
not be read in automatically from additional directories added via --add-dir .
BETTER WORKFLOW ORCHESTRATION
This feature significantly improves workflow orchestration by enabling Claude
to:
Work across repositories simultaneously—maintaining context and
applying consistent changes
Reference shared code directly from libraries or configuration repositories
Temporarily expose a codebase for Claude to analyze or modify without
changing directories
Expand workspace dynamically using /add-dir without interrupting your
current session
The /add-dir slash command makes this particularly seamless—you can start
focused on one project and organically expand your workspace as needs
emerge, without losing context or restarting. Instead of juggling multiple
sessions or copying files, you can compose multiple repositories within the
same workflow structure—orchestrating complex multi-repository operations
in a single, context-aware session.

CONFIGURATION MASTERY
Proper configuration is the foundation of effective Claude Code
usage. Understanding these settings enables sophisticated
workflows and unlocks the full potential of AI-assisted development.

CREATE WITHOUT LIMITS WITH VERDENT (ad)


Verdent ↗ empowers developers to take on tougher challenges by
combining human vision with intelligent automation. With Verdent ↗,
you can accelerate innovation, push creative boundaries, and
transform ideas into production-ready results.
Discover Verdent AI (Free Trial) ↗
See Also: Pricing Plans ↗ | [Link] Guide ↗ | MCPs & Add-ons ↗ | FAQs ↗

Last updated on Dec 10, 2025

You might also like