Main configuration file
Claude Code stores its configuration in ~/.claude/settings.json (global configuration) and in .claude/settings.json inside each project (local configuration, which takes priority).
# View current configuration in Claude Code: /config # Or edit directly: nano ~/.claude/settings.json
Example settings.json
{
"model": "sonnet",
"theme": "dark",
"autoUpdates": true,
"permissions": {
"allow": [
"Bash(npm:*)",
"Bash(git:*)",
"Read(**)",
"Edit(**)"
],
"deny": [
"Bash(rm -rf:*)",
"WebFetch(domain:evil.com)"
]
},
"env": {
"NODE_ENV": "development"
}
}CLAUDE.md — Project memory
The CLAUDE.md file at the root of your project is Claude Code's "memory". When you start a session, Claude reads this file automatically to understand your project's context.
Create CLAUDE.md automatically
# Inside Claude Code: /init
Claude Code will analyze your project and generate a CLAUDE.md with the structure, tech stack, important commands, and conventions.
Recommended CLAUDE.md structure
# Project: My App ## Stack - Frontend: Next.js 16 + TypeScript + Tailwind CSS - Backend: Node.js + Express + PostgreSQL - Tests: Vitest + Playwright ## Essential commands ```bash npm run dev # Start dev server (port 3000) npm run test # Run tests npm run build # Production build npm run db:migrate # Run migrations ``` ## Project structure - /app — Next.js pages (App Router) - /components — Reusable components - /lib — Utilities and configuration - /prisma — Database schema ## Conventions - Use kebab-case for file names - Components use the .tsx suffix - Tests live next to the file they test (*.test.ts) ## Important notes - The main branch is protected; work on feature branches - Local DB is at localhost:5432, user: dev, no password
Environment variables
Claude Code reads environment variables from your shell. The most important ones:
Default model
You can change the model Claude Code uses in each session. The default value depends on your account and provider; to avoid outdated IDs, use aliases like sonnet, opus, or haiku.
# In settings.json:
{ "model": "opus" }
# Or as an environment variable:
export ANTHROPIC_MODEL="opus"
# Or when starting Claude Code:
claude --model opusVS Code integration
Install the Claude Code extension from the VS Code Marketplace. After installing it, Claude Code appears in the side panel and works with the same context as your open project.
- Keyboard shortcuts: Cmd + Shift + P → "Claude Code"
- Inline suggestions while writing code
- Integrated chat panel with context from the active file
- Diff view to review proposed changes
JetBrains integration
Available on the JetBrains Marketplace for IntelliJ IDEA, PyCharm, WebStorm, etc. Same capabilities as the VS Code extension.
Proxy configuration
If you work behind a corporate proxy:
export HTTPS_PROXY="https://proxy.company.com:8080" export HTTP_PROXY="http://proxy.company.com:8080" # Then start Claude Code normally claude
Multiple profiles / projects
To use different API keys or configurations across projects, create a .claude/settings.json in each project with its own values. Claude Code detects them automatically.