Skip to content

Claude Code Setup & Configuration

Getting started with Claude Code requires thoughtful setup to maximize its capabilities. These 15 tips will help you configure Claude Code for optimal performance, whether you’re working solo or as part of a team.

The Claude Code extension works with VS Code, Cursor, and Windsurf. While it’s essentially just a launcher, it provides critical benefits:

  • Quick launch from your IDE with keyboard shortcuts
  • Multiple instances in parallel panes for different parts of your codebase
  • Seamless file references between your editor and Claude Code
  • Integrated diff viewing for reviewing changes
Terminal window
# Install from VS Code marketplace
code --install-extension anthropic.claude-code

Tip 2: Use the Optimal Installation Method

Section titled “Tip 2: Use the Optimal Installation Method”

The native installer is the recommended way to install Claude Code — it self-updates in the background, so you stay on the latest version automatically:

Terminal window
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

Alternative installation methods:

Terminal window
brew install --cask claude-code

Homebrew installs do not auto-update — run brew upgrade claude-code periodically.

Tip 3: Skip Permission Prompts for Efficiency

Section titled “Tip 3: Skip Permission Prompts for Efficiency”

One of the most impactful configuration changes is bypassing constant permission requests:

Terminal window
claude --dangerously-skip-permissions

This eliminates interruptions for:

  • File editing permissions
  • Basic command execution
  • Git operations
  • Package manager commands

Security Consideration

This is similar to Cursor’s “yolo mode” and it genuinely can run destructive commands without asking. Only use it inside a trusted, sandboxed context — a devcontainer, a throwaway VM, or CI on a branch. Never enable it on untrusted code, a shared machine, or anywhere a bad rm/git push --force would hurt. For a middle ground, combine --permission-mode plan with --allow-dangerously-skip-permissions so bypassing is available but not active by default.

Tip 4: Install GitHub CLI for Enhanced Integration

Section titled “Tip 4: Install GitHub CLI for Enhanced Integration”

The GitHub CLI (gh) enables powerful Claude Code integrations:

Terminal window
# macOS
brew install gh
# Linux/WSL
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update && sudo apt install gh
# Windows
winget install GitHub.cli

After installation, authenticate:

Terminal window
gh auth login

This enables:

  • Automated PR creation and review
  • Issue management from Claude Code
  • Repository operations
  • GitHub Actions integration

Set up proper IDE integration for seamless workflow:

  1. Configure keyboard shortcuts

    // VS Code settings.json
    {
    "keybindings": [
    {
    "key": "cmd+shift+c",
    "command": "claude-code.open",
    "when": "editorTextFocus"
    }
    ]
    }
  2. Set up file associations

    {
    "files.associations": {
    "CLAUDE.md": "markdown",
    "*.claude": "markdown"
    }
    }
  3. Configure terminal integration

    Terminal window
    # Add to ~/.zshrc or ~/.bashrc
    alias cc="claude"
    alias ccc="claude --dangerously-skip-permissions"

Tip 6: Set Up Terminal for Optimal Experience

Section titled “Tip 6: Set Up Terminal for Optimal Experience”

Run the terminal setup command to configure proper key bindings:

Terminal window
claude
# Then run:
/terminal-setup

This enables:

  • Shift+Enter for new lines in prompts
  • Tab completion for commands
  • History navigation with arrow keys
  • Proper escape sequences for stopping operations

Tip 7: Use Plan Mode and opusplan for Large Projects

Section titled “Tip 7: Use Plan Mode and opusplan for Large Projects”

For large-scale refactoring and architectural work, lean on Claude Code’s real planning mechanisms rather than diving straight into edits:

  • Plan mode — Press Shift+Tab to cycle into plan mode (or launch with claude --permission-mode plan). Claude investigates and proposes a plan without touching files until you approve it.
  • opusplan model alias — Set --model opusplan so Opus does the reasoning during plan mode, then execution drops to Sonnet to save cost. See Tip 8.
  • Subagents — Delegate large, parallelizable investigations (e.g. “map every call site of this API”) to subagents so the main context stays lean.
  • --add-dir — Bring sibling repositories into scope for cross-repo refactors. See Tip 9.

When to Reach for Plan Mode

  • Refactoring entire modules or subsystems
  • Analyzing complex dependency graphs
  • Working with unfamiliar legacy codebases
  • Implementing architectural patterns across multiple files

Understand the model selection strategy for optimal results:

.claude/settings.json
{
"model": "opusplan"
}

The model field takes a single alias (opus, sonnet, haiku, opusplan, sonnet[1m]) or a full model id. There is no per-task modelPreferences map — instead you pick a default here and switch on the fly with /model <alias> mid-session, or override at startup with claude --model <alias>.

Model selection guidelines:

  • Fable 5 (fable): The highest-capability tier — complex multi-file refactorings, building from scratch, long-running tasks where quality matters more than cost. Switch with /model fable. See model comparison for plan inclusion details.
  • Opus 4.8 (opus): Complex architecture, system design, difficult debugging; raise effort for the hardest cases. The Claude Code default model.
  • Sonnet 4.6 (sonnet / sonnet[1m]): Routine development, standard features, refactoring, 1M context when needed
  • Haiku 4.5 (haiku): Simple tasks, formatting, basic code generation
  • opusplan: Best of both — Opus during plan mode, Sonnet during execution; for maximum quality use fable during planning and Opus or Sonnet for implementation

Tip 9: Set Up Multiple Working Directories

