Claude Code
The Complete Guide – From First Steps to Expert Knowledge
Author: Christian Drapatz
Disclaimer
The contents of this website are based on personal experience as well as publicly accessible sources such as documentation, training, videos and community contributions. All content has been independently compiled, summarized and formulated in our own words. There is no verbatim reproduction of protected content. The tutorials provided are free of charge and serve solely for knowledge transfer. Despite careful creation, no warranty can be assumed for completeness or timeliness. All mentioned brands, products and technologies are the property of their respective owners.
1 Introduction – What is Claude Code?
Claude Code is Anthropic's terminal-based AI agent for software development. The decisive difference from a chat assistant: Claude Code works directly in the project. It reads the codebase, executes commands, writes and edits files – all from the terminal.
Three characteristics make Claude Code special:
- Context: On startup, it automatically loads CLAUDE.md – a briefing file with project context, conventions and rules.
- Extensibility: Reusable workflows can be saved as Skills and called via slash command. External services like GitHub, databases or browsers integrate via MCP servers.
- Autonomy: With Auto Mode and Worktrees, Claude Code can independently build, test and commit complete features.
This guide leads from the first start to a fully configured setup. The learning path in Chapter 21 shows how to proceed step by step without overcommitting.
2 Quick Start in 10 Minutes
Five steps to get started right away:
- Install: Open terminal and start the installer.
curl -fsSL https://claude.ai/install.sh | bash
Then reopen the terminal. - Start: Change to the project directory and
claudeenter. On first launch, browser login occurs. - Privacy: Immediately after login, under claude.ai → Settings → Privacy → Help Improve Claude set to Off .
- Initialize:
/initenter – Claude analyzes the project and creates CLAUDE.md automatically. - Get Started: Formulate task, Shift+Tab for Plan Mode, review plan, then have it implemented.
Note: You don't need to configure anything manually. Just ask Claude Code what you need – it creates the right configuration. CLAUDE.md ensures everything is loaded on the next start.
3 Prerequisites, Plans and Models
3.1 Pricing Plans at a Glance
A paid Anthropic account is mandatory – the free Claude.ai plan does not work. Authentication is available via Subscription login or API Key.
| Plan | Price | Model (Default) | When Suitable |
|---|---|---|---|
| Pro | approx. $20/month | Sonnet 4.6 | Solo, occasional coding |
| Max | approx. $100–200/month | Opus 4.7 | Solo, multiple hours daily; complex refactorings |
| Team Standard | approx. $25/seat (min. 5) | Sonnet 4.6 | Teams; contractually no training on your data |
| Team Premium | approx. $125/seat | Opus-equivalent | Teams with Max-like needs |
| Enterprise | Custom Pricing | Custom | SSO, Audit-Logs, Zero-Data-Retention |
| API directly | Pay-per-Use | Freely selectable | Sensitive codebases; 7 days retention, no training |
Rule of thumb: Start with Pro. If limits become noticeable after two weeks, switch to Max. For sensitive code, choose Team or API directly.
3.2 Models and Effort-Levels
| Model | Strength | When to use |
|---|---|---|
| Opus 4.7 | Highest quality, slower | Architecture, complex refactorings, security reviews |
| Sonnet 4.6 | Good quality/speed balance | Daily coding, building features |
| Haiku 4.5 | Fast and inexpensive | Browsing, simple searches, routine checks |
Model switching with /model opus, /model sonnet or /model haiku. Opus 4.7 supports Effort-Levels with /effort:
| Level | Typical tasks |
|---|---|
low | Rename file, build command, simple searches |
medium | Write functions, small refactors |
high | Multi-file refactors, complex debugging |
xhigh | Default with Opus 4.7 – Architecture, design decisions |
max | Hardest debugging, security reviews, edge cases (current session only) |
Tip: max automatically switches back after the session to xhigh – this protects against accidental token burning.
3.3 Usage Limits
Every plan has daily and weekly quotas. Check limits:
/statusin the Terminal – shows plan, model status and remaining usageclaude.ai/settings/usagein the Browser – complete breakdown of all quotas
| Category | Description |
|---|---|
| Current Session | Consumption of the current session across all models. |
| All Models | Weekly total limit across Opus, Sonnet and Haiku combined. |
| Sonnet Only | Sonnet usage counts simultaneously towards this limit as well as the weekly and 5-hour session limit. |
| Claude Design | In research preview with its own weekly limit. Does not count towards other limits. |
| Additional Usage | Can be enabled to continue using Claude after reaching a limit. Activates API mode for paid overage. |
Note: When a limit is reached, Claude responds with an error message. The limit resets automatically daily, hourly, or weekly depending on the category.
4 Installation
There are two ways: the Terminal CLI and the Desktop App. Both share login and configuration.
Terminal Installation (recommended)
No more Node.js required – runs directly as a binary and updates automatically:
# macOS / Linux
curl -fsSL https://claude.ai/install.sh | bash
# Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex
# macOS via Homebrew (manuelles Update)
brew install claude-code
After installation:
claude --version # Version prüfen
claude doctor # Diagnose
claude # Starten und Browser-Login
Desktop App
Download at claude.com/download. The app provides parallel sessions in isolated Git worktrees as well as a tab for local and cloud sessions.
Updates
claude update # Sofortiges Update
brew upgrade claude-code # Bei Homebrew
5 Privacy and Security
These settings belong before your first real session.
5.1 Mandatory Setting Before First Session
Important: Immediately after login: claude.ai → Settings → Privacy → Help Improve Claude → Off
Without this setting, sessions have five years retention instead of 30 days and flow into model training. Applies to all Consumer plans (Pro and Max). Team and Enterprise plans have contractually shorter retention.
5.2 What Claude Transmits
Every file Claude reads is transmitted in full to Anthropic's servers – it does not automatically scan the project, but every explicitly read file is transmitted. Particularly sensitive:
.envFiles with API keys and passwords- Certificates (
.p12,.mobileprovision) and SSH keys - Medical, legal, or otherwise protected data
Exclude files with .claudeignore
How .gitignore prevents .claudeignore automatic reading of certain files:
# .claudeignore
/Config/Secrets/
*.env
**/TestData/real_patients/**
/Resources/Credentials/
Attention: If Claude is explicitly instructed to read a .claudeignorefile, it will still be transferred. The file only protects against automatic access.
Behavior rules in CLAUDE.md
For regulated projects, a data protection block in the CLAUDE.md is recommended:
# Datenschutz
NIEMALS lesen:
- /TestData/ (Patientendaten)
- Dateien mit "patient", "versicherte" oder "KV-Nummer" im Namen
- /Config/Live/*.json (Produktionskonfiguration)
Use in regulated environments
Claude Code processes requests on US servers (AWS). For GDPR and SGB V relevant health data:
| Approach | Suitability | Effort |
|---|---|---|
| Transfer only code, never real data | Practically suitable | Low |
| Use anonymized / fictitious test data | Recommended | Medium |
| .claudeignore + CLAUDE.md data protection block | Mandatory in the project | Low |
| Conclude Anthropic Enterprise plan with DPA | Legally sound | High |
| Local model (e.g. Ollama) as alternative | Completely offline | High |
Golden rule: Claude Code is a tool for code – not for data. Those who keep that separation clean can use Claude Code productively even in regulated environments.
5.3 How Claude Code protects you
- Read-only by default: Prompts before every edit and every Bash command.
- Write limit: Only start directory and subdirectories – therefore always start in the project root.
- Command Blocklist:
curlandwgetare blocked by default. - Prompt Injection Protection: Web-Fetch content is handled so that injected instructions do not automatically lead to tool calls.
Important: Permissions protect against actions, not against data leakage. If Claude is allowed to read a file, its content goes to Anthropic. Therefore, explicitly block secrets files using a Deny rule.
6 First Steps and Daily Commands
6.1 Starting in the Project
cd mein-projekt
claude
On first start: select theme, browser login, claude doctor for verification. Then /init enter – this generates a CLAUDE.md with project context, build commands, and conventions. This file is automatically loaded in every subsequent session.
6.2 The Most Important Slash Commands
| Command | Function |
|---|---|
/init | Automatically generates a CLAUDE.md for the project |
/clear | Deletes the current conversation – fresh start, saves tokens |
/compact | Compresses the context when the window is full |
/usage | Dashboard: plan limits, daily costs, streaks |
/status | Display plan, active model, and usage limits |
/cost | Quick display of current session costs |
/review | Code review of recent changes |
/model | Model switching, e.g. /model opus |
/effort | Effort level: low / medium / high / xhigh / max |
/mcp | Manage MCP connections and check status |
/memory | Display and edit loaded CLAUDE.md |
/ultrareview | Multi-stage in-depth code review |
/loop | Self-paced loops for repeated tasks |
/permissions | Request allowlist suggestion from previous tool calls |
Session Management
claude -c # Letzte Session fortsetzen
claude -r "name" # Session per Name fortsetzen
@datei.swift # Datei in den Kontext laden
@Sources/Views/ # Ordner in den Kontext laden
6.3 Modes
Shift+Tab switches between modes:
- Normal: Asks before every action.
- Auto-Accept: Actions without confirmation, unless blocked by Deny. For long sessions in a pushed branch.
- Plan Mode: Read-only – Claude creates only a plan. Ideal for the Analyze-Plan-Build workflow.
- Auto Mode (Max-Plan): Claude makes decisions completely independently. Not for production deploys.
7 CLAUDE.md – The Project Memory
CLAUDE.md is the most important file in the setup. It is automatically loaded on every session and gives Claude the context that he would otherwise have to guess anew each time.
7.1 What Belongs In It
Answer four questions, nothing more:
- What is the project? (Stack, platform targets, language)
- How is it built and tested? (Build and test commands, tooling)
- What conventions apply? (Code style, folder structure, architecture rules)
- What should Claude not do? (Prohibitions, taboo areas)
Does not belong: Tutorials, lengthy explanations, marketing, documentation texts. The file is a briefing card, not a wiki. Maximum 200 lines.
7.2 Where the File Is Located
Contents are merged, not overwritten:
~/.claude/CLAUDE.md– global, applies to all projectsCLAUDE.mdin the project root – applies only to this project (commit to repo!)CLAUDE.local.mdin the project root – personal, not in Git- Subfolder CLAUDE.md – is only loaded when working there
7.3 Example and Best Practices
Global CLAUDE.md (~/.claude/CLAUDE.md):
# Allgemein
Antworte auf Deutsch.
Halte dich kurz.
Bei größeren Änderungen erst einen Plan vorschlagen.
# Verbote
Niemals Inhalte aus .env oder secrets/ lesen.
Kein git push --force ohne explizite Bestätigung.
Project CLAUDE.md (Example Swift / SwiftUI):
# Projekt
SwiftUI-App, Targets: macOS, iPadOS, iPhone
# Build
xcodebuild -scheme AppName \
-destination "platform=iOS Simulator,name=iPhone 16"
# Navigation
- iPhone: NavigationStack
- macOS/iPadOS: NavigationSplitView
# Verbote
Keine DispatchQueue – nur async/await.
Tip: Create the global file once. In the project /init run, shorten the generated file immediately to the essentials, commit to repo. In the first sessions, add what Claude obviously doesn't know.
8 The Nine Building Blocks at a Glance
Claude Code consists of nine building blocks that work together:
| Building Block | When Active | Where Defined | For What |
|---|---|---|---|
| CLAUDE.md | Always | Project root | Context, conventions, rules |
| Permissions | Always | settings.json | Allow and deny |
| Hooks | On events | settings.json | Mechanics, automation |
| Skills | On invocation | skills/ | Reusable tasks |
| Subagents | On invocation | agents/ | Own context, brief answer |
| MCP-Server | On invocation | settings.json | External tools |
| Sandbox | On activation | settings.json | Limit scope |
| Plugins | On activation | plugins/ | Bundle of multiple components |
| Loops/Tasks | Periodically | settings.json | Routine, observation |
9 Directory structure and settings.json
All components follow the same logic: global in the home directory, project-specific in the project, local-personal in a file that is not committed to Git.
~/.claude/ # Globale Konfiguration
├── CLAUDE.md # Globale Vorlieben
├── settings.json # Globale Permissions, Hooks, MCP
├── skills/<name>/SKILL.md # Globale Skills
└── agents/<name>/AGENT.md # Globale Subagents
.claude/ # Projektspezifisch (ins Git)
├── settings.json # Projekt-Permissions, Hooks, MCP
├── skills/<name>/SKILL.md # Projekt-Skills
└── agents/<name>/AGENT.md # Projekt-Subagents
CLAUDE.local.md # Persönlich, nicht ins Git
.claude/settings.local.json # Lokal, nicht ins Git
Structure of settings.json
{
"permissions": {
"allow": ["Read", "Edit", "Bash(git diff*)"],
"deny": ["Bash(rm -rf *)", "Read(.env*)"]
},
"hooks": { "PostToolUse": [...] },
"mcpServers": { "github": {...} },
"model": "claude-opus-4-7"
}
The three levels (global, project, local) are merged. Deny always wins.
Important: True JSON files must not contain comments and no trailing commas. .claude/settings.local.json and .claude/cache/ in the .gitignore include.
10 Permissions
Permissions control what Claude is allowed to do without asking and what is off-limits. A Deny rule is a wall.
10.1 The three levels
| Level | Behavior |
|---|---|
| Allow | May be executed without asking |
| Ask | Default for everything that is not explicitly allowed or forbidden – Claude asks |
| Deny | Not allowed at all – absolute block |
10.2 Formulating rules
Read # Lesezugriff allgemein
Edit # Datei-Edits allgemein
Read(.env*) # Lesen von .env-Dateien
Bash(git status*) # nur git status
Bash(git *) # alle git-Befehle
Bash(xcodebuild *) # alle xcodebuild-Calls
10.3 Recommended configuration
Global ~/.claude/settings.json – hard prohibitions:
{
"permissions": {
"deny": [
"Bash(rm -rf *)", "Bash(sudo *)",
"Bash(curl *)", "Bash(wget *)",
"Read(.env*)", "Read(**/secrets/**)",
"Read(**/.ssh/**)", "Read(**/Credentials/**)"
]
}
}
Project-specific .claude/settings.json – allow routine:
{
"permissions": {
"allow": [
"Read", "Edit",
"Bash(git status*)", "Bash(git diff*)",
"Bash(git log*)", "Bash(git add *)",
"Bash(git commit *)", "Bash(xcodebuild *)",
"Bash(swift test*)"
]
}
}
Tip: /permissions allowlist suggests a sensible Allow list from the last tool calls. Simply work through two or three sessions and then run the command.
11 Hooks
Hooks are shell commands that Claude automatically executes at certain events. They are for mechanics, not for logic.
Lifecycle events
- PostToolUse – after every tool call; classic for formatters and linters
- PreToolUse – before every tool call; for additional checks
- Stop – at session end; for desktop notifications
Important variables
$CLAUDE_FILE_PATH # die bearbeitete Datei
$CLAUDE_TOOL_NAME # welches Tool lief
$CLAUDE_PROJECT_DIR # Projektroot
Example – SwiftFormat after every edit
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "if [[ \"$CLAUDE_FILE_PATH\" == *.swift ]]; then swiftformat \"$CLAUDE_FILE_PATH\"; fi"
}
]
}
]
}
}
Example – desktop notification at session end
{
"hooks": {
"Stop": [
{
"hooks": [{
"type": "command",
"command": "osascript -e 'display notification \"Claude fertig\" with title \"Claude Code\"'"
}]
}
]
}
}
Note: Hooks must be fast (under one second), idempotent, and fail silently. Start with a single hook – the formatter.
12 Skills
Skills are named, reusable instructions that are called up specifically. They save time on everything that repeats in daily work.
12.1 Structure of a skill
--- name: new-view
description: Legt eine neue SwiftUI-View nach unseren Konventionen an
---
Erstelle eine neue SwiftUI-View. Schritte:
1. Datei unter Sources/Views/<Feature>/<Name>View.swift anlegen
2. @Observable ViewModel einbinden
3. Preview-Provider ergänzen
4. In die Navigation eintragen
Call: /new-view ProfilEditor. Arguments land as $ARGUMENTS or $1, $2 in the Skill.
12.2 Recommended Community Skills
| Skill | Function | Installation |
|---|---|---|
| Superpowers | Structured workflow: plan first, test second, code last | /plugin install superpowers@claude-plugins-official |
| Frontend Design | Professional, modern UIs instead of generic AI look | /plugin install frontend-design@claude-plugins-official |
| Skill Creator | Creates new Skills based on description | /plugin install skill-creator@claude-plugins-official |
| Trail of Bits | Security Audit (SQL Injection, XSS, …) | /plugin marketplace add trailofbits/skills |
| Prompt Master | Optimizes prompts for 30+ AI tools | git clone .../nidhinjs/prompt-master ~/.claude/skills/ |
| Marketing Skills | 40 Marketing Experts: SEO, Ads, Copywriting, Growth | npx skills add coreyhaines31/marketingskills |
| CLAUDE.md Optimizer | Keeps CLAUDE.md lean, outsources non-essentials | git clone .../wrsmith108/claude-md-optimizer ~/.claude/skills/ |
| Webapp Testing | Browser-based automated testing | /plugin install webapp-testing@claude-plugins-official |
Tip: First sense where you're repeating yourself. Skills that are theoretically invented usually miss the target.
13 Subagents
Subagents are Claude instances for clearly defined tasks. They run with their own context and return only a summary to the main session.
Skill vs. Subagent: A Skill works in the main chat and enlarges the context there. A Subagent works separately and delivers only the result. When a task consumes a lot of context but returns little – use a Subagent.
Structure – Example Code Reviewer
--- name: code-reviewer
description: Senior Code-Reviewer. Nach Code-Änderungen proaktiv aufrufen.
tools: Read, Grep, Glob, Bash(git diff*)
model: sonnet
---
Du bist Senior Code-Reviewer für ein Swift-Projekt.
Analysiere nur die geänderten Dateien.
Gib zurück: max. 5 kritische Punkte, sortiert nach Priorität.
Keine langen Erklärungen.
Three fields that matter
- description – decides whether Claude calls the agent automatically.
- tools – limits what the agent can do. Keep it tight.
- model – Research/Reviews: sonnet; Architecture analysis: opus; simple searches: haiku.
14 MCP Servers
MCP Servers (Model Context Protocol) are external tools that Claude can call. This turns Claude into an agent that executes real actions: read GitHub Issues, execute database queries, control cloud services.
14.1 Basics and Setup
claude mcp add github -- npx -y @modelcontextprotocol/server-github
claude mcp add --transport http my-api https://meine-api.de/mcp
claude mcp list
/mcp # Status aller Server prüfen
| MCP-Server | Function |
|---|---|
| GitHub | Read issues, prepare PRs, manage branches |
| Supabase | Control database queries, tables, RLS-Policies directly from Claude |
| Context7 | Load current library docs – no outdated model knowledge |
| Exa / Perplexity | Web search from Claude |
| Playwright | Browser automation, screenshots, E2E tests |
| Pipedream | 8,000+ apps in one MCP: Gmail, Slack, Stripe, Notion, … |
14.2 The Senior Engineer Stack – 5 free MCPs
| MCP | Function | Prerequisites |
|---|---|---|
| CodeRabbit | Senior Engineer review for security, performance, maintainability | GitHub Personal Access Token |
| Pipedream | 8,000+ apps in one MCP | Pipedream Account (free) |
| Exa | Smart Search (1,000 requests/month free) | Exa API Key |
| Sequential Thinking | Structured thinking – Anthropic's official reference server | None |
| Memory MCP | Long-term memory across projects | None |
Security: Anthropic audits no third-party MCP servers. Only use trusted sources. API keys never in committed files.
15 Plugins
Plugins are pre-made packages that bundle multiple components: Skills, Hooks, Subagents, Settings, sometimes MCP Servers.
Management
/plugins
claude plugin add <name>
claude plugin list
claude plugin remove <name>
/reload-plugins
Recommended Plugins
| Plugin | Function | Installation |
|---|---|---|
| Context Mode | Runs in the background, saves tokens (10.645 Stars) | /plugin marketplace add mksglu/context-mode |
| claude-mem | Persistent memory across sessions (68.482 Stars) | npx claude-mem install |
| Everything Claude Code | Comprehensive power-user bundle (168.287 Stars) | /plugin marketplace add affaan-m/everything-claude-code |
| Huashu Design | Prototypes and slides via natural language | npx skills add alchaincyf/huashu-design |
Important: Work without plugins for a while first – if you don't know the building blocks, you can't judge plugins.
16 Loops and scheduled tasks
Loops and tasks let Claude work at intervals or at fixed times.
Hook vs. Loop: A hook reacts to something that just happened. A loop runs on its own.
Use cases
- Loops: Monitor build status, check CI builds every 3 minutes, test results
- Scheduled tasks: Daily release notes, meeting preparation, maintenance tasks
In practice
/loop 5m check ob der staging-build fertig ist und melde dich
/loop 10m /security-review
/schedule "0 8 * * 1-5" /daily-standup-prep
/loop status
/loop stop
In settings.json
{
"scheduled_tasks": [
{
"name": "daily-standup",
"schedule": "0 8 * * 1-5",
"command": "/daily-standup-prep",
"notify": true
}
]
}
Note: Define a clear end condition, realistic intervals (3–10 minutes). Never use loops for destructive actions.
17 Token optimization and cost control
17.1 Model selection and /clear
- Model selection: Opus costs roughly 5x Sonnet per token. Use Opus strategically for architecture and refactoring, Sonnet for everyday work.
- /clear: Every token in context costs again with each request. Long sessions without /clear become disproportionately expensive.
- Subagents: Own context, brief response to main chat. Main context stays small.
17.2 claude-mem – Persistent memory
Claude Code forgets context after each session. claude-mem solves this problem: it summarizes every tool call, stores observations locally in SQLite, and loads them in the next session.
| Step | What happens |
|---|---|
| Capture | Every tool call is automatically intercepted |
| Compress | Reduction from up to 10,000 to approx. 500 tokens (5–10× in daily use) |
| Store | Local SQLite database |
| Retrieve | Claude loads only the relevant context for the current task |
npx claude-mem install
# Alternativ
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem
Security notice: The HTTP API on port 37777 has no authentication. Configure the firewall so that port 37777 is only accessible from localhost.
17.3 RTK – Token Compression
RTK (Rust Token Killer) is a CLI proxy that summarizes command output before it reaches Claude. Result: 60–90 % fewer tokens.
| Command | Tokens before | Tokens after | Savings |
|---|---|---|---|
git status | ~800 | ~50 | ~94 % |
git push | ~200 | ~10 | ~95 % |
ls (large) | ~1,500 | ~150 | ~90 % |
npm test | ~3,000 | ~300 | ~90 % |
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh | sh
rtk init -g # Hooks für Claude Code aktivieren
rtk init --show # Status prüfen
rtk gain # Einsparungen anzeigen
18 Cloud Automations with Routines
Routines are fully autonomous cloud automations – without a local server.
| Plan | Routine runs per day |
|---|---|
| Pro | 5 |
| Max | 15 |
| Team / Enterprise | 25 |
Set up routine
claude.ai/code/routinesopen- New routine → assign name
- Write prompt (as precisely as an assignment to an employee)
- Select GitHub Repository
- Choose Trigger: Schedule, API or GitHub Event
- Connect Connectors (Gmail, Slack, etc.)
- Run now for testing – only activate the schedule after that
Example – Daily Email Summary
Geh in meine E-Mails über den Gmail Connector.
Lies alle ungelesenen E-Mails seit gestern.
Fass jede E-Mail in einem Satz zusammen.
Sortiere nach: Dringend, Aktion nötig, Info.
Schick mir die Zusammenfassung als Slack-Nachricht.
Example – PR Review on every Pull Request
Ein neuer Pull Request wurde geöffnet.
Prüfe den Code auf Sicherheitsprobleme, Performance-Probleme,
Code-Stil und Lesbarkeit.
Schreib ein Review als Kommentar auf den PR.
Important: Routines run completely autonomously. All actions happen under your own name. Store API keys in the environment variables of the cloud environment.
19 Advanced Workflows
19.1 Parallel Work with Worktrees
claude --worktree mein-feature # Worktree starten
claude -w # Schneller Worktree-Start
The desktop app offers a Code tab with worktree checkbox – most convenient for 3–5 parallel sessions.
Killer combination: On the Max plan: Opus 4.7 + /effort max + Auto Mode + 1M Context = start a complete project and return after hours to an independently revised, tested, and committed result.
19.2 The Verification Loop
The single most important tip from Boris Cherny (Claude Code founder):
"If Claude has that feedback loop, it will 2–3x the quality of the output."
Wir bauen jetzt zusammen Feature X.
Bevor du eine einzige Zeile Code schreibst, definiere zuerst,
wie du selbst prüfst, ob das fertige Feature funktioniert:
1. Welcher Test, Befehl oder Browser-Check beweist, dass es geht?
2. Was ist dein Plan?
3. Erst nach Zustimmung umsetzen.
19.3 Sandbox for autonomous work
/sandbox
# Oder in settings.json:
{
"sandbox": {
"enabled": true,
"filesystem": {
"writable": ["$CLAUDE_PROJECT_DIR/Sources", "$CLAUDE_PROJECT_DIR/Tests"],
"readable": ["$CLAUDE_PROJECT_DIR"]
},
"network": { "enabled": false }
}
}
Tip: Sandbox + Auto-Accept: Claude works fast, but technically cannot break out of the defined area.
19.4 Plan Mode first
For complex tasks: Shift+Tab → plan. Claude creates a plan that you review. Only switch to implementation mode once the plan is convincing.
20 Claude in other tools
20.1 Claude for Word
Anthropic has integrated Claude directly into Microsoft Word. Changes appear as suggestions with change tracking.
Prerequisites
- Claude Team or Enterprise (Pro on waitlist)
- Microsoft 365 (not Word 2016/2019)
- File format
.docx
Installation
- marketplace.microsoft.com – Search for Claude by Anthropic for Word
- Install, open Word, activate add-in (Mac: Tools → Add-ins)
- Log in with Claude account
Key features
- Edit texts with change tracking (formatting preserved)
- Check document for inconsistencies (cross-references, numbering, terms)
- Questions with clickable source citations
- Fill templates with preserved formatting
- Cross-App: Word + Excel + PowerPoint in one conversation
Tip: "Shorten this paragraph and remove passive constructions." / "What is the liability cap and does it apply both ways?"
20.2 OpenAI Codex as second model
The Codex plugin integrates the OpenAI Codex CLI directly into Claude Code. This enables code reviews by a second, independent model – without leaving the Claude session.
Note: This is not about OpenAI's old Codex model (discontinued 2023), but about the OpenAI Codex CLI – a terminal-based coding agent by OpenAI (April 2025, Open Source).
AI models recognize their own mistakes worse than others' – a second model brings a fresh perspective.
What it actually is
The OpenAI Codex CLI is a standalone command-line tool by OpenAI that works similar to Claude Code: it reads code, analyzes it, and provides feedback. All reviews are read-only – Codex does not modify any files.
Which account do I need?
| Criterion | ChatGPT Account | OpenAI API Key |
|---|---|---|
| Cost | Free possible (with limits) | Pay-per-use, very affordable |
| Setup effort | Low (browser login) | Medium (obtain API key) |
| Limits | Daily limited (Free) | Limited only by credit balance |
| Recommended when | You already use ChatGPT | You frequently do reviews |
| Cost per review | Free / incl. in Plus | approx. 0.001–0.01 USD |
Setup step by step
# Schritt 1 – Voraussetzungen prüfen
node --version # muss 18.18 oder neuer sein
# Schritt 2 – Codex CLI installieren
npm install -g @openai/codex
# Schritt 3 – Authentifizieren
# Option A: ChatGPT-Account
codex login
# Option B: API Key
export OPENAI_API_KEY="sk-..."
# Schritt 4 – Plugin installieren
/plugin marketplace add openai/codex-plugin-cc
/plugin install codex@openai-codex
/reload-plugins
# Schritt 5 – Installation prüfen
/codex:setup
Available Commands
| Command | What it does | When to use |
|---|---|---|
/codex:review | Neutral review of recent changes | After each feature as standard check |
/codex:adversarial-review | Critical review – searches specifically for errors, security vulnerabilities | Before a merge or release |
/codex:rescue | Hand off task completely to Codex | For minor subtasks that Claude isn't currently solving |
/codex:status | Shows running background jobs | When a long review is still running |
/codex:result | Retrieves results of completed jobs | After /codex:status |
/codex:cancel | Cancels running jobs | When a review is no longer needed |
When is it worth it?
The plugin is useful when:
- You already have a ChatGPT or OpenAI account (no extra effort)
- You write code that is used in production (security, correctness important)
- You want an independent check before a release
- You
/codex:adversarial-reviewwant to integrate as the final check step before a merge
The plugin is less useful when:
- You don't have an OpenAI account and don't want to create one
- You mainly write experimental or throwaway code
- The Claude-internal reviews with
/ultrarevieware already sufficient
Recommended workflow: Opus writes the code, then /codex:adversarial-review as a second opinion. Codex tokens cost approximately 1/4 of Opus – reviews are essentially free.
Learning path: From beginner to expert
Whoever sets everything up at once builds configuration they later won't understand:
- Step 1 – First real feature: Look for a manageable feature from your own project. Turn on Plan Mode, review the plan, then Auto-Accept to build, at the end
/review. - Step 2 – Sharpen CLAUDE.md: Notice patterns after two or three sessions. These insights belong in here: step by step, concise, precise.
- Step 3 – Clean up permissions: Create global deny rules once. Let project-specific allow lists grow from daily usage.
- Step 4 – Hooks for mechanics: Start with the formatter. SwiftFormat (or Prettier, Black) after every edit.
- Step 5 – Skills for repetitions: What's needed three times a month becomes a skill. Create it only when the need is felt.
- Step 6 – Subagents for complex tasks: If sessions get too long, outsource reviews and research to subagents.
- Step 7 – Use MCP strategically: Start with GitHub, read-only operations first.
- Step 8 – Advanced setup: Worktrees, Sandbox, Routines, RTK, and claude-mem for maximum efficiency.
22 What Claude Code is not
- Not a substitute for your own understanding. Whoever doesn't understand the code Claude produces builds up technical debt.
- Not a partner for strictly confidential work on consumer plans. On Pro and Max, every file read goes to Anthropic. Sensitive data belongs in Team, Enterprise, or API setup.
- Not a real-time tool. Answers take their time, especially with Opus. For live pair programming, Claude is too slow.
- Not a solution for very large monorepos. With repos in the multi-million-line range, Claude bogs down. Selective loading with @-mentions becomes mandatory.
- Not a substitute for clean tests and CI. Claude can write tests – the pipeline must run them.
23 Troubleshooting
| Problem | Solution |
|---|---|
claude: command not found after installation | Close the terminal completely and reopen it. If not fixed: check whether ~/.local/bin is in the PATH. |
| Browser login fails | Common causes: no paid plan, different account in browser, expired session. Solution: claude logout, then claude restart. |
claude doctor reports an error | The tool shows itself what's missing. Most common cases: incomplete PATH, missing login, outdated version. claude update execute. |
| Permission prompts are annoying | Permissions in .claude/settings.json maintain. /permissions allowlist suggests a ready-made allowlist. |
| Plugin doesn't work after installation | /reload-plugins execute or restart Claude Code. |
| MCP server is displayed as unavailable | /mcp checks the status. Set API keys as environment variables. Check Node.js version (18+ recommended). |
Codex Plugin: /codex:setup fails | Check Node.js version 18.18+. Install Codex CLI: npm install -g @openai/codex. Then codex login run and /reload-plugins. |
| Routine fails on API key access | Store API keys in the Cloud Environment's environment variables. Explicitly specify in the prompt: "Use the API key from the environment variables." |
| Migration to new machine | ~/.claude/ back up without cache/. Do not take auth tokens along – log in again after the switch. |
24 Glossary
| Term | Explanation |
|---|---|
| Auto-Accept | Mode in which Claude acts without asking, unless blocked by Deny. Activate via Shift+Tab. |
| Auto Mode | Extended autonomous mode (Max-Plan). Claude makes all decisions independently. |
| CLAUDE.md | Markdown file that is automatically loaded at each session. Contains project context, build commands, conventions, and prohibitions. |
| Codex CLI | Open-source coding agent from OpenAI (released April 2025). Used via the Codex Plugin in Claude Code for independent code reviews. |
| Effort-Level | Controls how long Opus 4.7 thinks about a problem. From low to max. |
| Hook | Shell command that is automatically executed on a lifecycle event (PostToolUse, PreToolUse, Stop). |
| Loop | Loop via /loopthat executes a command at intervals. |
| MCP-Server | External service (Model Context Protocol) that provides Claude with new tools. |
| Permissions | Allow/Deny rules in settings.json that specify what Claude is allowed or not allowed to do. |
| Plan Mode | Read-only mode in which Claude only analyzes and plans. Via Shift+Tab. |
| Plugin | Pre-configured bundle of multiple components (Skills, Hooks, Subagents, Settings). |
| Routine | Cloud automation that runs completely autonomously without a local server. |
| RTK | Rust Token Killer – CLI proxy that summarizes command outputs (60–90% fewer tokens). |
| Sandbox | Technically isolated area with file system and network isolation. |
| Schedule | Scheduled task per /schedule with Cron syntax. |
| Skill | Reusable custom command in skills/<name>/SKILL.md, per /name callable. |
| Subagent | Specialized agent with its own context that returns only a summary. |
| Worktree | Isolated Git checkout for parallel work in multiple Claude instances. |