/
Sonnet 4.6 · Opus 4.8

Claude Code Workspace

Anthropic's command-line agentic coding assistant. Designed to operate directly in your terminal to build, refactor, search, test, and commit code with advanced models.

NEW IN 2026

The Ultimate Coding Sandbox

Claude Code integrates directly with your local Git repository, executing tests, configuring Model Context Protocol (MCP) servers, writing instructions to CLAUDE.md, and running automated background tasks inside Git worktrees to scale development.

claude — ~/projects/core-engine

Memory (CLAUDE.md)

Persistent instructions, rules, and coding standards. Auto-memory indexes build routines and preferences across workspace sessions.

Lifecycle Hooks

Run shell commands on tool calls, prompt submissions, or context compaction. Enforce security, auto-format code, or handle OAuth.

Custom Agent Skills

Extend toolkits with the Agent Skills specification. Inline pre-execution context injection and Positional arguments scripting.

4.6 / 4.8 Sonnet / Opus Models
60+ Built-in Slash Commands
20+ Lifecycle Hook Events
ZDR Zero Data Retention Option

Installation & Core Setup

Get Claude Code running in your development environment and verify permissions.

1. Installation

Run the installer script to download the compiled binary and add it to your PATH:

curl -fsSL https://claude.ai/install.sh | bash

Run the PowerShell installer (recommended) or use winget:

irm https://claude.ai/install.ps1 | iex
winget install Anthropic.ClaudeCode

Note: winget works but does not support auto-updates. The npm method (npm i -g @anthropic-ai/claude-code) is deprecated.

2. Authentication

Sign in using your Anthropic Console account or Pro/Team consumer subscription.

bash
# Sign in with a web authentication flow
claude auth login

# Sign in via Console (if using API billing)
claude auth login --console

# Verify current login status
claude auth status

3. Advanced Providers & Gateways

Claude Code can run via AWS Bedrock, Google Vertex AI, Microsoft Foundry, or custom third-party LLM gateways.

Provider Configuration / Command Required Environment Variables
Amazon Bedrock claude --model bedrock/claude-4-6-sonnet or /setup-bedrock CLAUDE_CODE_USE_BEDROCK=1, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
Google Vertex AI claude --model vertex/claude-4-6-sonnet or /setup-vertex CLAUDE_CODE_USE_VERTEX=1, VERTEX_PROJECT_ID, VERTEX_REGION
LLM Gateways Configure endpoint maps in ~/.claude/settings.json Configure llmGatewayConfig keys mapping custom URLs and Auth.

CLI Flags & Slash Commands

Complete reference of CLI launching parameters and built-in interactive shell functions. Click any flag or command to watch it run live in a simulated terminal.

Top-level Command Line Flags

Customize execution behavior, directory bounds, and model context before launching a session.

Flag Purpose Syntax / Example
-p / --print Run headless print mode (directly output result and exit). claude -p "Explain db schema"
-c / --continue Load the most recent conversation transcript in the current directory. claude -c
-r / --resume Resume a specific session by UUID or name, or open the interactive picker. claude -r "auth-validation"
-w / --worktree Start in an isolated git worktree to work in parallel on a branch. claude -w feature-oauth
--permission-mode Override baseline permissions (default, plan, acceptEdits, auto, dontAsk, bypassPermissions). claude --permission-mode plan
--effort Set model reasoning effort level (low, medium, high, xhigh, max). claude --effort high
--model Specify a Claude model to use for the session. claude --model claude-opus-4-8
--max-turns Limit the number of agentic turns in non-interactive mode. claude -p "fix tests" --max-turns 10
--output-format Output format for headless mode: text, json, or stream-json. claude -p "explain" --output-format json
--allowedTools Pre-approve specific tools without prompting (for CI/scripts). claude -p "test" --allowedTools Bash Edit
--add-dir Grants file system read/write access to supplementary project folders. claude --add-dir ../common-library
--bare Fast-start that skips MCP servers, hooks, plugins, and CLAUDE.md discovery. claude --bare -p "list directory"

Interactive Slash Commands (/)

Commands executed directly in the interactive prompt. Use them to switch models, audit logs, reset history, and control workflows.

