← Setup tutorial Module 04 · Agentic Engineering

Claude Code CLI introduction

This tutorial explains the Claude Code CLI as an AI harness. It connects the first safe task with project instructions, working context, external tools and delegated research.

Last verified 25 August 2026

Complete the setup path before beginning.Use a disposable practice folder without confidential files.

Claude Code becomes useful through the relation between model, harness and project environment.

Step 1

Read Claude Code as a complete working system

Claude Code is an AI harness that connects a language model with project files, tools, permissions and execution feedback.

  1. A request defines the current goal and its boundaries.
  2. The harness selects context and exposes available actions.
  3. Tool results become evidence for the next model call.
  4. Checks determine whether the task may continue or is complete.

Check: you can distinguish the model, the harness and the project state in one Claude Code session.

A bounded workspace and recorded Git state make the first exercise inspectable.

Step 2

Prepare the local CLI workspace

  1. Use a disposable Git repository without credentials or confidential files.
  2. Confirm that the operating system, shell and account meet the current Claude Code requirements.
  3. Run git status --short outside Claude Code and record the starting state.
  4. Locate the project instructions and its maintained verification commands.

Check: the repository boundary, access route and Git baseline are known before Claude Code starts.

Official Claude Code quickstart

Installation is complete when Claude Code starts in the intended folder and passes a local diagnostic.

Step 3

Install, open and verify one controlled workspace

  1. Follow the operating-system route in the official installation guide.
  2. Complete the Claude Code setup step in the shared ai-workspace folder.
  3. Run claude --version and claude doctor in a reopened terminal.
  4. Start claude from the practice folder and confirm the displayed working directory.

Check: the installed interface and the current folder are both visible before the first request.

Video: Installing Claude Code · Official quickstart

The first task has one observable result and prohibits technical changes.

Step 4

Begin with a bounded read-only task

A useful first request states the object, permitted action and completion evidence.

  1. Name the exact folder or files Claude Code may inspect.
  2. State that files and commands remain unchanged during this check.
  3. Request a short inventory and ask it to flag uncertainty.
  4. Compare the answer with the visible Explorer before expanding the task.

Check: the reported file list matches the folder and its modification times remain unchanged.

Modes and interventions change what the harness may do during the same task.

Working loop

Choose a mode that matches the next action

  1. Use Plan mode to inspect the project and receive an execution plan before source changes.
  2. Approve edits only after the proposed scope and verification method are clear.
  3. Use Bash mode for a command you have selected and want to run yourself.
  4. Use Esc to interrupt a running loop and supply new information or a new boundary.

Check: the selected mode permits the required work and blocks actions outside the current task.

Permission modes · Interactive controls

Instructions, maintained knowledge and technical controls perform different functions.

Step 5

Keep persistent project rules in CLAUDE.md

CLAUDE.md tells Claude Code how work is performed in a project. It can name routes into a larger knowledge base without copying that knowledge into every session.

  1. Record stable commands, file conventions and completion checks.
  2. Link to the maintained document that owns each substantive concept or decision.
  3. Keep task-specific evidence in its source file and load it when required.
  4. Use permissions and hooks where a rule requires technical enforcement.

Check: every persistent instruction has a clear scope and can be followed without guessing.

Project instructions and auto memory

Permission mode, tool rules and task scope jointly define what Claude Code may do.

Step 6

Inspect the permission boundary before action

Claude Code evaluates tool use against its active permission mode and configured rules. The first exercise uses Plan mode so repository inspection precedes any proposed change.

  1. Enter Plan mode and inspect the permission state before sending the task.
  2. Review allowed and denied tool rules at user, project and local scope.
  3. Keep bypass permissions disabled for the practice repository.
  4. Approve an action only when its command, target and expected effect match the task.

Check: the active mode supports inspection and every write-capable action still requires an explicit decision.

Permission modes · Permission rules

Context management keeps the current working set aligned with the immediate task.

Context management

Curate the working context for the current step

The context window contains instructions, selected files, tool outputs and conversation history available to the current model call.

  1. Use /context to inspect what occupies the current window.
  2. Name relevant files directly and exclude folders that cannot contribute evidence.
  3. Use /compact when the same task continues after a long investigation.
  4. Use /clear when a distinct task needs an empty working context. The saved session remains available for later resumption.

Check: every large context item contributes to the next decision or tool action.

Context window · How Claude Code works

A screenshot enters the verification loop as evidence of a specific interface state.

Visual feedback

Turn screenshots into explicit acceptance checks

  1. Capture the smallest stable region that demonstrates the issue.
  2. Remove accounts, personal paths, tokens and confidential project data.
  3. Describe the observed state and the required state in text.
  4. Render the result at the same viewport and compare it with one acceptance criterion.

Check: the final screenshot demonstrates the requested state under the same conditions.

Common workflows

The extension mechanisms enter different parts of the agentic working system.

Step 7

Choose the mechanism by the function it performs

Persistent instructions shape every session. Skills load reusable procedures, MCP connects external systems and plugins package extensions for installation and distribution.

Project rule

Use CLAUDE.md for conventions that apply whenever Claude Code works in this project.

Procedure

Use a Skill for a repeatable method that should load when a matching task appears.

Connection or distribution

