Prompt.Lab

Claude Code / Practical guide

Use Claude Code like a careful teammate—not an autocomplete box.

A real-project workflow for understanding a repository, planning a change, editing with boundaries, verifying the result, and reviewing what will actually ship.

Prompt.Lab Editorial13 min readOfficial sources reviewed

Claude Code is an agentic coding tool: it can read a codebase, edit files, run commands, and work with development tools from a terminal, IDE, desktop app, or browser. That power is useful only when the task gives it a clear destination and a way to prove it arrived.

The strongest workflow is not “ask for an app and hope.” Anthropic's guidance repeatedly emphasizes context, verification, and a deliberate explore–plan–implement loop. The goal is to make every step inspectable by you.

The seven-step Claude Code workflow

01

Prepare

Open the correct repository, understand its commands, and protect secrets before asking for changes.

02

Explore

Ask Claude to inspect the relevant files and trace the current behavior without editing anything.

03

Plan

Agree on scope, risks, affected files, and a concrete verification strategy.

04

Implement

Request one focused change with explicit boundaries and acceptance criteria.

05

Verify

Run the real test, lint, build, or browser check that can prove the change works.

06

Review

Inspect the final diff for accidental edits, missing cases, security issues, and unnecessary complexity.

07

Handoff

Summarize what changed, how it was tested, and what still needs a human decision.

1. Prepare the repository

Start in the smallest correct workspace. Know the project's build, test, lint, and development commands. Keep credentials in environment variables, never paste production secrets into a prompt, and review any command that could affect external systems or data.

The correct repository and branch are open.

Existing uncommitted work is understood and protected.

The project can already build or its existing failure is recorded.

Secrets, customer data, and production access are outside the prompt.

A real verification command or observable result is available.

2. Make Claude explore before it edits

For an unfamiliar feature, separate investigation from implementation. Ask Claude to locate the relevant files, trace the data flow, identify tests and conventions, and report uncertainty. This prevents a confident change built on the wrong part of the system.

Explore this repository without changing files.

Goal: understand how [FEATURE OR BEHAVIOR] currently works.

Trace the flow from [ENTRY POINT] to [FINAL EFFECT]. Identify:
- the files and functions that own the behavior;
- existing tests and project conventions;
- external dependencies or data boundaries;
- assumptions you cannot verify from the repository;
- the smallest likely change surface.

Return a concise evidence-based map with file paths. Do not implement yet.

3. Turn the investigation into a plan

A useful plan names the files that may change, the behavior that must stay unchanged, likely risks, and exactly how the result will be checked. If the plan is too broad to review, reduce the task before coding.

Using the repository evidence you found, propose a minimal implementation plan for [CHANGE].

Acceptance criteria:
- [OBSERVABLE RESULT 1]
- [OBSERVABLE RESULT 2]

Constraints:
- preserve [EXISTING BEHAVIOR];
- do not change [OUT-OF-SCOPE AREA];
- follow the repository's existing patterns;
- add or update focused tests.

List affected files, risks, test strategy, and any decision you need from me. Do not edit yet.

4. Implement one reviewable change

Once the plan is correct, authorize the focused implementation. Tell Claude to stop when the requested behavior is complete, preserve unrelated user changes, and avoid opportunistic rewrites. Smaller diffs are easier to test, understand, and undo.

5. Give Claude a test it cannot talk around

Anthropic recommends giving Claude a way to verify its work. That may be an automated test suite, a type check, a build, a screenshot, a browser interaction, or a precise expected output. “Looks correct” is not a test.

Verification rule

Every important claim in the handoff should point to evidence: a passing command, a focused test, a visible state, or a clearly marked limitation.

Use CLAUDE.md as project memory

Claude Code can read a CLAUDE.md file for persistent project instructions. Keep it concise and specific: include the commands that matter, non-obvious architecture, naming conventions, and workflows Claude would otherwise guess incorrectly. Anthropic recommends avoiding a giant rulebook; instructions that are short and testable are easier to follow.

# Project guide

## Commands
- Build: npm run build
- Test: npm test
- Lint: npm run lint

## Architecture
- API secrets stay in server routes.
- UI components never access the database directly.

## Working rules
- Preserve unrelated local changes.
- Add focused tests for behavior changes.
- Report the exact verification commands and results.

Manage context deliberately

Long sessions accumulate old assumptions and irrelevant details. Use summaries for handoffs and clear the context between unrelated tasks. When a project is complex, give Claude the most relevant files and decisions instead of repeatedly pasting everything.

Review the diff before you trust the result

Read the changed files. Check that the feature matches the original acceptance criteria, no secret entered the repository, error states still work, dependencies are justified, and tests cover the real risk. Claude can help review its own diff, but it cannot replace the owner's judgment.

Review the complete diff as a skeptical maintainer.

Check it against the original acceptance criteria. Report:
1. what changed and why;
2. any behavior changed outside the requested scope;
3. security, privacy, accessibility, or performance risks;
4. missing tests and unverified assumptions;
5. the exact commands already run and their results.

Do not edit anything during this review.

The practical standard

Explore first, plan from evidence, implement a narrow change, verify it with a real check, and review the final diff. Claude Code becomes more useful when your process makes mistakes visible early.

Turn theory into a better result

Your idea is good.
Give it better instructions.

Paste a rough request into Prompt.Lab and get a structured prompt for ChatGPT, Claude, or Gemini.

Try Prompt.Lab free →

Continue exploring

View all →