Command Category Description
/clear Session Archived current transcript and starts a clean conversation.
/compact Session Summarizes context history to save token consumption.
/context Session Grid map visualization of the loaded context window.
/rewind History Undo code changes and roll back chat turns back to a checkpoint.
/goal <condition> Execution Keeps Claude working autonomously across turns until goal matches.
/loop [interval] [prompt] Execution Polls and runs prompts repeatedly (schedule a cron or watch deploy).
/install-github-app Execution Sets up the official Claude GitHub Actions integration to respond on PRs and issues.
/batch <query> Execution Fills 5-30 parallel background subagents to deploy massive refactors.
/mcp Setup Manage active Model Context Protocol servers.
/theme Setup Interactively configure terminal colors and styling.
/config Setup Open the interactive configuration interface for all settings.
/permissions Setup View and update tool approval rules and permission allowlists.
/terminal-setup Setup Configure terminal features like Shift+Enter multiline input support.
/vim Setup Toggle Vim-style keybindings for the prompt input line.
/login / /logout Setup Manage authentication state within the interactive session.
/memory History View, edit, or reset auto-generated MEMORY.md project learnings.
/usage History Displays cost, token usage, and API call breakdown. (Aliases: /cost, /stats)
/status History Show current environment, config scope, and session metadata.
/doctor Session Run health checks and troubleshoot configuration issues.
/help Session Display all available commands with descriptions.
/ide Session Manage IDE integrations (VS Code, JetBrains) from the CLI.
/skills Session List all available custom skills and built-in AI workflows.

Keyboard Shortcuts Visualizer

Click on any keyboard key to inspect its exact action and view real-world examples inside Claude Code.

Shortcut Action Click Key

Click a key combo on the left keyboard grid to view detailed documentation and terminal use cases.

Example command output:

[Awaiting selection...]

CLAUDE.md & Auto Memory

Manage how Claude maintains context, remembers build specifications, and accumulates codebase learnings.

Memory Scoping Layers

Claude walks up directory trees to find configuration instructions, layering context from broadest to most specific.

