# Learn Claude — Part 7: Coding with Claude & Claude Code

Coding is Claude's most celebrated strength, and it comes in two distinct modes: **chat-assisted coding** (you drive, Claude advises) and **agentic coding with Claude Code** (Claude drives, you review). Professionals use both — and know when each applies.

## Mode 1: Chat-assisted coding, done properly

The four core moves — generate, debug, explain, review — you likely know. What separates effective use is *how*:

**Debugging: give the full picture.** The highest-value debugging prompt contains three things: the **complete error message** (or a screenshot — vision works), the **relevant code**, and **what you already tried**. That last one prevents Claude from suggesting the fix you've already ruled out.

**State your environment, always.** "React 18 + TypeScript, no external libraries, must support older browsers" transforms answer quality. Put your permanent stack in Project instructions (Part 6) so you never repeat it.

**Review with a rubric.** "Review this" gets generic praise. "Review for: security issues, error handling gaps, and anything that will confuse the next developer — cite line numbers" gets a real review. Then run the reversal from Part 3: *"now argue why your suggested refactor might be a mistake."*

**Learn, don't just paste.** The prompt "add comments explaining the *why* of each block, and tell me one concept I should study" turns every answer into a lesson. Beginners: combined with Artifacts (Part 5), you can build and *understand* real projects from day one.

**Verify by execution.** Claude's code is good but not guaranteed. The loop is: run it → paste any error back → repeat. Fast, and honest.

## Mode 2: Claude Code — the agentic shift

Chat coding has a ceiling: you are the hands, copying snippets file by file. **Claude Code** removes it. It's a tool from Anthropic that runs in your **terminal** (with desktop and mobile apps too, and IDE integrations) with direct access to your project. Given a task, it:

1.  **Explores** your codebase — reads files, understands structure
    
2.  **Plans** the change and shows you the plan
    
3.  **Executes** — edits multiple files, runs commands and tests
    
4.  **Self-corrects** — sees failing tests and fixes its own work
    
5.  **Reports** — you review the diff, like a pull request from a colleague
    

The difference in kind: *"add password-reset flow to this app"* is one instruction, not forty copy-pastes.

**Getting started:** requires a paid Claude plan or API access. Install via npm (`npm install -g @anthropic-ai/claude-code`), run `claude` inside your repo. Current setup details: [docs.claude.com/en/docs/claude-code](https://docs.claude.com/en/docs/claude-code/overview).

## Working professionally with Claude Code

**Write a CLAUDE.md.** A file in your repo root that Claude Code reads automatically — your Project instructions, but for code: build commands, conventions, architecture notes, "never touch X" warnings. Ten minutes writing it pays back on every session.

**Plan before executing.** For non-trivial tasks, ask for a plan first and approve it before edits begin. Steering a plan is cheap; unwinding a wrong implementation is not.

**Scope tasks like tickets.** "Fix the timezone bug in report generation" succeeds. "Make the app better" wanders. If you couldn't hand it to a junior dev as written, don't hand it to the agent.

**Review diffs like a reviewer, not a spectator.** You remain the engineer of record. Agentic speed plus rubber-stamp review is how subtle bugs ship. Tests, permissions on risky commands, and git are your safety rails — commit before big agent sessions.

**Know the escalation ladder.** Quick question → chat. Single-file snippet → chat + Artifact. Multi-file feature, refactor, test-suite work → Claude Code. Choosing the right rung *is* the skill.

## A realistic session

```plaintext
you:    (in repo) claude
you:    Our /export endpoint times out on large datasets.
        Find the cause and propose a fix — plan first.
claude: [reads code] The endpoint loads all rows into memory...
        Plan: stream results, add pagination, update 2 tests. Proceed?
you:    Proceed.
claude: [edits 3 files, runs tests, one fails, fixes it]
        Done — diff ready for review.
```

That's the shape of modern development: you supply judgment and intent; the agent supplies throughput.

## Exercise

**Non-developers:** in chat, build a small web page in an Artifact, then ask Claude to explain every block and quiz you on it. **Developers:** install Claude Code on a side project, write a minimal CLAUDE.md, and delegate one well-scoped ticket — plan-first. Review the diff critically. Form your own opinion of where the ceiling is.

## Next up

**Part 8, the finale:** the API, automation, and the habits that make all of this durable — the full professional's toolkit.
