Claude Code Mechanics
Map Claude Code mechanics: CLAUDE.md, Plan Mode, context, sessions, statusline, Remote Control, slash commands, hooks, subagents, ultracode, dynamic workflows, permissions, and workflow design.
Claude Code mechanics are the features that decide how a session behaves after the basic install is done. This hub explains when to use CLAUDE.md, Plan Mode, context management, sessions, statusline, Remote Control, slash commands, hooks, subagents, ultracode, dynamic workflows, permissions, and related workflow patterns in real projects.
Last checked on July 7, 2026. Claude Code changes quickly, so this page is written as a decision map: start with the workflow problem, then open the deep guide for the mechanism that solves it. The May 2026 Opus 4.8 rollout added dynamic workflows and the
ultracodeeffort setting as high-interest topics, so large background orchestration now has its own guides.
Quick Answer
If Claude Code feels unreliable, expensive, noisy, or hard to repeat, the answer is usually not "write a longer prompt." Use the right mechanism for the workflow:
- Use
CLAUDE.mdwhen Claude needs durable project rules. - Use Plan Mode when the task is risky enough to deserve a plan before edits.
- Use context management when the session is getting long or unfocused.
- Use sessions when you need to resume, rename, branch, or hand off a coding conversation.
- Use statusline when the terminal should show model, context, branch, or usage signals at a glance.
- Use Remote Control when you need to steer a local session from another device.
- Use slash commands when a prompt pattern repeats.
- Use hooks when something should happen automatically around a Claude Code event.
- Use subagents when a side task should run in its own context and return a summary.
- Use dynamic workflows when a large audit, migration, or research task needs scripted orchestration across many subagents.
- Use ultracode when you want
xhigheffort plus Claude deciding whether dynamic workflows are warranted. - Use permissions and tool allowlists when tool access needs policy, not habit.
The mechanics work best together. A stable project usually has a concise CLAUDE.md, a few reusable commands, narrow permissions, focused context habits, and one or two specialized agents or hooks only after the workflow is proven.
Choose The Right Mechanic
| Workflow problem | Start with | Why it fits |
|---|---|---|
| Claude forgets project conventions | CLAUDE.md | Persistent instructions load into sessions and keep team rules visible. |
| The change is large or risky | Plan Mode | Read-only planning reduces surprise edits and clarifies implementation order. |
| The session is full of old logs and unrelated files | Context management | Context budgeting keeps the model focused on the current decision. |
| You need to continue or recover previous work | Sessions | Resume, rename, compact, clear, or branch conversations deliberately. |
| You need visible model, branch, or usage signals | Statusline | A small terminal footer reduces repeated status checks. |
| You need to steer a local session from another device | Remote Control | Remote Control keeps execution local while allowing browser or mobile steering. |
| You repeat the same prompt every week | Slash commands | Commands turn repeatable workflows into named entry points. |
| A risky command should be blocked before it runs | Hooks | PreToolUse hooks and permissions can enforce safety at execution time. |
| Tests or research produce too much output | Subagents | Subagents isolate noisy work and return only the useful summary. |
| A broad task needs many agents and cross-checking | Dynamic workflows | Workflow scripts can coordinate background subagents and return a checked result. |
| You want Claude to choose workflow orchestration | Ultracode | ultracode combines xhigh effort with automatic workflow choice. |
| MCP tools can write to external systems | MCP security checklist | External tool access needs explicit boundaries and verification. |
| Teammates need the same operating model | Tools allowlist | Shared permissions make behavior predictable across sessions. |
Do not add every mechanism at once. Start with the smallest feature that solves the current failure mode.
Core Guides
CLAUDE.md
CLAUDE.md is the project memory file. It is where you put durable project instructions: architecture boundaries, test commands, branch rules, naming patterns, writing style, forbidden directories, and delivery expectations.
Use it when a rule should survive across sessions. Avoid turning it into a giant manual. Claude reads better when the file is specific, current, and organized around decisions the agent actually makes.
Plan Mode
Plan Mode is for slowing the workflow down before edits. It is useful for migrations, refactors, production fixes, ambiguous user requests, or anything where the cost of a wrong edit is high.
The best Plan Mode flow is simple: explore the code, explain the intended changes, confirm assumptions, then implement. It is not a substitute for tests, but it prevents many bad first edits.
Context Management
Context management is how you keep Claude focused when the conversation grows. The goal is not to maximize context usage; the goal is to keep only the information that affects the next decision.
Good context habits include starting fresh for unrelated tasks, summarizing handoff notes before compaction, passing exact files and errors to subagents, and avoiding huge pasted logs unless the log is the task.
Sessions
Sessions explain how to continue a saved Claude Code conversation, resume by name or ID, branch a session, and avoid carrying stale context into unrelated tasks.
Use sessions for continuity. Use /clear and /compact for context hygiene. Do not treat a saved session as a permanent project brain.
Statusline
Statusline is the terminal footer for operational signals: model, current project, branch, context percentage, estimated cost, and rate-limit pressure.
Use it when you repeatedly check the same session state. Keep it short, local, and free of secrets.
Remote Control
Remote Control lets a local Claude Code session be steered from claude.ai/code, mobile, or another browser while execution stays on your machine.
Use it for in-progress local work that needs remote steering. Do not confuse it with Claude Code on the web, which runs in Anthropic-managed cloud infrastructure.
Slash Commands
Slash commands turn repeated instructions into named workflows. Use them for review checklists, release checks, documentation updates, SEO page audits, migration passes, or any task where the prompt shape matters.
Commands are best when they are narrow and predictable. If a command grows into a multi-step operating procedure with domain rules, consider moving the logic into a skill or project documentation.
Hooks
Hooks run around Claude Code lifecycle events. They can block risky Bash commands, validate file writes, run checks after edits, send notifications, or log activity.
Hooks are powerful because they are automatic. Start with observe or warn behavior before blocking. Keep hook scripts small, auditable, and documented in CLAUDE.md.
Subagents
Subagents are specialized workers with their own context and role. Use them for noisy side tasks: code review, test triage, security inspection, official-source checking, or independent research.
Subagents are not shared memory. A normal subagent does not automatically know the full parent conversation. Delegation prompts should include paths, errors, decisions, and output expectations.
Dynamic Workflows
Dynamic workflows are for tasks too large for a handful of manual subagent calls. Claude writes a workflow script, coordinates many background agents, cross-checks results, and returns a single report.
Use them for repository-wide audits, large migrations, and high-stakes research. Avoid them for small edits or anything cost-sensitive until you have narrowed the scope.
Ultracode
Ultracode is the effort setting that combines xhigh reasoning with automatic dynamic workflow orchestration. It helps answer when to use ultracode effort, how ultracode differs from xhigh, and how to think about Claude Code ultracode cost.
Use it for a scoped hard session, not as a permanent default. If Opus 4.8 suddenly feels slow or expensive, check Opus 4.8 slow or expensive troubleshooting before blaming the model.
If the question is whether to use a prompt-level deep thinking request or a workflow effort setting, start with Ultrathink vs Ultracode.
A Practical Setup Path
For a new or newly migrated project, configure mechanics in this order:
- Write a small
CLAUDE.md: include project purpose, commands, directories, and quality rules. - Set conservative permissions: allow common read and edit tools, ask before broad Bash or external writes.
- Create one or two slash commands: start with review, content audit, or release checklist.
- Use Plan Mode on risky work: migrations, redirects, pricing pages, auth, payment, deployment, or broad content changes.
- Add context habits: reset sessions by topic, compact with handoff notes, and avoid mixing unrelated tasks.
- Name sessions and add a simple statusline: make long work resumable and visible before adding heavier automation.
- Add subagents only for repeated noisy tasks: test triage, source checking, code review, or security review.
- Use dynamic workflows only for large scoped work: audits, migrations, or cross-checked research that would otherwise flood the main session.
- Use ultracode only for serious sessions: turn it on for hard scoped work, then return to
higheffort. - Add hooks only after the rule is proven: block
.envwrites, warn on deploy, or log MCP write tools.
This order keeps the system understandable. The mistake is usually adding automation before the workflow is clear.
Mechanics By Team Maturity
| Stage | What to configure | What to avoid |
|---|---|---|
| Solo exploration | CLAUDE.md, Plan Mode, context discipline | Team-wide hooks and complex agents |
| Active project work | Slash commands, tools allowlist, focused context rules | Large memory files and broad permissions |
| Team adoption | Project CLAUDE.md, shared commands, documented review flow | Hidden automation that teammates cannot explain |
| High-risk repository | Permission rules, hooks, read-only reviewers, release checklist | Auto-accepting destructive tools |
| Content or documentation site | Source-check command, content-review subagent, dated official sources | Publishing thin pages without links or verification |
| Large migration or audit | Dynamic workflow pilot, ultracode only for scoped hard sessions, worktree isolation, explicit verification stage | Open-ended ultracode sessions without scope or cost checks |
How To Choose A Mechanics Page
If Claude Code is already installed but you are not sure which feature fits the problem in front of you, start here:
| Your current problem | Start with |
|---|---|
You do not know what to put in CLAUDE.md | A deep mechanics guide with examples |
| You want Claude Code to plan before editing code | A workflow decision guide |
| You need to resume, compact, clear, branch, or name sessions | The sessions guide |
| You want to see model, context, cost, and branch state | The statusline guide |
| You want to steer a local session from another device | The remote control guide |
| You want to block risky actions or log tool usage | The hooks guide |
| You want to delegate work to focused roles | The subagents guide |
| You want complex review work to run in the background | Dynamic workflows, ultracode, cost, and safety guidance |
| You need to decide whether higher reasoning effort is worth it | Effort setting, workflow trigger, cost, and availability guide |
| You want to compare ultrathink and ultracode | The FAQ comparison, then the ultrathink or ultracode deep guide |
| You want to reuse team commands | The slash commands guide |
| You want less context waste and fewer drifting sessions | The context management guide |
Each mechanics page starts with the practical answer, then explains when to use the feature, how to configure it, common mistakes, and the related tutorial, FAQ, MCP, or troubleshooting page.
Related Learning Paths
Use these paths when you are not sure where to start:
- New user path: Installation -> Basic usage -> CLAUDE.md -> Plan Mode
- Team setup path: Tools allowlist -> CLAUDE.md -> Slash commands -> Hooks
- Advanced workflow path: Context management -> Subagents -> Dynamic workflows -> Ultracode -> MCP security checklist
- Session control path: Sessions -> Statusline -> Remote Control -> VS Code account check
- Deep reasoning path: Ultrathink vs Ultracode -> Ultrathink Mode -> Ultracode
- Troubleshooting path: Troubleshooting hub -> Context management -> Hooks
Related Hubs
- Claude Code FAQ
- Claude Code tutorial center
- MCP directory
- Troubleshooting
- Resources and tools
- VS Code and IDE account check