Layer Location Scope
Org Policy /Library/Application Support/... All sessions across company machines.
User Preferences ~/.claude/CLAUDE.md Your personal code formatting rules.
Project Scope ./CLAUDE.md Team-shared repository specifications.
Local Sandbox ./CLAUDE.local.md Local testing endpoints (gitignored).
Path-specific Rules .claude/rules/*.md Scoped via YAML frontmatter glob matching.

Auto Memory & Learnings

Claude autonomously records preferences, database tricks, and corrected mistakes in ~/.claude/projects/<project>/memory/.

MEMORY.md
# Auto-generated by Claude Code (On by default)
## Project Learnings
- Database tests require a local Redis client running on port 6379.
- Use pnpm instead of npm to avoid long install logs.
- The auth server throws 401 when token date validation is mock-skipped.

# View or edit memories during session:
/memory

CLAUDE.md Configuration Generator

Configure project specifications and export a production-ready CLAUDE.md file.

1. Build & Test Commands

2. Choose Standards & Guidelines

3. Custom Project Instructions (One per line)

Generated CLAUDE.md File
# Loading...

Automation & Event Hooks

Register shell scripts to execute deterministically during Claude Code's agentic loop events.

SessionStart Launch & Resume
UserPromptSubmit Input Processing
PreToolUse Block & Intercept
PostToolUse Format & Clean
Stop Response Complete
SubagentStop Agent Returns
Notification User Alerts
PreCompact Context Trim
ConfigChange Audit Settings
SessionEnd Exits & Cleanups
SessionStart SessionStart

Event Triggers:

Triggers when a session starts, resumes, or is compacted.

JSON Event Input Payload (on stdin):

{"source": "startup | resume | clear | compact", "session_id": "UUID", "cwd": "path"}

Exit Code Decisions & Output:

Adds stdout to Claude's conversation context. Useful for loading custom instructions dynamically.

Hook Configuration Schema:

# Selected Hook Configuration will render here...

Custom Skills Studio

Extend Claude's toolset using the Agent Skills open standard. Formulate templates, frontmatter configurations, and test shell command preprocessing.

1. Code & Frontmatter Editor

Define variables ($ARGUMENTS, $0), frontmatter rules, and shell commands (prefixed by !).

2. Evaluated Prompt Result

This is the resolved prompt injected into Claude's context when the skill executes.

COMPILED OUTPUT PREVIEW Pre-processed
--- name: summarize-changes description: Summarizes uncommitted git changes and reports risks. allowed-tools: Bash(git diff) disable-model-invocation: true --- ## Uncommitted Git Diff [Click 'Compile Skill' to pre-render output]

Subagents, Background Agents & MCP

Scale development with parallel agents, background daemon sessions, custom agent definitions, and Model Context Protocol integrations. Click any card to watch it run in the desktop app.

Subagents (Task Tool)

Claude can spawn independent subagents using the Task tool to work in parallel. Subagents execute in isolated contexts and report findings back to the parent agent.

subagent orchestration
# Claude automatically spawns subagents for:
- Read-heavy research across large codebases
- Parallel file analysis (avoid context bloat)
- Independent test suite validation
- Multi-module refactoring via /batch

# Manual batch decomposition:
/batch "Update all API handlers to v2 format"
→ Spawns 5-30 parallel workers in git worktrees

Agent View & Background Sessions

Open the full-screen Agent View to monitor running, blocked, and completed sessions — including background sessions that keep working while you do other things.

agent view
# Open the Agent View operations screen
claude agents

# Scope the view to one directory
claude agents --cwd ~/projects/api

# Machine-readable status for scripts
claude agents --json
→ Background sessions are marked "bg" and
  can be resumed with /resume

Custom Agent Definitions

Define reusable agent personas with scoped tools and behaviors in YAML files under .claude/agents/.

.claude/agents/reviewer.yml
name: code-reviewer
description: Reviews PRs for security and style issues
model: claude-sonnet-4-6
allowed-tools:
  - Read
  - Bash(git diff)
  - Bash(git log)
instructions: |
  Review code for security vulnerabilities,
  performance issues, and style violations.
  Never modify files directly.

Launch with: claude --agent code-reviewer

MCP Server Management

Connect Model Context Protocol servers to extend Claude with external data sources, databases, APIs, and specialized tools.

MCP configuration
# Add an MCP server via CLI
claude mcp add my-db-server -- npx @db/mcp-server

# Manage servers interactively
/mcp

# Supported transports:
- stdio (local process communication)
- SSE (Server-Sent Events)
- streamable-HTTP (web endpoints)

Custom Slash Commands

Create reusable prompt templates as custom slash commands by adding Markdown files to your .claude/commands/ directory. These appear alongside built-in commands in the / menu.

File Path Invocation Description
.claude/commands/review.md /project:review Project-scoped command, shared with team via Git.
~/.claude/commands/daily.md /user:daily Personal command, available across all projects.
Commands support $ARGUMENTS for parameters and !`shell` syntax for injecting live codebase data.

Mastery Checklist & Progress

Track which Claude Code CLI capabilities you've read, practiced, and mastered. Progress is saved locally in your browser.

Claude Code Power Checklist

1. Installation & Environment Configuration

Binary Installation Installed the native compiled Claude Code binary via Winget or Homebrew.
Account Authentication Logged into Anthropic Console/Subscription and verified auth status in terminal.
Active Directory Sessions Started, continued (-c), and named (-n) sessions in target repositories.

2. Advanced CLI Parameters

Headless SDK Printing Executed non-interactive runs with piping using `claude -p` and piped streams.
Parallel Git Worktrees Isolated sessions and subagent work using `--worktree` branches.
Session Forking Branched work safely with `--fork-session` / `/branch` and resumed exact sessions by UUID.

3. Command Line Slash Utilities

Context Optimization Grid Opened `/context` to track token usage limits, memory bloat, and grid visualizations.
Context Compaction Triggered `/compact` to shrink transcript memory while holding rules and core data.
Session Rewinding & Undos Rolled back conversation turns and code states using `/rewind` checkpoints.
Autonomous Goals Assigned Claude a long-running, multi-turn task targeting `/goal <condition>`.
Proactive Monitoring Loops Configured schedules and watchdogs using the `/loop` built-in skill.

4. Keyboard Shortcuts Mastery

Aborting & Cancelling Used `Ctrl+C` to cancel stuck compilations or test suites in real-time.
Permission Mode Cycling Cycled permissions between Plan, Auto, Default, and Bypass with `Shift+Tab`.
Global History Search Searched cross-project prompt histories and commands using `Ctrl+R`.

5. Core Memory Systems

Project CLAUDE.md Guidelines Wrote specific build specifications and naming standards in the project root CLAUDE.md.
Glob Path-specific Rules Created modular files scoped to specific code file extensions under `.claude/rules/`.
Auto Memory Directories Inspected and verified auto-logged topic memories inside the `~/.claude/projects/` database.

6. Hooks & Custom Skills

Registering Lifecycle Hooks Registered hooks in project and user settings files to trigger on key events.
Blocking Sensitive Commands Wrote a `PreToolUse` shell script that checks arguments and exits 2 to block edits to protected files.
Auto-Formatting on Edit Configured a `PostToolUse` edit matcher hook that runs Prettier/Black on modified paths.
Writing Custom SKILL.md Files Extended the Agent Skills standard with custom YAML frontmatter descriptions.
String Substitution Arguments Mapped arguments using positional `$N` placeholders and session environment variables.
Pre-Execution Shell Injections Injected live codebase content into prompts using the fenced `` !`git diff` `` preprocessor script syntax.

7. Subagents & Multi-Agent

Subagent Orchestration Used `/batch` or let Claude spawn parallel Task subagents for large-scale refactoring.
Agent View & Background Sessions Monitored running, blocked, and completed sessions in `claude agents` Agent View.
Custom Agent Definitions Created YAML agent definitions in `.claude/agents/` with scoped tools and instructions.
MCP Server Integration Connected external MCP servers using `claude mcp add` and tested tool availability.