Claude Code is the agentic coding interface that gives Opus 4.6 direct access to your terminal, file system, and development tools. Unlike chat-based coding assistants that see one file at a time, Claude Code operates with full project context — and with Opus 4.6’s 1M token window, “full project context” can mean your entire repository.
Installing Claude Code
# Install globally via npm
npm install -g @anthropic-ai/claude-code
# Verify installation
claude --version
# Authenticate
claude auth login
After authentication, Claude Code uses your Anthropic API key or Claude Pro subscription. For team environments, configure organization-level access:
# Set organization ID for billing
export ANTHROPIC_ORG_ID="org-..."
# Or configure via claude settings
claude config set organization "org-..."
Project Initialization
Navigate to your project root and initialize:
cd /path/to/your/project
claude init
This creates a .claude/ directory with default configuration:
.claude/
├── config.json # Project-level settings
├── context.md # Persistent project context
├── commands/ # Custom slash commands
│ └── review.md # Example: /review command
└── rules/ # Behavioral rules
└── coding-style.md # Code style constraints
The .claude/config.json File
This is the control center for Claude Code’s behavior in your project:
{
"model": "claude-opus-4-6-20260205",
"maxTokens": 16384,
"thinking": {
"type": "adaptive",
"budgetTokens": 20000
},
"context": {
"autoInclude": [
"src/**/*.ts",
"tests/**/*.ts",
"package.json",
"tsconfig.json"
],
"exclude": [
"node_modules/**",
"dist/**",
"*.lock"
],
"maxContextTokens": 500000
},
"permissions": {
"fileWrite": true,
"terminalCommands": true,
"gitOperations": true,
"networkRequests": false
}
}
Key Configuration Decisions
| Setting | Conservative | Aggressive | When to Use Aggressive |
|---|---|---|---|
maxContextTokens | 200,000 | 800,000 | Large monorepo, cross-cutting refactors |
thinking.budgetTokens | 5,000 | 50,000 | Complex architectural decisions |
permissions.gitOperations | false | true | Trusted CI environments |
permissions.networkRequests | false | true | Never in production code |
Writing Effective Project Context
The .claude/context.md file is the single most impactful configuration. It persists across every conversation and tells Claude Code what it needs to know about your project:
# Project Context
## Architecture
This is a TypeScript monorepo using Turborepo. Three packages:
- `packages/api` — Express REST API (Node 20, PostgreSQL)
- `packages/web` — Next.js 15 frontend (React 19, TailwindCSS 4)
- `packages/shared` — Shared types and utilities
## Critical Conventions
- All database queries go through the repository pattern in `packages/api/src/repos/`
- Never use raw SQL outside repository files
- Error handling uses the Result<T, E> pattern — never throw exceptions
- All API endpoints require authentication middleware unless explicitly marked public
## Testing Requirements
- Unit tests: Vitest, co-located with source files as `*.test.ts`
- Integration tests: `packages/api/tests/integration/`
- E2E tests: Playwright in `packages/web/e2e/`
- Minimum coverage: 80% for new code
## Known Landmines
- `packages/api/src/legacy/` — Do not refactor. Scheduled for removal Q3.
- The `UserService` class has circular dependency with `AuthService`. Work around it.
- PostgreSQL connection pool max is 20. Never add queries inside loops.
This context document prevents Claude Code from violating project conventions that would take a human reviewer seconds to catch but an AI hours of back-and-forth to learn.
IDE Integration
VS Code Integration
// .vscode/settings.json
{
"claude.enabled": true,
"claude.model": "claude-opus-4-6-20260205",
"claude.contextMode": "project",
"claude.autoContext": {
"includeOpenFiles": true,
"includeGitDiff": true,
"includeTerminalOutput": true
}
}
JetBrains Integration
<!-- .idea/claude.xml -->
<component name="ClaudeSettings">
<option name="model" value="claude-opus-4-6-20260205" />
<option name="contextMode" value="project" />
<option name="includeProjectStructure" value="true" />
</component>
Leveraging the 1M Token Context Window
The 1M token window changes how you work with Claude Code. Previously, you had to carefully select which files to include. Now you can load entire subsystems:
# Check how many tokens your project uses
claude context estimate
# Example output:
# src/ → 142,000 tokens
# tests/ → 68,000 tokens
# docs/ → 31,000 tokens
# config files → 4,200 tokens
# Total: 245,200 tokens (24.5% of 1M limit)
Context Loading Strategy
graph TD
A[Project Size] --> B{< 200K tokens?}
B -->|Yes| C[Load everything]
B -->|No| D{< 800K tokens?}
D -->|Yes| E[Load src + tests + configs]
D -->|No| F[Load target subsystem only]
C --> G[Full codebase awareness]
E --> G
F --> H[Subsystem-level awareness]
G --> I[Cross-cutting refactors possible]
H --> J[Focused changes only]
Practical Example: Loading a Large Codebase
# For a medium project (200-500K tokens)
claude --context-mode project "Analyze the authentication flow
from login endpoint to JWT validation to middleware enforcement.
Map every file involved."
# For a large monorepo — target specific packages
claude --include "packages/auth/**" \
--include "packages/api/src/middleware/**" \
--include "packages/shared/src/types/auth*" \
"Audit the entire auth subsystem for token refresh vulnerabilities"
Custom Slash Commands
Create reusable workflows in .claude/commands/:
<!-- .claude/commands/review.md -->
# Code Review
Review the staged git changes with the following checklist:
1. Correctness: Does the code do what it claims?
2. Security: Any injection, auth bypass, or data exposure risks?
3. Performance: Any N+1 queries, unbounded loops, or memory leaks?
4. Testing: Are the changes adequately tested?
5. Conventions: Does it follow our project conventions from context.md?
Output format:
- 🔴 Critical — Must fix before merge
- 🟡 Warning — Should fix, acceptable to defer
- 🟢 Suggestion — Nice to have
Use it:
# Run custom review command
claude /review
# Or with additional context
claude /review --focus security
Permission Model
Claude Code operates on a permission system that you control:
# Interactive mode — asks before each action
claude --permission-mode interactive
# Auto-approve reads, ask for writes
claude --permission-mode cautious
# Full autonomy (CI/CD environments only)
claude --permission-mode autonomous
Security rule: Never use
autonomousmode on production codebases without a git safety net. Always work on a branch with uncommitted change protection.
Verifying Your Setup
Run this checklist to confirm everything is configured:
# 1. Claude Code is installed and authenticated
claude --version && claude auth status
# 2. Project context is loaded
claude context list
# 3. Model is set to Opus 4.6
claude config get model
# Expected: claude-opus-4-6-20260205
# 4. Quick functionality test
claude "List the top 3 files in this project by complexity.
Explain why each is complex."
If all four steps succeed, your Claude Code environment is ready for the autonomous refactoring and vulnerability discovery workflows in the following lessons.