Section titled “Tip 9: Set Up Multiple Working Directories”

For projects spanning multiple repositories:

Terminal window
# Start Claude Code with multiple directories
claude --add-dir ../backend --add-dir ../frontend --add-dir ../shared
# Or add during session
/add-dir ../backend
/add-dir ../frontend

Additional directories are scoped to the session: pass --add-dir at launch or use the /add-dir slash command mid-session. To make extra directories stick across sessions, set permissions.additionalDirectories in .claude/settings.json — it persists the same access without retyping flags:

.claude/settings.json
{
"permissions": {
"additionalDirectories": ["../docs/"]
}
}

If you’d rather not commit it to project settings, wrapping the launch command in a shell alias (see Tip 5) is still a fine quick hack.

Ensure Claude Code inherits your development environment:

~/.claude/shell-init.sh
export PATH="$HOME/.local/bin:$PATH"
export NODE_OPTIONS="--max-old-space-size=8192"
source ~/.nvm/nvm.sh
# Custom aliases Claude should know about
alias build="npm run build:all"
alias test="npm run test:coverage"
alias deploy="./scripts/deploy.sh"

Document custom tools in CLAUDE.md:

# Custom Tools and Commands
- `build`: Runs full build pipeline with type checking
- `test`: Runs tests with coverage reporting
- `deploy`: Deploys to staging (requires VPN connection)

Set up your project with appropriate permissions:

Terminal window
# Fix common permission issues
find . -type f -name "*.sh" -exec chmod +x {} \;
chmod -R u+rw .claude/
# Create .claude directory with proper permissions
mkdir -p .claude/{commands,hooks,settings}
chmod 755 .claude

Tip 12: Install MCP Servers for Extended Functionality

Section titled “Tip 12: Install MCP Servers for Extended Functionality”

Model Context Protocol (MCP) servers extend Claude Code’s capabilities:

// .mcp.json (project-level)
{
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
},
"git": {
"command": "uvx",
"args": ["mcp-server-git"]
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
},
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp"]
}
}
}

Essential MCP servers for development:

  • GitHub (remote https://api.githubcopilot.com/mcp/): PRs, issues, code review
  • git (uvx mcp-server-git): local git operations
  • filesystem (@modelcontextprotocol/server-filesystem): scoped file operations
  • Playwright (@playwright/mcp): browser automation and end-to-end testing
  • Postgres: direct database access via a current community server (the reference server-postgres package is archived)

Tip 13: Use Debug Mode for MCP Troubleshooting

Section titled “Tip 13: Use Debug Mode for MCP Troubleshooting”

When MCP servers aren’t working correctly:

Terminal window
claude --debug "mcp"

This provides:

  • Detailed connection logs
  • Error messages from MCP servers
  • Configuration validation
  • Performance metrics

Common troubleshooting steps:

  1. List configured servers and their status

    Terminal window
    claude mcp list
    claude mcp get github
  2. Confirm the launchers are on your PATH

    Terminal window
    which npx # for npm-based servers
    which uvx # for Python-based servers like mcp-server-git
  3. Inspect connection logs in detail

    Terminal window
    claude --debug "mcp"

Tip 14: Set Up Project-Specific Configurations

Section titled “Tip 14: Set Up Project-Specific Configurations”

Create a comprehensive project configuration:

.claude/settings.json
{
"allowedTools": [
"Read",
"Edit",
"Write",
"Bash(git:*)",
"Bash(npm:*)",
"Bash(yarn:*)",
"Bash(pnpm:*)",
"mcp__git__*",
"mcp__github__*"
],
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "jq -r '.tool_input.file_path' | xargs -r prettier --write"
}
]
}
]
}
}

Share with your team by committing to version control:

Terminal window
git add .claude/settings.json
git commit -m "Add Claude Code project configuration"

Tip 15: Configure Allowed Tools Strategically

Section titled “Tip 15: Configure Allowed Tools Strategically”

Balance security with productivity by customizing tool permissions:

{
"allowedTools": [
"Read",
"Edit",
"Write",
"Glob",
"Grep",
"Bash(*)",
"mcp__*"
]
}

Use the /permissions command to modify during a session:

/permissions
# Select tools to allow/deny interactively

These are the prompts that turn a fresh checkout into a well-configured project. Run them inside Claude Code from your repo root.

Setup rarely fails loudly — it fails by being silently ignored. Here are the usual culprits and the fast fixes.

  • MCP server won’t connect. Run claude --debug "mcp" to see the actual error, then confirm the launcher is installed (which npx, which uvx). Python-only servers like mcp-server-git need uvx on PATH — npx will not work for them.
  • .claude/settings.json seems ignored. Check the scope and path: project settings live at .claude/settings.json in the repo root; user settings at ~/.claude/settings.json. A typo in a key (for example servers instead of mcpServers in .mcp.json, or hooks as an array instead of an object) makes Claude Code skip the block entirely with no error.
  • Permission prompts keep firing. Your allowedTools pattern probably doesn’t match. Tool names are case-sensitive (Read, not View) and Bash scoping uses the Bash(cmd:*) form. Use /permissions mid-session to add the exact rule, then copy it into settings.
  • The extension won’t launch. Reload the IDE window (Command Palette: “Developer: Reload Window”), or reinstall directly from the VS Code Marketplace.

With Claude Code properly configured, you’re ready to optimize your project context. Continue to CLAUDE.md Optimization to learn how to create effective persistent memory for your projects.