AI Coding Tools — The Ultimate Guide Series

Claude Code

Article 4 of 4+ · The Terminal Agent

May 18, 2026 · devops · 27 min read · 5321 words · updated Sep 27, 2026 intermediate

Claude Code — The Ultimate Guide for Developers and DevOps Engineers.

devops ai-tools claude-code anthropic terminal-agent

Copilot lives in your IDE. Codex lives in the cloud. Claude Code lives in your terminal. Anthropic's agentic coding tool is the most flexible of the three — a terminal-native agent with deep reasoning, a rich hook system, subagents for delegation, agent teams for parallelism, and a permission model that ranges from "ask me everything" to "do whatever you want."

If You Read Nothing Else: Claude Code is a terminal-native agentic coding tool powered by Claude models (Opus 5.5 and Fable 5.1 at the top end as of September 2026). Install it, run claude in your project directory, and start a conversation. It reads your files, edits code, runs commands, creates commits, and manages PRs — all from the terminal. It understands your project through CLAUDE.md files, extends its capabilities through hooks and MCP servers, and scales through subagents and agent teams. It's available in your terminal, VS Code, JetBrains, the desktop app, and even Slack.

Update — 27 September 2026

Claude Code ships almost daily: version 2.1.283 was released on 25 Sep 2026 (the May 2026 text was written around 2.1.13x). Sections 12 and 18 were rewritten; the features below are new or changed since May, taken from the project’s public changelog.

AreaWhat changed
ModelsOpus 5 became the default Opus in 2.1.219 (24 Jul 2026) and Opus 5.5 in 2.1.280 (22 Sep 2026); Claude Fable 5.1 was added in 2.1.257 (1 Sep 2026). Opus 5.5 and Fable 5.1 both have 1M context. Sonnet 5 and Haiku 4.5 are also available.
Long-running work/goal (set a completion condition; Claude keeps working across turns; 2.1.139, May 2026), dynamic workflows and /workflows (orchestrate tens to hundreds of background agents; 2.1.154, late May 2026), /loop for recurring prompts, the Monitor tool for streaming background events, and cloud sessions with routines.
Review/ultrareview runs a multi-agent code review in the cloud on your branch or on a PR number (2.1.111, April 2026).
Agent teamsStill behind CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, but simplified: TeamCreate and TeamDelete were removed in 2.1.178, and every session has one implicit team; you spawn teammates with the Agent tool’s name parameter.
Hooks and safetyNew events include PermissionDenied, MessageDisplay (transform or hide displayed text) and PreModelSwitch / PostModelSwitch; --safe-mode starts with all customisations off. Managed settings gained availableModelsMatch and deniedModels (2.1.283).
Plugins and auditsclaude plugin eval scores a plugin against Claude Code (2.1.269) and /doctor prompt-audit (also /checkup) audits your CLAUDE.md, skills, agents and commands for prompting patterns written for older models (2.1.283).
EnterpriseA Claude apps gateway for LLM-gateway deployments, with Bedrock upstream assume_role (2.1.281), a mantle provider (2.1.283) and forward_user_identity for per-user spend attribution; OpenTelemetry tool.output events when OTEL_LOG_TOOL_CONTENT=1.
PermissionsAuto mode (classifier-based approvals) is now a mainstream mode; interactive sessions on third-party providers, or with telemetry off, start in auto mode when no permission mode is configured (2.1.283).

This article assumes you've read Article 1: Fundamentals. If context windows, tool layers, and agent loops are unfamiliar, start there. If you've read the Copilot and Codex articles, you'll appreciate how Claude Code occupies a distinct position in the ecosystem.

1. Architecture — How Claude Code Works

Claude Code is fundamentally a conversational agent loop that runs in your terminal. When you type claude, it starts an interactive session. You type messages, Claude responds with text or takes actions (reading files, editing code, running commands), you approve or adjust, and the conversation continues.

You Terminal prompt or VS Code / IDE Claude Code (Agent Loop) Read files Edit code Run commands Search codebase Create commits CLAUDE.md instructions Permission checks Hooks & MCP servers Subagents Explore · Plan · Custom MCP Servers GitHub · Slack · DBs Git / PRs Commits · Branches · PRs Agent Teams Parallel sessions Independent work Interactive feedback loop

