Aulafy

Configuration

Claude Code is highly configurable. Learn how to customize its behavior, model, memory, and global or per-project preferences.

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).

TerminalCode
# Ver configuración actual dentro de Claude Code:
/config

# O editar directamente:
nano ~/.claude/settings.json

Example settings.json

TerminalCode
{
  "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

TerminalCode
# Dentro de 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

TerminalCode
# Proyecto: Mi App

## Stack
- Frontend: Next.js 16 + TypeScript + Tailwind CSS
- Backend: Node.js + Express + PostgreSQL
- Tests: Vitest + Playwright

## Comandos esenciales
```bash
npm run dev          # Iniciar dev server (puerto 3000)
npm run test         # Ejecutar tests
npm run build        # Build de producción
npm run db:migrate   # Ejecutar migraciones
```

## Estructura del proyecto
- /app — Páginas Next.js (App Router)
- /components — Componentes reutilizables
- /lib — Utilidades y configuración
- /prisma — Schema de base de datos

## Convenciones
- Usa kebab-case para nombres de archivos
- Los componentes llevan sufijo .tsx
- Los tests van junto al archivo que prueban (*.test.ts)

## Notas importantes
- La rama main está protegida, trabaja en feature branches
- La DB local está en localhost:5432, usuario: dev, sin contraseña

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.

TerminalCode
# En settings.json:
{ "model": "opus" }

# O como variable de entorno:
export ANTHROPIC_MODEL="opus"

# O al iniciar Claude Code:
claude --model opus

VS 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:

TerminalCode
export HTTPS_PROXY="https://proxy.empresa.com:8080"
export HTTP_PROXY="http://proxy.empresa.com:8080"
# Luego inicia Claude Code normalmente
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.