Updated May 2, 2026

Claude Code guide: terminal agent, plan mode, and memory

A practical guide to Claude Code workflows, permissions, CLAUDE.md, subagents, MCP, hooks, checkpoints, and team setup.

Claude Code is the strongest first trial for developers who want an agent inside the normal engineering loop: terminal, Git, tests, package managers, logs, and pull requests. The current docs describe a product that now spans terminal, VS Code, desktop, web, JetBrains, Slack, CI/CD, MCP, subagents, skills, hooks, memory, and permission modes.

The important buying point is not “Claude writes good code.” Many tools can produce useful patches with a strong model. Claude Code’s advantage is the operating model around the patch: planning before edits, permission modes, repo memory, checkpoints, worktrees, subagents, and a lot of affordances for experienced developers who want to stay close to the code.

Where Claude Code Fits

Use caseWhy Claude Code is goodWhat to require
Codebase explorationIt can inspect files, trace flows, and answer architecture questionsAsk it to cite files and avoid changing code
Bug fixingIt can reproduce errors, edit, run commands, and iterateProvide the failing command and expected behavior
RefactoringPlan mode supports read-only analysis before large editsRequire milestones and rollback notes
Test workIt can match local test patterns and add missing casesName the behavior, not just coverage percentage
PR preparationIt can summarize changes, create commits, and open PRsReview the final PR text and risk notes
Team workflowsCLAUDE.md, settings, hooks, and MCP make behavior repeatableKeep rules short and enforce sensitive limits in settings

Claude Code is not the best first surface for non-coders who want a hosted app from a prompt. It is also not the quietest autocomplete tool. It shines when a developer can define a task, watch or constrain the work, and review the diff.

Start With Plan Mode For Risky Work

Plan mode is one of Claude Code’s best safeguards. It lets Claude analyze the repository with read-only operations, ask clarifying questions, and propose a plan before edits. Use it for multi-file changes, unfamiliar code, security-sensitive areas, migrations, and refactors.

Good plan-mode prompt:

Analyze the billing permissions flow. Do not edit files yet. Produce a migration plan that keeps public APIs stable, identifies tests to update, and lists rollback steps.

After reviewing the plan, ask for one milestone at a time. The worst way to use an agent is to hand it a vague rewrite and review a giant patch. The better loop is inspect, plan, edit one slice, run checks, review, then continue.

Use CLAUDE.md For Rules, Not Essays

Claude Code uses CLAUDE.md files for persistent project instructions. The docs are clear that these are context, not hard enforcement. They work best when concise and specific.

Good CLAUDE.md content:

# Project Commands
- Install: pnpm install
- Test: pnpm test
- Typecheck: pnpm typecheck
- Lint: pnpm lint

# Repo Rules
- Do not edit generated Prisma migrations by hand.
- Keep API response shapes backward compatible.
- For auth changes, add or update tests under tests/auth.

Avoid turning CLAUDE.md into a policy encyclopedia. If a rule applies only to one package, use path-scoped rules. If a workflow is multi-step, make it a skill. If a limit must be enforced, put it in settings, not only in prose.

If a repository already has AGENTS.md for Codex or other agents, Claude Code can import it from CLAUDE.md with @AGENTS.md, then add Claude-specific notes below it. That keeps the repo from growing several drifting instruction files.

Permissions And Sensitive Files

Claude Code has permission modes across its surfaces. The current labels include ask-before-edits, edit automatically, plan mode, auto, and bypass permissions. Cloud sessions expose a narrower set than local sessions.

For team use, start conservative:

  • Use plan mode for auth, billing, data deletion, migrations, and infrastructure.
  • Deny reads for .env, .env.*, secrets folders, and credential files.
  • Keep local preferences in local settings rather than checked-in project settings.
  • Disable dangerous permission modes with managed settings when the organization requires it.
  • Treat CLAUDE.md as behavioral guidance and settings as enforcement.

The settings docs show permissions.deny as the way to hide sensitive files from Claude Code. Use that before giving an agent access to a private repo.

Subagents, Skills, MCP, And Hooks

Claude Code has moved beyond one chat window operating on one task. The useful advanced pieces are:

  • Subagents: separate task-specific agents with their own context and tool permissions.
  • Skills: reusable playbooks such as debugging, batch work, or project-specific operations.
  • MCP: connectors for external tools and data sources.
  • Hooks: commands that run around tool use, useful for logging, formatting, blocking risky actions, or enforcing local checks.
  • Checkpoints: restore conversation, code, or both after Claude changes files.
  • Worktrees: run parallel sessions without trampling the same files.

Use these only when the problem justifies them. A one-line bug fix does not need a custom subagent. A recurring security review checklist probably does.

A First Week Trial

Run Claude Code against five real tasks:

TrialPrompt shapePass condition
Explore“Explain auth from request to database. Cite files.”Accurate map, no edits
Bug“Reproduce this failing command, fix the smallest cause, rerun it.”Small patch, command output
Refactor“Plan first, then implement step one only.”Reviewable milestone
Tests“Add edge-case tests matching local patterns.”Tests fail before or pass for the right reason
PR“Summarize changes and risks before opening a PR.”Useful PR body, no hidden changes

Measure review burden. Claude Code is valuable when it makes the final human review sharper, not when it produces code faster while making maintainers anxious.

When Claude Code Should Rank First

Rank Claude Code first when the buyer is an experienced developer or team that lives in the terminal and wants strong local agency. It is a better fit than Cursor for task-shaped repo work, debugging, tests, and refactors. It is a better fit than app builders when the codebase already matters.

Rank Codex first when the buyer wants one system spanning local agent work, cloud delegation, GitHub review, and automation. Rank Cursor first when the daily editor loop is the main need. Rank Lovable or Bolt first when the task starts as a product prototype.

Claude Code is not a toy for prompt-only app generation. It is a serious engineering tool when paired with Git hygiene, plan mode, clear permissions, and human review.

Sources