Fig 1 — Claude Code architecture: a terminal-native agent loop with subagents, MCP servers, git integration, and agent teams for parallel work.

Key architectural properties

  • Terminal-native: Runs as a CLI tool in your shell. Also available as extensions in VS Code and JetBrains.
  • Conversational: Unlike Codex (task-based), you have an ongoing dialogue with Claude. Steer, correct, ask questions mid-task.
  • Full system access: Can read/write any file, run any command, access the internet — bounded by your permission settings.
  • Context-aware: Reads CLAUDE.md files, understands git state, respects project structure.
  • Extensible: Hooks, MCP servers, subagents, and skills extend its capabilities without modifying the core tool.

Built-in tools

Claude Code has a set of built-in tools it uses internally to interact with your system. You don't call these directly — Claude decides which tool to use for each step. Understanding them helps you write better prompts and set appropriate permissions:

ToolWhat it does
BashRun shell commands — tests, builds, git operations, anything the terminal can do.
ReadRead a file's contents into context.
EditApply targeted edits to an existing file — replaces a specific string rather than rewriting the whole file.
WriteCreate or overwrite a file entirely.
GlobFind files matching a pattern, e.g. src/**/*.ts.
GrepSearch file contents with a regex or string.
LSList directory contents.
WebFetchFetch a URL and read its content — used for docs, API references, etc.
TodoRead / TodoWriteManage an internal task list within the session for multi-step work.

Permission modes (section 4) control which tools require your approval before running. In Read-only mode, Bash, Edit, and Write all require confirmation. In Accept Edits mode, Edit and Write run freely but Bash still prompts. In Auto mode (--dangerously-skip-permissions), all tools run without asking.

2. Installation and Setup

Install

# Official installer (macOS / Linux)
curl -fsSL https://claude.ai/install.sh | bash

# Or via npm
npm install -g @anthropic-ai/claude-code

# Verify
claude --version

First run

# Navigate to your project
cd ~/projects/my-app

# Start Claude Code
claude

# It will authenticate via browser on first run

Available surfaces

Surface How to access Best for
Terminalclaude commandFull power, scripting, CI
VS CodeExtension panelIDE integration with file context
JetBrainsPluginIntelliJ/PyCharm users
Desktop appStandalone appQuick access without terminal
Webclaude.aiBrowser-based, no install
SlackSlack appTeam collaboration
GitHub@claude mention in PRsCode review and PR tasks

3. CLAUDE.md — Project Instructions

CLAUDE.md is to Claude Code what AGENTS.md is to Codex. It's a markdown file that gives Claude persistent context about your project — conventions, build commands, architecture decisions, and behavioral instructions.

Where to place it

  • Repository root: ./CLAUDE.md — applies to the entire project.
  • Subdirectories: ./src/CLAUDE.md — applies when working in that directory tree.
  • Home directory: ~/.claude/CLAUDE.md — applies to all your projects (personal preferences).

What to include

# CLAUDE.md

## Build & test commands
- `npm run build` — production build
- `npm test` — run all tests
- `npm run test:unit -- --testPathPattern=path` — single test file
- `npm run lint` — check formatting

## Code style
- TypeScript strict mode, no `any` types
- Prefer functional components with hooks
- Error messages must be user-facing (not developer jargon)
- All API responses follow the shape in types/api.ts

## Architecture
- src/api/ — API route handlers
- src/services/ — business logic (never import from api/)
- src/db/ — database queries (Drizzle ORM)
- src/utils/ — pure utility functions

## Important notes
- Never commit .env files
- All dates are stored as UTC ISO strings
- The auth middleware is in src/middleware/auth.ts — do not modify without discussion

CLAUDE.md vs AGENTS.md vs copilot-instructions.md

Feature CLAUDE.md AGENTS.md copilot-instructions.md
Used byClaude CodeCodexGitHub Copilot
ScopingDirectory tree + homeDirectory treeRepo-level only
Personal prefs~/.claude/CLAUDE.md~/.agents/AGENTS.mdVS Code settings
FormatMarkdown (any structure)Markdown (any structure)Markdown (any structure)
Auto-loadedYes, alwaysYes, alwaysYes, always

