# First task — let it edit a file

Web page: https://academy.memberpress.ai/courses/code-intro/l2/

Lesson 2 of 8 in [Claude Code — Getting Started](https://academy.memberpress.ai/courses/code-intro/), 7 min.

Video: https://www.youtube.com/watch?v=w8M41vEtHOk

The instinct is to start with something impressive — "refactor the auth module," "optimize the query layer." Resist that. The first task is not about output. It is about building a read-the-diff habit before you have a diff you care about.

**Choosing the right first task**

The task should be bounded, reversible, and not touching anything that ships today. Good candidates: rename a function across a small set of files, fix a repeated typo in a configuration file, add a missing return type annotation to one module. Bad candidates: anything touching auth, payments, database migrations, or a file with no tests.

A useful constraint: the full diff should be readable in under two minutes. If the task would take you longer than that to review, it is too large for your first run.

**Starting the session**

Navigate to your project root and open Claude:

```bash
cd ~/projects/my-app
claude
```

Then give Claude the task in a single, specific sentence:

```
> Rename the function `getUser` to `fetchUser` everywhere in src/. Do not touch test files.
```

Claude will read the relevant files, propose a list of changes, and begin executing them one file at a time. You will see each tool call — `read_file`, `write_file`, `bash` — printed as it runs.

**Watching it run without interrupting**

Let Claude complete the full task before you read anything. Interrupting mid-run leaves the codebase in a partially edited state that is harder to evaluate. When Claude finishes, it prints a summary of what changed.

**Reading the diff before you accept**

This is the non-negotiable part of the lesson. Run:

```bash
git diff
```

Read every changed line. Not the summary — the diff. Look at the function call sites. Look at any string literals that contained the old name. Check that test files are untouched if you said not to touch them.

If you see a change you did not ask for, do not accept. Type a message to Claude naming the unexpected change:

```
> You changed a comment in src/utils.ts that I didn't ask about. Revert that line only.
```

Claude will make the surgical correction.

**If you get stuck**

- Claude edits test files even though you said not to: re-brief with a stronger boundary — "only files in src/, no files matching *.test.* or *.spec.*"
- The diff is much larger than expected: type `Escape` to interrupt, run `git checkout .` to reset, and narrow the brief before trying again.
- Claude reads a file and then does nothing: it may be waiting for confirmation. Press Enter or type "continue."

**Deliverable**

A committed change from a real task where you read the entire `git diff` before running `git add`.

## Try these prompts

- Write a one-sentence Claude Code task brief to rename the function `parseUser` to `deserializeUser` across all files in src/, excluding test files.
- What are three good candidates for a first Claude Code task and three bad candidates? Format as two short lists with one-line reasons.
- Write the git command to reset all changes in the working directory after a Claude Code session produced unexpected edits.

Next: [Reading the diff](https://academy.memberpress.ai/courses/code-intro/l3/)
