What this covers
Day-to-day patterns for using Claude Code on real projects — the ones that survive past your first week and still apply six months later. The pain: most beginners learn the basics, run a few impressive demos, and then fall into bad habits (giant tasks, no commits, stale CLAUDE.md) that erode trust over time. This guide names the repeatable patterns that keep an agent useful indefinitely.
Key tools and concepts:
- Claude Code: Anthropic’s command-line AI coding agent that reads, edits, and runs code in your terminal.
- Planning prompt: Asking for a plan before code; the single highest-leverage habit for steady output.
- Anchor commits: Frequent, small commits between agent steps that bound the rollback distance.
Who this is for
Developers using Claude Code already and shipping with it. Especially valuable if you have hit the wall where the first three weeks went well and now you are getting more rework than progress.
When to reach for it
Daily project work: features, refactors, bug fixes, test additions, dependency upgrades. Not for one-off scripts (just chat with Claude) and not for greenfield architecture decisions (talk to a human first).
Before you start
- Treat each session like a tiny PR. Pick a single goal, write it down in one sentence, and resist scope creep.
- Make sure CLAUDE.md reflects current reality. Out-of-date conventions confuse the agent more than no conventions.
- Ensure tests pass on
mainbefore you start. Otherwise you cannot tell whether the agent broke something or you inherited a break. - Decide which commands the agent is allowed to run without asking — set explicit allow/ask in
.claude/settings.json.
Step by step
- Plan before coding:
Outline a plan, do not write code yet. List files to change, files to create, tests to add, and out-of-scope files.Front-load the right files using an AI coding context management workflow so the plan is grounded in real code. - Review the plan critically. Cut scope if it mentions more than 5 files. Push back on anything you didn’t ask for.
- Run plan changes one PR at a time. Each PR equals one logical change; bundling makes review impossible.
- Use TODO comments as anchors —
// TODO(claude): extract this into a separate functionlets you point the agent at exact spots in subsequent sessions. - Commit small, descriptive commits — easy to revert, easy to bisect, easy to write a meaningful PR description from.
- End each session with a one-paragraph summary of what changed and what is unfinished. Paste it into the PR description so reviewers (and future you) have context.
First-run exercise
- Take your current Claude Code workflow and identify one step you usually skip. Most commonly: the planning prompt.
- Run your next task with that step explicitly added. Notice whether output quality changes.
- Compare commit log before and after — smaller commits, fewer reverts means the habit is working.
- Add the habit as a rule in CLAUDE.md so the agent enforces it on you.
Quality check
- Each commit passes tests and lints — non-negotiable. The agent should not move to the next step on a broken state.
- Diffs are scoped — only the files the plan mentioned. If extras appear, ask why.
- PR descriptions are coherent — if you cannot describe what changed in 3 sentences, you bundled too much.
- The agent’s behavior matches what CLAUDE.md says. Drift between rules and behavior means the rules are too vague.
How to reuse this workflow
- Save your favorite planning prompts as slash commands (
.claude/commands/plan.md). - Maintain a personal “agent style guide” — the half-dozen phrases that consistently get you the output you want.
- Audit CLAUDE.md monthly. Remove rules the agent now follows by default; add rules for new mistakes.
- Build a “session journal” — one line per session, what worked, what didn’t. Patterns appear after 20 entries.
Recommended workflow
Plan -> review plan -> small change -> tests -> commit -> diff against main -> next task. Repeat until the session goal is met, then write a one-paragraph summary into the PR.
FAQ
- How big should a single agent task be?: 1-3 files, under 200 lines diff. Larger and review breaks down.
- Should the agent run my tests?: Yes, but you verify the test count and pass/fail status. Some agents have been known to summarize “tests pass” when they actually skipped.
- What about long-running sessions?: Cap at 30 minutes unattended. After that, attention drifts and bad diffs slip through.
- Can the agent open PRs?: With the GitHub integration, yes — see Claude GitHub Integration Workflow.
- How do I handle merge conflicts?: Resolve them yourself first, then ask the agent for the next change. Agents resolve conflicts badly.
- Is it OK to skip the planning prompt for tiny tasks?: For 1-line fixes yes; anything touching more than one function, plan first.
Common mistakes
- Asking for huge multi-file changes at once — you get a diff you cannot review.
- No commits between tasks — when something breaks two tasks later, you cannot bisect.
- Not maintaining CLAUDE.md — outdated conventions confuse the agent more than no rules.
- Skipping the planning prompt because “this is easy” — easy tasks bundle scope creep too.
- Auto-approving every command — the dangerous one slips through eventually.
- Treating the agent as authoritative on design decisions — it is fast at execution, not opinionated about what is right.
Related
- Claude Code intro
- Every Claude Code Slash Command, Explained: /usage to /agents
- Claude Code Beginner Guide
- Claude Code Project Setup
- Project Prompts for Claude Code
Tags: #Claude #Tutorial #Claude Code