Pro tip: If your team uses multiple AI tools, maintain all three files and keep them in sync. Extract shared content into a CONTRIBUTING.md that all three files reference.

4. Permission Modes

Claude Code's permission system controls what actions Claude can take without asking you first. This is one of the most important features for production workflows.

The modes

Mode Behavior Best for
defaultAsks before file edits and commandsLearning the tool, sensitive repos
acceptEditsAuto-approves file edits, asks for commandsActive coding sessions
autoAuto-approves safe actions, asks for risky onesExperienced users, trusted projects
dontAskRuns everything without askingAutomated workflows, CI
planRead-only — no edits, no commandsExploration, architecture discussions
bypassPermissionsSkips all safety checksSandboxed environments only

Setting permissions

# Start with specific mode
claude --permission-mode auto

# Or set in .claude/settings.json
{
  "permissions": {
    "mode": "auto",
    "allow": ["read", "write", "bash(npm test)", "bash(npm run build)"],
    "deny": ["bash(rm -rf *)"]
  }
}

Granular rules

Beyond the mode, you can allow or deny specific tools:

  • bash(command_pattern) — allow/deny specific shell commands.
  • read / write — file access controls.
  • mcp(server_name) — MCP server access.

For DevOps: Use auto mode with explicit denials for dangerous commands: deny: ["bash(terraform apply*)", "bash(kubectl delete*)", "bash(rm -rf*)"]. This lets Claude work freely while preventing catastrophic mistakes.

5. Subagents — Delegating Within a Session

Subagents are specialized AI assistants that Claude Code can invoke for specific tasks. Think of them as team members with different expertise that the main agent can call on.

Built-in subagents

  • Explore: Fast, read-only codebase exploration. Searches files, reads code, answers questions without making changes. Perfect for investigation tasks.
  • Plan: Creates detailed implementation plans without executing them. Useful for architecture decisions.

Custom subagents

Create custom subagents in .claude/agents/:

# .claude/agents/security-reviewer.md
---
name: Security Reviewer
description: Reviews code for security vulnerabilities
model: claude-sonnet-4-20250514
tools:
  - read_file
  - grep_search
  - semantic_search
---

You are a security expert. When invoked, thoroughly review
the specified code for:
- Injection vulnerabilities (SQL, XSS, command injection)
- Authentication/authorization bypasses
- Information disclosure
- Insecure deserialization
- Missing input validation

Report findings with severity ratings (Critical/High/Medium/Low)
and specific remediation steps.

How subagents work

  • The main Claude session decides when to invoke a subagent based on the task.
  • Each subagent runs with its own context and tool permissions.
  • Results are returned to the main session for integration.
  • Subagents are stateless — they don't persist between invocations.

Why subagents matter

Without subagents, long Claude Code sessions accumulate context that can degrade performance. By delegating investigation tasks to an Explore subagent, the main session stays focused. The subagent does the deep dive and returns only the relevant findings — keeping the primary context window clean.

6. Hooks — Lifecycle Automation

Hooks are Claude Code's automation layer. They let you run custom logic at specific points in the agent's lifecycle — before a tool runs, after a tool completes, when a session starts, or when Claude is about to stop.

Hook types

Event When it fires Use case
PreToolUseBefore any tool executionValidate commands, block dangerous actions
PostToolUseAfter a tool completesAuto-format, run linters, log actions
SessionStartWhen a session beginsLoad context, check environment
StopBefore Claude stops respondingRun final checks, summarize session
SubagentStopWhen a subagent finishesValidate subagent output

Hook implementation types

  • command: Run a shell command.
  • http: Send an HTTP request.
  • mcp_tool: Call an MCP server tool.
  • prompt: Inject text into Claude's context.
  • agent: Invoke a subagent.

Example: Auto-format on every file write

// .claude/settings.json
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "write_file|replace_string_in_file",
        "type": "command",
        "command": "prettier --write \"$CLAUDE_FILE_PATH\""
      }
    ]
  }
}

Example: Block dangerous commands

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "bash",
        "type": "command",
        "command": "echo \"$CLAUDE_TOOL_INPUT\" | grep -qE '(rm -rf|drop table|terraform destroy)' && echo 'BLOCK: Dangerous command detected' && exit 1 || exit 0"
      }
    ]
  }
}

