terminal window showing Claude Code executing a multi-step coding task, dark background with vivid syntax highlighting

Claude Code Tutorial: Commands, Plugins, Skills & Workflows (2026)

This claude code tutorial covers everything you need to go from zero to productive with Anthropic’s terminal-native AI coding agent — installation, core commands, MCP plugins, multi-agent workflows, and CI/CD integration.

What Is Claude Code?

Claude Code is an AI-powered, terminal-native agentic coding assistant that understands your entire codebase and can work across multiple files and tools simultaneously. According to the Claude Code Official Overview, it runs in the Terminal (CLI), VS Code, JetBrains IDEs, a standalone Desktop app, and on the Web — all backed by the same underlying engine.

That last point matters. Your CLAUDE.md configuration files, settings, and MCP servers work identically across every surface. Switch from the terminal to VS Code mid-session and nothing breaks.

How It Differs from Chat-Based Claude

Chat-based Claude operates in a turn-by-turn conversation model: you ask, it responds, you copy code manually. Claude Code is fundamentally different — it is agentic. It can read your file system, run shell commands, spawn sub-agents, call external APIs via MCP, and iterate on its own output without you shepherding each step. The result is a tool that can scaffold an entire feature, write the tests, and open a draft PR while you review something else.

annotated screenshot of Claude Code slash command palette with key commands labeled and described


Installation and Authentication

Installing Claude Code

According to the Claude Code Official Overview, installation varies by platform:

PlatformCommand
macOS / Linux / WSLcurl -fsSL https://claude.ai/install.sh | bash
Windows PowerShellirm https://claude.ai/install.ps1 | iex
Homebrew (macOS)brew install --cask claude-code
WinGet (Windows)winget install Anthropic.ClaudeCode

Note: Native installs (curl/PowerShell) auto-update automatically. Homebrew and WinGet installs do not — you’ll need to run claude update manually or re-run the package manager command.

Authenticating

Once installed, run claude auth login to authenticate with your Anthropic account. For CI/CD pipelines, use claude setup-token to generate a long-lived OAuth token that doesn’t require interactive login. Check your current auth state at any time with claude auth status.


Core Commands Reference

The Claude Code CLI Reference documents the full command set. Here are the essential ones with practical annotations:

Session Management

claude                        # Start an interactive session in the current directory
claude -c                     # Continue your most recent conversation
claude -r "auth-refactor" "What did we decide about JWT expiry?"
                              # Resume a named session by ID or name
claude -p "Explain the auth middleware in src/middleware/auth.ts"
# Runs a single query, prints output, then exits — ideal for scripting

Add --max-budget-usd 0.50 to cap API spend per invocation (print mode only), and --max-turns 10 to limit how many agentic steps Claude takes before stopping.

Background Agents

claude --bg "Refactor the payments module to use the new Stripe SDK"
claude agents   # Monitor all running background agents

According to the Claude Code Official Overview, background agents let you kick off long-running tasks and check back later. The --teleport flag pulls a cloud web session into your local terminal, and --remote-control lets you drive the terminal session from claude.ai or the Claude mobile app.

System Prompt Control

The Claude Code CLI Reference documents four system prompt flags:

  • --system-prompt — replaces the entire default prompt inline
  • --system-prompt-file — replaces with the contents of a file
  • --append-system-prompt — appends text to the default prompt
  • --append-system-prompt-file — appends file contents to the default prompt

The two replacement flags are mutually exclusive, but either can be combined with an append flag. For project-specific conventions, CLAUDE.md is the preferred approach; system prompt flags suit one-off persona or style overrides.


CLAUDE.md, Skills, and Auto Memory

CLAUDE.md

Place a CLAUDE.md file at your project root and Claude Code reads it at the start of every session. According to the Claude Code Official Overview, you can use it to encode:

  • Coding standards and linting rules
  • Architecture decisions and preferred libraries
  • PR review checklists
  • Environment setup steps

This replaces the need to re-explain your stack every session.

Auto Memory

Claude Code also builds auto memory automatically — it saves learnings like build commands, test runner flags, and debugging insights across sessions without any manual writing. Over time, it accumulates project-specific knowledge that makes each session faster.

Skills and Hooks

Skills package repeatable workflows into slash commands. Examples from the official docs include /review-pr and /deploy-staging. Hooks let you run arbitrary shell commands before or after Claude Code actions — useful for linting on save, running tests after file writes, or posting Slack notifications.


MCP Plugin Ecosystem

Model Context Protocol (MCP) is the mechanism that makes Claude Code extensible. According to the Claude Code MCP Documentation, MCP is an open-source standard for connecting Claude Code to external tools, databases, and APIs.

architecture diagram showing Claude Code MCP plugin system connecting to external tools and APIs, clean line-art style

Adding MCP Servers

MCP servers can be added at three scopes:

ScopeStorageUse Case
Local.mcp.jsonPrivate to you in the current project
Project.mcp.json (committed)Shared with the team via version control
User~/.claude.jsonAvailable across all your projects

HTTP, SSE (deprecated), and stdio transports are supported. To add the Notion MCP server:

claude mcp add --transport http notion https://mcp.notion.com/mcp

By default, MCP Tool Search is enabled. According to the Claude Code MCP Documentation, this defers tool definitions so only tool names load at session start — keeping context window usage low. Claude discovers relevant tools on demand via a search tool, and only tools it actually uses enter the context window.

Control this behavior with the ENABLE_TOOL_SEARCH environment variable (values: unset/true/auto/auto:N/false). Tool search requires Sonnet 4 or Opus 4+ models; Haiku models do not support it.

