Claude Code is most useful when it is treated as an engineering collaborator rather than a one-shot code generator. The quality of the result depends less on writing a clever prompt and more on giving the agent a disciplined workflow: establish project context, inspect before editing, plan risky changes, isolate research, and verify the outcome.
This is the workflow I use for real codebases.
Every session starts with a limited context window. If your architecture, commands, conventions, and review rules only live in chat messages, you will repeat yourself and eventually get inconsistent results.
A concise CLAUDE.md should answer the questions a new teammate would ask:
Keep these instructions concrete. “Write clean code” is vague; “use pnpm, keep database access in src/data, and run pnpm test before handoff” is actionable.
The official documentation explains how project instructions and auto memory work together: How Claude remembers your project.
A reliable session begins with evidence. Ask Claude to locate relevant files, trace the current data flow, identify tests, and explain the likely change surface.
For a bug, a strong sequence is: This prevents a common failure mode: implementing a plausible solution in the wrong layer.
Small, local changes often do not need a formal plan. Cross-cutting work does.
Plan first when a task touches authentication, database migrations, deployment, public APIs, permissions, billing, or multiple packages. The plan should name affected components, data migrations, compatibility risks, verification steps, and rollback considerations.
Claude Code supports a read-only planning workflow so you can review the approach before files are changed. See the official common workflows guide.
Large repository searches can consume the main conversation with logs and file contents. Subagents are useful for bounded investigations such as:
The main agent should still integrate the findings, make the final tradeoffs, and verify the complete change. Delegation is most effective when the subtask has a concrete question and a clear output.
The subagent documentation covers isolated contexts, tool access, and permission modes.
“Code written” is not the same as “task complete.” A useful handoff should include evidence appropriate to the risk:
For migrations and automation, also test idempotency and failure recovery. For browser workflows, verify human handoff points such as CAPTCHA, MFA, service terms, file selection, and final publication. When the same checklist keeps appearing, encode it instead of relying on memory.
Use CLAUDE.md for always-on project facts. Use skills for reusable, on-demand procedures. Use hooks for deterministic lifecycle actions. Use MCP when Claude needs structured access to an external service. Use subagents when research should happen in an isolated context. Choosing the smallest extension that solves the problem keeps the system understandable. The official extension overview provides a useful comparison.
A durable default loop is:
Understand → Plan when needed → Implement narrowly → Verify → Record what was learned
That loop scales from a one-file bug fix to a multi-step automation project. It also makes AI-assisted work reviewable: every important decision has context, every mutation has a reason, and every completion claim has evidence.
For more tutorials on Claude Code setup, workflows, agents, context management, and extensions, I maintain an independent multilingual resource at Claude AI Dev. The goal is not to automate judgment away. It is to give the agent enough structure to apply judgment consistently.