Example: Auto-lint after edits

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "write_file",
        "type": "command",
        "command": "eslint --fix \"$CLAUDE_FILE_PATH\" 2>/dev/null || true"
      }
    ]
  }
}

For DevOps: Hooks are incredibly powerful for guardrails. A PreToolUse hook can prevent Claude from running kubectl apply without a dry-run first, ensure Terraform changes go through plan before apply, or block access to production config files.

7. MCP Servers — External Tool Integration

Model Context Protocol (MCP) servers extend Claude Code's capabilities beyond file editing and shell commands. They're standardized interfaces to external tools, databases, APIs, and services.

What MCP servers provide

  • Tools: Actions Claude can take (create GitHub issue, query database, send Slack message).
  • Resources: Data Claude can read (database schemas, API documentation, configuration).
  • Prompts: Pre-built prompt templates for common tasks.

Configuration

// .claude/settings.json
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "your-token"
      }
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "DATABASE_URL": "postgresql://localhost/mydb"
      }
    }
  }
}

Common MCP servers for DevOps

  • GitHub: Manage issues, PRs, actions, releases.
  • PostgreSQL/MySQL: Query databases, inspect schemas.
  • AWS: Interact with AWS services via CLI wrappers.
  • Kubernetes: Query cluster state, inspect resources.
  • Sentry: Query error tracking data.
  • Linear/Jira: Manage project tasks and tickets.

MCP servers run locally on your machine (or in a container). Claude Code communicates with them via the MCP protocol. This means Claude can interact with your production monitoring, databases, and infrastructure tooling — with appropriate permissions.

8. Agent Teams — Parallel Work

Agent teams are Claude Code's answer to Codex's parallel task execution. Instead of one Claude session doing everything sequentially, you can spawn multiple independent sessions that work simultaneously.

How it works

  1. Your main Claude session identifies tasks that can be parallelized.
  2. It spawns additional agent sessions (team members), each with a specific task.
  3. Each team member works independently in their own context.
  4. Results are coordinated back to the main session.

When to use agent teams

  • Multi-file refactors: One agent handles the API layer, another handles tests, a third handles documentation.
  • Investigation + implementation: One agent explores the codebase to find patterns while another starts implementing based on what's already known.
  • Large reviews: Split a large PR review across multiple agents, each reviewing different modules.

Key differences from Codex parallel tasks

Feature Claude Code Agent Teams Codex Parallel Tasks
EnvironmentSame machine, shared filesystemIsolated sandboxes per task
CommunicationCan share context and filesCompletely independent
CoordinationMain agent orchestratesNo coordination
SpeedReal-timeAsync (minutes)
Conflict handlingCoordinated by main agentManual merge resolution

9. Worktrees and Git Integration

Claude Code has first-class git integration. It understands branches, commits, diffs, and pull requests natively.

Worktrees

Git worktrees let Claude Code create isolated working copies of your repository without affecting your main working directory. This is used for:

  • Working on a feature without disturbing your current branch.
  • Creating checkpoints you can roll back to.
  • Parallel work streams that don't conflict.

Common git workflows

# Ask Claude to create a feature branch and PR
"Create a feature branch 'feat/user-avatars', implement
avatar upload with S3 storage, write tests, and open a PR
against main with a detailed description."

# Ask Claude to review a PR
"Review PR #42 — check for security issues, test coverage,
and adherence to our coding standards in CLAUDE.md."

# Ask Claude to rebase and resolve conflicts
"Rebase feature/auth onto main and resolve any conflicts,
preferring the main branch's approach for utility functions."

GitHub integration

With the GitHub MCP server or native integration, Claude can:

  • Create and update pull requests.
  • Respond to PR review comments.
  • Create issues from TODO comments in code.
  • Manage labels, milestones, and assignments.
  • Run as @claude in PR comments for inline reviews.

10. Skills — Reusable Knowledge Packs

Skills are reusable knowledge packages that give Claude Code domain-specific expertise. They're stored in .claude/skills/ or ~/.claude/skills/ and activated based on context or explicit invocation.

Skill structure

