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 Opus 4.7. 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.
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.
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:
| Tool | What it does |
|---|---|
Bash | Run shell commands — tests, builds, git operations, anything the terminal can do. |
Read | Read a file's contents into context. |
Edit | Apply targeted edits to an existing file — replaces a specific string rather than rewriting the whole file. |
Write | Create or overwrite a file entirely. |
Glob | Find files matching a pattern, e.g. src/**/*.ts. |
Grep | Search file contents with a regex or string. |
LS | List directory contents. |
WebFetch | Fetch a URL and read its content — used for docs, API references, etc. |
TodoRead / TodoWrite | Manage 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 |
|---|---|---|
| Terminal | claude command | Full power, scripting, CI |
| VS Code | Extension panel | IDE integration with file context |
| JetBrains | Plugin | IntelliJ/PyCharm users |
| Desktop app | Standalone app | Quick access without terminal |
| Web | claude.ai | Browser-based, no install |
| Slack | Slack app | Team collaboration |
| GitHub | @claude mention in PRs | Code 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 by | Claude Code | Codex | GitHub Copilot |
| Scoping | Directory tree + home | Directory tree | Repo-level only |
| Personal prefs | ~/.claude/CLAUDE.md | ~/.agents/AGENTS.md | VS Code settings |
| Format | Markdown (any structure) | Markdown (any structure) | Markdown (any structure) |
| Auto-loaded | Yes, always | Yes, always | Yes, 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 |
|---|---|---|
default | Asks before file edits and commands | Learning the tool, sensitive repos |
acceptEdits | Auto-approves file edits, asks for commands | Active coding sessions |
auto | Auto-approves safe actions, asks for risky ones | Experienced users, trusted projects |
dontAsk | Runs everything without asking | Automated workflows, CI |
plan | Read-only — no edits, no commands | Exploration, architecture discussions |
bypassPermissions | Skips all safety checks | Sandboxed environments only |
Setting permissions
# Start with specific mode
claude --permission-mode auto
# Or set in .claude/settings.js?v=6on
{
"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 |
|---|---|---|
PreToolUse | Before any tool execution | Validate commands, block dangerous actions |
PostToolUse | After a tool completes | Auto-format, run linters, log actions |
SessionStart | When a session begins | Load context, check environment |
Stop | Before Claude stops responding | Run final checks, summarize session |
SubagentStop | When a subagent finishes | Validate 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.js?v=6on
{
"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.js?v=6on
{
"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
- Your main Claude session identifies tasks that can be parallelized.
- It spawns additional agent sessions (team members), each with a specific task.
- Each team member works independently in their own context.
- 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 |
|---|---|---|
| Environment | Same machine, shared filesystem | Isolated sandboxes per task |
| Communication | Can share context and files | Completely independent |
| Coordination | Main agent orchestrates | No coordination |
| Speed | Real-time | Async (minutes) |
| Conflict handling | Coordinated by main agent | Manual 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
@claudein 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
Claude Code supports multiple Claude models, each with different strengths:
| Model | Strengths | Best for |
|---|---|---|
| Claude Opus 4.7 | Deepest reasoning, most capable | Complex refactors, architecture, debugging |
| Claude Sonnet 4.6 | Fast, excellent code quality | Daily coding, most tasks |
| Claude Haiku 4.5 | Fastest, lightweight | Quick edits, simple questions |
Extended thinking
Claude Opus 4.7 can engage in "extended thinking" — visible reasoning chains where it works through complex problems step by step. This is particularly powerful for:
- Debugging complex, multi-file issues.
- Understanding unfamiliar codebases.
- Architectural decisions with many trade-offs.
- Security analysis requiring careful reasoning.
Extended thinking shows you Claude's reasoning process, making it easier to understand why it made certain decisions — and to catch flawed reasoning before it becomes flawed code.
Effort levels
Effort controls how much reasoning Claude applies before responding. Higher effort = more thorough output but slower and more expensive. Set it with the --effort flag at launch or the /effort command mid-session:
| Level | When to use |
|---|---|
low | Quick lookups, one-line edits, simple questions. |
medium | Default for most coding tasks — good balance of speed and depth. |
high | Multi-file refactors, architecture planning, complex debugging. |
xhigh | Hard problems that require sustained reasoning chains. |
max | Session-only maximum effort. Use sparingly — 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. Effort takes effect immediately without waiting for the current response to finish.
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
/clearor a newclaudeinvocation. - 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
| Command | What it does |
|---|---|
/clear | Wipe all conversation history. Fresh start, zero context carried over. |
/compact | Compress 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. |
/cost | Show token count and estimated API cost for the current session. |
/status | Show account status, API connection health, and current usage limits. |
Project setup
| Command | What it does |
|---|---|
/init | Analyze 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. |
/memory | Open the CLAUDE.md memory file directly in your editor for manual editing. |
#text | Add 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
| Command | What 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-review | Analyze pending changes on the current branch for security vulnerabilities — checks for injection, auth issues, and data exposure in the diff. |
/diff | Open 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
| Command | What 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
| Command | What 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-setup | Install Shift+Enter keybinding so you can write multi-line prompts in the terminal without accidentally submitting. |
Maintenance
| Command | What it does |
|---|---|
/doctor | Check Claude Code installation health: API connection, config validity, model availability. Run when something feels off. |
/help | Show 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. |
/rewind | Rewind the conversation and code to a previous checkpoint. Opens a picker to choose the turn. Aliases: /checkpoint, /undo. |
/config | Open the Settings interface to adjust theme, model, output style, and other preferences. Alias: /settings. |
/bug | Open a pre-filled bug report for Claude Code itself. |
/login | Re-authenticate or switch Anthropic accounts. |
/logout | Sign 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
| Plan | Price | What you get |
|---|---|---|
| Pro | $17–20/mo | Standard usage, Claude Sonnet 4.6, limited Opus |
| Max 5x | $100/mo | 5x usage, all models including Opus 4.7 |
| Max 20x | $200/mo | 20x usage, priority access, all features |
| Enterprise | Custom | SSO, admin controls, audit logs, custom limits |
| API (BYOK) | Pay per token | Bring your own API key, pay Anthropic directly |
For teams doing heavy AI-assisted development, the Max 20x plan ($200/mo) with Opus 4.7 access provides the best cost-to-capability ratio. For occasional use or lighter workflows, Pro is sufficient.
19. Comparison: Claude Code vs Copilot vs Codex
Fig 2 — Side-by-side comparison of the three major AI coding tools. Each excels in a different workflow.
20. Tips That Actually Matter
- Write a thorough CLAUDE.md. This is your single highest-leverage action. Include build commands, architecture, conventions, and gotchas.
- Use Explore → Plan → Code. Don't jump straight to implementation for complex tasks. Let Claude understand the codebase first.
- Manage context aggressively. Use
/compactwhen the conversation gets long. Start fresh sessions for new tasks. Use subagents for investigation. - Set up hooks early. Auto-formatting, linting, and dangerous-command blocking should be configured from day one.
- Create custom subagents for your team. A security reviewer, a test writer, a documentation generator — domain experts that any team member can invoke.
- Use permission modes intentionally. Start with
defaultto learn the tool, move toautowhen comfortable, usedontAskonly in CI/sandboxes. - Give verification criteria. "Ensure all tests pass," "validate with terraform plan," "check that the API still returns 200 for the health endpoint."
- 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.
- Use non-interactive mode for CI.
claude -p "..."integrates into any pipeline for automated reviews, documentation, and analysis. - 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:
- Fundamentals — how these tools work under the hood (context windows, tool layers, agent loops).
- GitHub Copilot — the IDE-native tool for real-time pair programming.
- Codex — the cloud agent for async task delegation.
- 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.