Managing MCP Output Size

Claude Code warns when any MCP tool output exceeds 10,000 tokens. The default maximum is 25,000 tokens. To raise it:

export MAX_MCP_OUTPUT_TOKENS=50000

MCP server authors can raise per-tool limits up to 500,000 characters by setting _meta["anthropic/maxResultSizeChars"] in the tools/list response.


Advanced Skills and Prompting Strategies

Getting the most from Claude Code requires deliberate prompting. A few patterns that work well:

Be scope-explicit. Instead of “fix the bug,” try “fix the null-pointer exception in UserService.getById() without changing the method signature.” Narrower scope means fewer unwanted side effects.

Use multi-agent delegation. According to the Claude Code Official Overview, Claude Code supports spawning multiple sub-agents via the Agent SDK. A lead agent coordinates work, assigns subtasks, and merges results. For large refactors, this dramatically cuts wall-clock time.

Pipe shell output directly. The CLI’s print mode accepts stdin:

tail -200 app.log | claude -p "Slack me if you see anomalies"
git diff main --name-only | claude -p "review these changed files for security issues"

Constrain turns for cost control. --max-turns 5 prevents runaway agentic loops on ambiguous tasks. Pair it with --max-budget-usd when running in automated contexts.


Context Window Management

Long sessions accumulate context quickly. A few practices help:

  • Use CLAUDE.md instead of re-explaining. Static project facts belong in the file, not in every prompt.
  • Rely on MCP Tool Search. As noted above, it keeps unused tool definitions out of the context window entirely.
  • Start fresh sessions for unrelated tasks. Use claude -r to resume specific sessions rather than letting one session sprawl across unrelated work.
  • Scope your file reads. Ask Claude to read specific files rather than entire directories when only a subset is relevant.

CI/CD Pipeline Integration

According to the Claude Code Official Overview, Claude Code integrates with GitHub Actions and GitLab CI/CD for automated PR reviews and issue triage. The claude setup-token command generates a long-lived OAuth token suited for non-interactive CI environments.

A minimal GitHub Actions step might look like:

- name: Claude Code PR Review
  run: |
    git diff origin/main --name-only | \
    claude -p "Review these changed files for security issues and summarize findings" \
    --max-budget-usd 0.25
  env:
    CLAUDE_TOKEN: ${{ secrets.CLAUDE_TOKEN }}

Recurring tasks can be automated via Routines (Anthropic-managed infrastructure) or Desktop scheduled tasks — useful for nightly dependency audits or weekly code quality reports.


Real-World Workflow Examples

Scaffolding a Feature

claude "Scaffold a REST endpoint for user profile updates: route, controller, service, and repository layers. Follow the patterns in src/users/."

Claude Code reads your existing src/users/ directory, infers your naming conventions, and generates all four layers consistently.

Writing Tests

claude "Write unit tests for UserService covering the happy path and the three error cases in the JSDoc. Use the existing Jest setup in src/__tests__/."

Reviewing a Diff

git diff main | claude -p "Identify any security issues, missing error handling, or deviations from our CLAUDE.md standards"

This pipes the diff directly — no copy-pasting required.


Claude Code vs. GUI-Based Agents

For a detailed head-to-head, see our Cursor vs. Claude Code vs. Copilot comparison. A quick summary:

Claude CodeCursor / GUI Agents
InterfaceTerminal-native, any surfaceGUI-first
AutomationScriptable, pipeable, CI-readyPrimarily interactive
ContextFull codebase, multi-fileEditor-scoped
ExtensibilityMCP open standardProprietary plugin systems
Learning curveSteeper initiallyLower for GUI users

Claude Code’s terminal-native design makes it significantly more powerful for automation, scripting, and CI/CD integration. GUI agents like Cursor tend to be more approachable for developers who prefer visual interfaces and inline diff views.


Token Cost Management

Claude Code costs scale with context size and the number of agentic turns. Practical strategies:

  • Use --max-budget-usd to hard-cap spend on any single print-mode invocation.
  • Use --max-turns to prevent runaway loops on ambiguous prompts.
  • Enable MCP Tool Search (on by default) to avoid loading unused tool definitions into context.
  • Prefer Sonnet 4 for most tasks — Opus 4 is more capable but significantly more expensive; reserve it for complex reasoning tasks.
  • Batch related changes into a single session rather than opening many short sessions, which each pay a base context cost.

For a full breakdown of model pricing across Claude Code and competing tools, see our AI coding agent pricing guide.


Claude Code Alternatives

Claude Code is one of several capable AI coding agents available in 2026. Our best AI coding agents roundup covers the full landscape, including tools optimized for different workflows and budgets.

If you’re evaluating Claude Code against specific alternatives, our Cursor vs. Claude Code vs. Copilot comparison provides a structured side-by-side analysis. For broader guidance on how to use any AI coding tool effectively, the AI coding best practices guide covers prompting patterns, review workflows, and team adoption strategies that apply regardless of which agent you choose.


Summary

Claude Code is a genuinely different kind of coding tool — not a chat assistant with a code block, but a terminal-native agent that can read your codebase, run commands, call external APIs, spawn sub-agents, and integrate directly into your CI/CD pipeline. The learning curve is real, but the payoff in automation capability is substantial.

Start with installation, authenticate, drop a CLAUDE.md in your project root, and run your first claude -p pipe command. From there, add MCP servers for the tools your team already uses, define Skills for your most repeated workflows, and wire it into GitHub Actions for automated PR review. Each step compounds.