# .claude/skills/terraform-module/SKILL.md
---
name: terraform-module
description: Creates Terraform modules following our team conventions
triggers:
  - "create terraform module"
  - "new infrastructure module"
---

When creating Terraform modules, follow these conventions:

## File structure
- main.tf — primary resources
- variables.tf — all input variables with descriptions
- outputs.tf — all outputs with descriptions
- versions.tf — provider and terraform version constraints
- README.md — auto-generated with terraform-docs

## Naming conventions
- Resources: {provider}_{type}_{purpose}
- Variables: snake_case, no abbreviations
- Outputs: same name as the attribute they expose

## Required tags
All resources must have: Environment, Team, ManagedBy=terraform

## Validation
Always run:
1. terraform fmt -recursive
2. terraform validate
3. tflint

Built-in vs custom skills

Claude Code ships with no built-in skills — all skills are user-created. This is intentional: skills represent your team's knowledge, not generic patterns. Share skills via git by committing the .claude/skills/ directory.

11. Non-Interactive Mode and CI/CD

Claude Code isn't just an interactive tool — it can run headless in scripts, CI pipelines, and automation workflows.

Basic non-interactive usage

# Single prompt, get result, exit
claude -p "Explain the authentication flow in this project"

# Pipe input
cat error.log | claude -p "Analyze this error and suggest a fix"

# Output formats
claude -p "List all API endpoints" --output-format json
claude -p "Summarize changes" --output-format markdown

CI/CD integration examples

PR description generation

# .github/workflows/pr-description.yml
name: Generate PR Description
on:
  pull_request:
    types: [opened]
jobs:
  describe:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: |
          DIFF=$(git diff origin/main...HEAD)
          claude -p "Generate a detailed PR description for these changes: $DIFF" \
            --output-format markdown > pr-body.md

Automated code review

# Run Claude as a reviewer on every PR
claude -p "Review the diff in this PR for:
1. Security vulnerabilities
2. Performance issues
3. Missing error handling
4. Deviations from CLAUDE.md conventions
Format as GitHub review comments." --permission-mode plan

Incident analysis

# Pipe logs into Claude for analysis
kubectl logs deployment/api --since=1h | \
  claude -p "Analyze these logs for errors. Identify root cause and suggest fix."

12. Models and Reasoning

Rewritten on 27 September 2026. The May 2026 table listed Opus 4.7 and Sonnet 4.6; the current models are below.

ModelStrengthsBest for
Claude Fable 5.1 (claude-fable-5-1)Premium tier; 1M context; $10 / $50 per million tokens, $0.25 cache readsThe hardest debugging, design and multi-repo work
Claude Opus 5.5 (claude-opus-5-5)Default Opus; 1M context; $4 / $20 per million tokens, $0.20 cache readsComplex refactors, architecture, hard debugging
Claude Sonnet 5Fast, strong code qualityDaily coding, most tasks
Claude Haiku 4.5Fastest, lightweightQuick edits, simple questions, background classification

Switch with /model. Managed settings let admins restrict the list: availableModels allows models, availableModelsMatch: "exact" makes an entry match only the version it names so new releases stay blocked until listed, and deniedModels blocks specific models even if allowed. The PreModelSwitch and PostModelSwitch hooks can block, confirm or annotate a switch.

Extended thinking and effort

Modern Claude models can think step by step before answering, which helps most for multi-file debugging, unfamiliar codebases, security analysis and design trade-offs. Effort controls how much reasoning is applied; higher effort is slower and costs more. Set it with --effort at launch or /effort in a session.

LevelWhen to use
lowQuick lookups, one-line edits, simple questions.
mediumMost coding tasks — a good balance.
highMulti-file refactors, architecture planning, complex debugging.
xhighHard problems needing sustained reasoning. Some models fall back to high or refuse it with thinking off.
maxSession-only maximum effort; cost scales up sharply.
# Launch with effort level
claude --effort high

# Or switch mid-session
/effort high

auto resets to the model’s built-in default. The changelog notes that ultracode is only offered on models that support xhigh.

13. The Explore → Plan → Code Workflow

This is the recommended workflow for complex tasks, and it's where Claude Code shines compared to both Copilot (too interactive for large tasks) and Codex (too autonomous for ambiguous tasks):

