Context Engineering
Instructions and working context
Develop a maintainable route from project rules and knowledge documents to selected task evidence.
Start with instructionsThis 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.
Step 1
Claude Code is an AI harness that connects a language model with project files, tools, permissions and execution feedback.
Check: you can distinguish the model, the harness and the project state in one Claude Code session.
Step 2
git status --short outside Claude Code and record the starting state.Check: the repository boundary, access route and Git baseline are known before Claude Code starts.
Step 3
ai-workspace folder.claude --version and claude doctor in a reopened terminal.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.
Step 4
A useful first request states the object, permitted action and completion evidence.
Check: the reported file list matches the folder and its modification times remain unchanged.
Working loop
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.
Step 5
CLAUDE.mdCLAUDE.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.
Check: every persistent instruction has a clear scope and can be followed without guessing.
Step 6
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.
Check: the active mode supports inspection and every write-capable action still requires an explicit decision.
Context management
The context window contains instructions, selected files, tool outputs and conversation history available to the current model call.
/context to inspect what occupies the current window./compact when the same task continues after a long investigation./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.
Visual feedback
Check: the final screenshot demonstrates the requested state under the same conditions.
Step 7
Persistent instructions shape every session. Skills load reusable procedures, MCP connects external systems and plugins package extensions for installation and distribution.
Use CLAUDE.md for conventions that apply whenever Claude Code works in this project.
Use a Skill for a repeatable method that should load when a matching task appears.
Use MCP for external systems and a plugin when several extension components must travel together.
External systems
The Model Context Protocol lets Claude Code use tools supplied by an external service or local server.
/mcp.Check: every exposed tool is required for the workflow, and its read or write effect is understood.
Reusable procedures
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.
SKILL.md and supporting examples or scripts in separate resources.Check: the Skill removes repeated procedural prompting while keeping its evidence and checks inspectable.
Distribution
Plugins can bundle Skills, subagents, hooks and MCP servers for installation across projects or teams.
.claude/ while its contract is still changing.Check: the plugin has a defined purpose, trusted source and reviewable component list.
Delegated research
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.
Check: the returned summary answers the delegated question and cites the evidence required for integration.
Parallel work
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.
claude --worktree <name> when another session edits the same repository.Check: each worker owns an independent question or file area, and concurrent edits cannot overwrite one another.
Optional control surface
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.
claude remote-control, claude --remote-control or /remote-control inside a running session.Check: both interfaces show the same conversation and project while execution remains on the local host.
Next routes
Context Engineering
Develop a maintainable route from project rules and knowledge documents to selected task evidence.
Start with instructionsTool integration
Connect one external system and document its tools, credentials, permissions and checks.
Start with MCPDelegated research
Decompose a research question into isolated investigations and an explicit integration step.
Start with subagentsParallel work
Run independent work in separate contexts and isolate concurrent file changes before integration.
Start with sessionsRemote workflow
Connect another control surface to a running local session while the host retains project execution.
Start with Remote ControlVisual workflows
Use stable captures and matching viewports to turn an interface observation into testable evidence.
Start with screenshotsCheck: select one route because it resolves a concrete need in the current project.
Step 8
Ask Claude Code in Plan mode to inspect the repository, identify applicable instructions and explain its maintained checks.
CLAUDE.md files and existing verification commands.git status --short in the terminal.Check: repository evidence supports the summary and git status --short matches the recorded baseline.