Use MCP for external systems and a plugin when several extension components must travel together.

Official extension overview

MCP provides a standardised tool boundary between the harness and an external system.

External systems

Add an MCP connection for a defined external need

The Model Context Protocol lets Claude Code use tools supplied by an external service or local server.

  1. Name the external data or action required by the task.
  2. Inspect the server source, requested credentials and available tools.
  3. Separate read access from tools that create, edit or send information.
  4. Add the server at the narrowest appropriate scope and inspect its state with /mcp.

Check: every exposed tool is required for the workflow, and its read or write effect is understood.

Official MCP guide

A Skill discloses detailed instructions and resources when its task becomes relevant.

Reusable procedures

Use Skills for knowledge that should travel with a workflow

A Skill is a reusable instruction package for a defined class of tasks. Claude Code can load it when the task matches its description or when the user invokes it.

  1. Stabilise the procedure and its completion check through a successful recurring workflow.
  2. Define one concrete task class and the trigger that should load it.
  3. Keep the main procedure in SKILL.md and supporting examples or scripts in separate resources.
  4. Run the Skill on a fresh case and verify the artefact through its stated completion checks.

Check: the Skill removes repeated procedural prompting while keeping its evidence and checks inspectable.

Skills in the extension overview

A plugin packages related extension components as one installable capability bundle.

Distribution

Package a stable extension when it must be reused

Plugins can bundle Skills, subagents, hooks and MCP servers for installation across projects or teams.

  1. Develop a project-specific extension in .claude/ while its contract is still changing.
  2. Package the components after their triggers, permissions and checks are stable.
  3. Inspect a plugin and its included servers before installation.
  4. Use a marketplace as a catalogue and install only the selected plugin.

Check: the plugin has a defined purpose, trusted source and reviewable component list.

Create plugins · Discover plugins

A subagent investigates one bounded question in an isolated context and returns a compact result.

Delegated research

Delegate a clear research question to a fresh context

Subagents are useful when the direction is already known and one distinct question requires concentrated investigation or extensive file reading. Each subagent begins with a fresh, isolated context window; only its returned result enters the main conversation.

  1. State one answerable question and why it matters to the main task.
  2. Provide the required source frame, boundaries and return format.
  3. Ask for findings, evidence and unresolved uncertainty.
  4. Let the main agent compare results, integrate accepted findings and run the final checks.

Check: the returned summary answers the delegated question and cites the evidence required for integration.

Official subagent guide · Parallel agent patterns

Context isolation and file isolation solve different coordination problems.

Parallel work

Match the worker and workspace to the task

A subagent supports one main session. A parallel session is an independently supervised working thread. A Git worktree gives a writing session its own checkout so concurrent edits do not collide.

  1. Use a subagent for a bounded investigation whose detailed exploration should remain outside the main context.
  2. Use a separate session when an independent task needs direct supervision and its own context.
  3. Start a writing session with claude --worktree <name> when another session edits the same repository.
  4. Compare the outputs, resolve conflicting assumptions and run shared checks before integration.

Check: each worker owns an independent question or file area, and concurrent edits cannot overwrite one another.

Parallel agent patterns · Claude Code worktrees

Remote Control exposes a running local session through another interface while execution remains on the local machine.

Optional control surface

Continue a local session from a remote interface

Remote Control is a research-preview route to the same local Claude Code session. The browser or mobile app controls it; the working directory, tools and permissions remain on the host machine.

  1. Check the current official availability, account and organisation requirements.
  2. Start with claude remote-control, claude --remote-control or /remote-control inside a running session.
  3. Open the displayed link or QR code on the intended remote device.
  4. Confirm the session and working directory before approving or interrupting an action.

Check: both interfaces show the same conversation and project while execution remains on the local host.

Official Remote Control guide

The introduction becomes a hub for focused routes into the mechanisms used by a particular workflow.

Next routes

Continue with the mechanism your work requires

Context Engineering

Instructions and working context

Develop a maintainable route from project rules and knowledge documents to selected task evidence.

Start with instructions

Tool integration

MCP and extension scope

Connect one external system and document its tools, credentials, permissions and checks.

Start with MCP

Delegated research

Subagents and synthesis

Decompose a research question into isolated investigations and an explicit integration step.

Start with subagents

Parallel work

Sessions and worktrees

Run independent work in separate contexts and isolate concurrent file changes before integration.

Start with sessions

Remote workflow

Local execution, remote control

Connect another control surface to a running local session while the host retains project execution.

Start with Remote Control

Visual workflows

Screenshot-based verification

Use stable captures and matching viewports to turn an interface observation into testable evidence.

Start with screenshots

Check: select one route because it resolves a concrete need in the current project.

The first exercise closes with source references and an independent Git check.

Step 8

Run one reversible repository orientation

Ask Claude Code in Plan mode to inspect the repository, identify applicable instructions and explain its maintained checks.

  1. Request a compact repository summary with direct file references.
  2. Ask for the applicable CLAUDE.md files and existing verification commands.
  3. Compare the answer with the cited files and command definitions.
  4. Exit Claude Code and run git status --short in the terminal.

Check: repository evidence supports the summary and git status --short matches the recorded baseline.

Plan mode · Project instructions