Step 1: Explore

> "I need to add rate limiting to our API. First, explore the codebase
   and tell me: what middleware exists, how requests are routed, and
   whether there's any existing rate limiting or throttling code."

Claude uses the Explore subagent to search the codebase, read relevant files, and report back without making any changes.

Step 2: Plan

> "Based on what you found, create a detailed implementation plan for
   adding Redis-backed rate limiting. Consider our existing middleware
   pattern, error handling conventions, and test structure."

Claude produces a plan: which files to create/modify, what patterns to follow, which tests to write. You review and adjust.

Step 3: Code

> "Execute the plan. Implement the rate limiter, add tests, and ensure
   all existing tests still pass."

Claude implements the plan step by step. Because you guided the exploration and approved the plan, the implementation is much more likely to be correct on the first try.

Why this works

This workflow manages context deliberately. The Explore phase finds relevant code without polluting the main context. The Plan phase creates a structured approach. The Code phase executes with clear direction. Each phase keeps the context focused and productive.

14. Context Management

Context management is critical in Claude Code because, unlike Copilot (which has IDE context) or Codex (which starts fresh each task), Claude Code accumulates context over a conversation. Managing it well is the difference between a productive 2-hour session and a confused agent after 30 minutes.

Strategies

  • Use subagents for investigation. Instead of asking the main session to "search for all uses of X," use the Explore subagent. It returns only the summary, not all the file contents.
  • Start fresh for new tasks. Don't reuse a session from morning debugging for afternoon feature work. Start a new session with /clear or a new claude invocation.
  • Be specific about scope. "Fix the bug in src/auth/login.ts" is better than "fix the authentication" because it doesn't require Claude to search the entire codebase.
  • Use /compact. This command summarizes the conversation so far and resets the context, keeping key decisions but dropping raw file contents.
  • Fork for tangents. If you want to explore a "what if" without losing your current context, use fork mode to create a branch of the conversation.

Prompt caching

Claude Code automatically uses prompt caching when you continue a session with claude -c or claude --resume. Instead of re-sending the full conversation history on every request, Claude caches the static parts of the prompt (system instructions, CLAUDE.md content, prior turns) so only the new message is charged at full price. The cached portion is billed at a fraction of the regular input token cost.

Practically, this means: long-running sessions become progressively cheaper per turn. If you're running claude in CI or scripted pipelines across many machines, pass --exclude-dynamic-system-prompt-sections to remove machine-specific data (working directory, hostname) from the system prompt so the cached prefix matches across runs.

15. Slash Commands — Quick Reference

Claude Code has a rich set of slash commands that control the session, manage context, and trigger specific actions. Type them directly in the conversation prompt.

Session management

CommandWhat it does
/clearWipe all conversation history. Fresh start, zero context carried over.
/compactCompress history into a summary — keeps decisions, drops raw file dumps. Run this every 30–40 exchanges in long sessions.
/compact [instructions]Compact with a focus: /compact only keep changes to the auth module. Lets you steer what gets preserved.
/costShow token count and estimated API cost for the current session.
/statusShow account status, API connection health, and current usage limits.

Project setup

CommandWhat it does
/initAnalyze the current project and auto-generate a CLAUDE.md file. Detects build commands, test commands, and code patterns. Run this first on every new project.
/memoryOpen the CLAUDE.md memory file directly in your editor for manual editing.
#textAdd text to project memory inline without opening the file: # always use async/await, never .then() chains. Claude appends it to CLAUDE.md immediately.

Planning and control

CommandWhat it does
/plan [description]Enter plan mode — Claude proposes a full execution plan before touching any files or running any commands. Pass a description to seed the plan directly: /plan fix the auth bug.
/goal [condition|clear]Set a persistent goal: Claude keeps working across turns until the condition is met. /goal alone shows the current goal. /goal clear removes it. Great for long-running autonomous tasks.
/ultraplan <prompt>Draft a detailed plan in a cloud ultraplan session, review it in your browser, then execute remotely or send it back to the terminal. Higher quality than /plan for large tasks.
/review [PR]Review a pull request locally in the current session. Auto-detects the PR for the checked-out branch, or pass a PR number/URL. For a deeper multi-agent cloud review, use /ultrareview.
/security-reviewAnalyze pending changes on the current branch for security vulnerabilities — checks for injection, auth issues, and data exposure in the diff.
/diffOpen an interactive diff viewer showing uncommitted changes and per-turn diffs. Use arrow keys to switch between the current git diff and individual Claude turns.

Context and background work

CommandWhat it does
/context [all]Visualize current context window usage as a colored grid with optimization tips. Pass all to expand the per-item breakdown.
/btw <question>Ask a quick side question without adding it to the main conversation history. Keeps the transcript clean when you just need a quick lookup.
/background [prompt]Detach the current session to run as a background agent and free your terminal. Pass a final instruction before detaching. Monitor with claude agents. Alias: /bg.
/batch <instruction>Orchestrate large-scale changes across a codebase in parallel — Claude decomposes the work into units and spawns one background subagent per unit in an isolated git worktree.

Model and interface

CommandWhat it does
/model [name]Switch models mid-session: /model claude-sonnet-4-6. Context is preserved. Use arrow keys in the picker to also adjust effort level.
/effort [level|auto]Set reasoning effort: low, medium, high, xhigh, or max. auto resets to model default. Takes effect immediately without waiting for the current response.
/terminal-setupInstall Shift+Enter keybinding so you can write multi-line prompts in the terminal without accidentally submitting.

Maintenance

CommandWhat it does
/doctorCheck Claude Code installation health: API connection, config validity, model availability. Run when something feels off.
/helpShow all available commands with descriptions.
/export [filename]Export the current conversation as plain text. With a filename, writes to that file; without, opens a dialog to copy or save.
/rewindRewind the conversation and code to a previous checkpoint. Opens a picker to choose the turn. Aliases: /checkpoint, /undo.
/configOpen the Settings interface to adjust theme, model, output style, and other preferences. Alias: /settings.
/bugOpen a pre-filled bug report for Claude Code itself.
/loginRe-authenticate or switch Anthropic accounts.
/logoutSign out of the current account.

Priority commands to memorise: /init on every new project, /compact during long sessions, /plan before complex tasks, /goal for autonomous multi-turn work, /clear when switching contexts, and /cost to keep API usage in check.

16. Claude Code for DevOps — Real Workflows

Workflow 1: Infrastructure as Code

> "Create a new EKS cluster module in infra/modules/eks/ following
   our existing module patterns. Include: VPC integration, managed
   node groups with spot instances, cluster autoscaler IAM role,
   and security groups. Run terraform validate when done."

Claude explores your existing modules for patterns, creates the new module, and validates it — all in one session where you can steer and correct.

Workflow 2: Incident response

> "We're seeing 500 errors on /api/payments since the last deploy.
   Look at the recent git commits, check the payment service code,
   and analyze these error logs: [paste logs]"

# Claude investigates, identifies the issue

> "Fix it and write a regression test."

Workflow 3: Migration scripts

> "We need to migrate from Redis 6 to Redis 7. Explore our codebase
   for all Redis usage, identify any deprecated commands or patterns,
   and create a migration checklist."

# After review:

> "Execute items 1-5 on the checklist. Create a migration branch."

Workflow 4: Documentation generation

> "Generate runbook documentation for our production services.
   For each service in k8s/deployments/, document: what it does,
   dependencies, health check endpoints, common failure modes,
   and recovery procedures. Base this on the code, not guesses."

17. Routines — Scheduled Recurring Tasks

Routines let Claude Code run tasks on a schedule — daily, weekly, or triggered by events. Think of them as cron jobs powered by AI.

Use cases

  • Daily dependency check: Scan for outdated or vulnerable dependencies every morning.
  • Weekly code quality: Run a code quality analysis and create issues for degradation.
  • PR triage: Review new PRs on a schedule and leave initial feedback.
  • Log analysis: Periodically analyze production logs for anomalies.

Configuration

// .claude/routines/daily-security.json
{
  "name": "Daily Security Scan",
  "schedule": "0 9 * * *",
  "prompt": "Run npm audit and check for known vulnerabilities in our dependencies. If any critical/high severity issues are found, create a GitHub issue with the details and suggested fixes.",
  "permission_mode": "auto"
}

18. Pricing and Plans (September 2026)

Rewritten on 27 September 2026 from Anthropic’s pricing page.

PlanPriceClaude Code
Free$0Not included
Pro$20 / month ($17 billed annually)Included, shared usage limits
MaxFrom $100 / month (5x or 20x options)Included, much higher shared limits
Team, standard seat$25 / month ($20 annual)Included with all features
Team, premium seat$125 / month ($100 annual)5x the usage of a standard seat
Enterprise$20 / seat / month billed annually, plus usage at API ratesFull access with organisational controls
API (BYOK)Pay per tokenBring your own key or a cloud provider

Paid plans can turn on usage credits to keep working at standard API rates after hitting plan limits. Fable 5.1 can require usage credits on some plans; the /model picker shows a prompt when it does. Weekly limits are shown in /usage.

For heavy daily use, compare a Max tier against paying API rates for your real token volume; the cache-read prices ($0.20 and $0.25 per million tokens) make long, well-cached sessions much cheaper than a naive estimate.

19. Comparison: Claude Code vs Copilot vs Codex

Copilot Codex Claude Code IDE (VS Code, JetBrains) Cloud sandbox (ChatGPT) Terminal / IDE / Web Interactive, real-time Async, task-based Conversational, steerable Inline completions Quick edits, debugging Parallel delegation Verified, isolated tasks Complex refactors Deep reasoning, exploration Tab completions, NES Multi-model choice No internet (secure) Citations, verifiable Hooks, subagents, teams Full system access $10–39/mo (Individual–Business) $20–200/mo (Plus–Pro) $17–200/mo (Pro–Max 20x)

Fig 2 — Side-by-side comparison of the three major AI coding tools. Each excels in a different workflow.

20. Tips That Actually Matter

  1. Write a thorough CLAUDE.md. This is your single highest-leverage action. Include build commands, architecture, conventions, and gotchas.
  2. Use Explore → Plan → Code. Don't jump straight to implementation for complex tasks. Let Claude understand the codebase first.
  3. Manage context aggressively. Use /compact when the conversation gets long. Start fresh sessions for new tasks. Use subagents for investigation.
  4. Set up hooks early. Auto-formatting, linting, and dangerous-command blocking should be configured from day one.
  5. Create custom subagents for your team. A security reviewer, a test writer, a documentation generator — domain experts that any team member can invoke.
  6. Use permission modes intentionally. Start with default to learn the tool, move to auto when comfortable, use dontAsk only in CI/sandboxes.
  7. Give verification criteria. "Ensure all tests pass," "validate with terraform plan," "check that the API still returns 200 for the health endpoint."
  8. Invest in MCP servers. Connect Claude to your actual tools — GitHub, databases, monitoring. This turns it from a code editor into a full development workflow tool.
  9. Use non-interactive mode for CI. claude -p "..." integrates into any pipeline for automated reviews, documentation, and analysis.
  10. Combine with other tools. Use Copilot for inline completions while using Claude Code for complex refactors. Use Codex for background tasks while using Claude Code for your active session.

Series Wrap-Up

This series covered the complete landscape of AI coding tools for developers and DevOps engineers in 2025–2026:

  1. Fundamentals — how these tools work under the hood (context windows, tool layers, agent loops).
  2. GitHub Copilot — the IDE-native tool for real-time pair programming.
  3. Codex — the cloud agent for async task delegation.
  4. Claude Code — the terminal agent for deep reasoning and complex workflows.

The "best" tool depends on your workflow, your team, and your tasks. Most professional developers will use two or all three in combination. The key insight is that these tools aren't competing for the same use case — they complement each other:

  • Copilot for what you're doing right now (inline completions, quick chat, IDE-native agent mode).
  • Codex for what you want done in the background (parallel tasks, verified PRs, batch delegation).
  • Claude Code for what requires deep thinking and flexibility (complex refactors, incident response, infrastructure changes).

The developers and DevOps engineers who master all three modalities — real-time, async, and conversational — will have a significant productivity advantage. Not because any single tool is a silver bullet, but because choosing the right tool for each task eliminates the friction that slows us down.

← Codex Secondary Private IPs →
© cvam — written in plaintext, served warm