Claude Code guide in three levels, Beginner to Advanced: hands-on lessons with checked exercises, every volatile fact cited to its source. Independent community guide.
JavaScript agent-skillsagentic-codingai-agentsanthropicanthropic-claudebest-practicesclaudeclaude-aiclaude-codeclaude-code-guideclaude-code-hooksclaude-code-pluginsclaude-code-skillsclaude-code-tutorialclaude-code-workflowsguidelearn-claude-codemcpsubagentstutorial
Rework Beginner lessons around review and recovery (#136)
Wesam Abousaid97d7b34be5e2
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 564aa68..8e13b8d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -22,6 +22,7 @@ Editions 2 and 3: the Intermediate and Advanced paths, with checked exercises. E### Changed+- The Beginner lessons and capstone use code review, plan review, recovery and project instructions as practice tasks. The learning app's questions focus on decisions, and its checks read available evidence directly from files, git and the installed CLI.- The animated Claude mascot is back beside README's title, and the social card shows it in place of the trail blazes. It comes from [shanraisshan/claude-code-best-practice](https://github.com/shanraisshan/claude-code-best-practice) under the MIT License.- Every stamped page is re-verified against Claude Code v2.1.292 (stable), and the social card carries the full tagline, "Learn it in three levels, with cited facts and checked exercises."- The topic pages, [Commands by level](docs/reference/commands.md) and the [Feature map](docs/reference/feature-map.md) link the Intermediate and Advanced lessons and Electives, and "When to use what" on the [Intermediate index](docs/intermediate/README.md#when-to-use-what) links the dynamic workflows lesson.diff --git a/README.md b/README.mdindex e6e88af..696ca29 100644--- a/README.md+++ b/README.md@@ -39,16 +39,16 @@ The help shrinks each time a skill comes back: GUIDED shows every command, HINTE<table><tr><td width="50%" valign="top"><img src="assets/readme/learn-help-guided.png" width="380" alt="At step 1 the app names the window to type in, says why in the lesson page's words, and shows the exact install command." /></td>- <td width="50%" valign="top"><img src="assets/readme/learn-help-challenge.png" width="380" alt="By step 11 the app gives only the goal and the lesson's rule, and reports from git status that nothing in the copy has changed yet." /></td>+ <td width="50%" valign="top"><img src="assets/readme/learn-help-challenge.png" width="380" alt="At step 10 the app gives the goal and reports the onboarding note still changed in git status." /></td></tr><tr>- <td><b>Step 1 of 12, GUIDED:</b> the exact command, and the window to type it in.</td>- <td><b>Step 11 of 12, CHALLENGE:</b> the goal alone, while the app watches your copy.</td>+ <td><b>Step 1 of 11, GUIDED:</b> the exact command, and the window to type it in.</td>+ <td><b>Step 10 of 11, CHALLENGE:</b> the goal and Git status, while the app watches your copy.</td></tr></table>-<!-- Both captured with Claude Code v2.1.292 (stable) on 2026-10-17. -->-<sub>Beginner lesson 1, steps 1 and 11.</sub>+<!-- App renders for the curriculum verified against Claude Code v2.1.292 (stable), 2026-10-20. -->+<sub>Beginner lesson 1, steps 1 and 10.</sub><a id="-choose-your-path"></a>## Pick your leveldiff --git a/assets/readme/learn-help-challenge.png b/assets/readme/learn-help-challenge.pngindex ad1ad4b..1d8b044 100644Binary files a/assets/readme/learn-help-challenge.png and b/assets/readme/learn-help-challenge.png differdiff --git a/assets/readme/learn-help-guided.png b/assets/readme/learn-help-guided.pngindex 04386a1..417483c 100644Binary files a/assets/readme/learn-help-guided.png and b/assets/readme/learn-help-guided.png differdiff --git a/docs/beginner/01-install-and-look-around.md b/docs/beginner/01-install-and-look-around.mdindex d0058a6..80c3095 100644--- a/docs/beginner/01-install-and-look-around.md+++ b/docs/beginner/01-install-and-look-around.md@@ -1,6 +1,6 @@# Install, sign in and look around-<sub>**Beginner** · Lesson 1 of 5 · about 20 minutes · Needs: [Beginner index](README.md) · Verified against Claude Code v2.1.292 (stable) on 2026-10-15</sub>+<sub>**Beginner** · Lesson 1 of 5 · about 20 minutes · Needs: [Beginner index](README.md) · Verified against Claude Code v2.1.292 (stable) on 2026-10-19</sub>## Goal@@ -10,14 +10,7 @@ By the end of this lesson you can install Claude Code, sign in, start it in a re- A terminal and git, plus a Claude subscription (Pro, Max, Team or Enterprise; the free plan doesn't include Claude Code), a Claude Console account, or access through a supported cloud provider ([Quickstart](https://code.claude.com/docs/en/quickstart), [Advanced setup](https://code.claude.com/docs/en/setup)).- Your copy of the practice template, cloned, as the [Beginner index](README.md#practice) describes, and Node.js LTS for its checks. In a Codespace on your copy, Claude Code is already installed: start at step 3.-- To practice in one of your own repositories instead, keep the template copy as well: the check runs from it. In your repository, set up the folder where lessons save snapshots, and tell git to ignore it without a commit ([gitignore](https://git-scm.com/docs/gitignore)):-- ```bash- mkdir -p .practice- echo '.practice/' >> "$(git rev-parse --git-path info/exclude)"- ```-- **Windows:** `New-Item -ItemType Directory -Force .practice` and `Add-Content (git rev-parse --git-path info/exclude) '.practice/'`.+- Every Beginner lesson and the capstone run in your practice copy, because each one works with files that only the copy has, such as this lesson's onboarding notes. Lesson 5 ends by giving one of your own repositories a `CLAUDE.md`, and the [Intermediate level](../intermediate/README.md) practices in your own repository.- Usage: light, meaning a few short prompts in one session. Inside Claude Code, `/usage` shows your session cost and plan usage limits ([Commands](https://code.claude.com/docs/en/commands)).> [!NOTE]@@ -27,13 +20,15 @@ By the end of this lesson you can install Claude Code, sign in, start it in a re## The idea-Claude Code is a program you run in a terminal, inside a project folder. It reads the files there and answers questions about them; in the next lessons it changes them too.+Claude Code is a program you run in a terminal, inside a project folder. It reads the files there, answers questions about them, and can change them and run commands.-Before you trust an answer, know three things about the session:+The first job you give it in a new repository is usually to explain the code. Treat the answer as you would a new colleague's: before you act on it, open the file it names and check.++Before you trust any answer, know three things about the session:- **the version**, because features and defaults change between releases;- **the model**, because models differ in what they can do;-- **the account**, because it decides which features and models you can use.+- **the account**, because it decides the model a session starts on and which features you can use ([Model configuration](https://code.claude.com/docs/en/model-config#default-model-setting), [Authentication](https://code.claude.com/docs/en/authentication)).The header Claude Code shows when it starts gives the version and the model. The `/status` command shows the version, model and account together ([Commands](https://code.claude.com/docs/en/commands)).@@ -55,28 +50,20 @@ The header Claude Code shows when it starts gives the version and the model. The```If your shell says `claude` isn't found or isn't recognized, the install folder isn't on your `PATH` yet: fix it with [Troubleshoot installation](https://code.claude.com/docs/en/troubleshoot-install#command-not-found-claude-after-installation) before you go on.-3. Go to your practice copy and save that output for the check: put the full path to your copy's folder in place of `<your practice copy>`, in quotes if the path has a space. In a Codespace, that is `/workspaces/` followed by your copy's name ([Codespaces deep dive](https://docs.github.com/en/codespaces/about-codespaces/deep-dive), [Codespaces with GitHub CLI](https://docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-with-github-cli)):+3. Go to your practice copy and start a session there: put the full path to your copy's folder in place of `<your practice copy>`, in quotes if the path has a space. In a Codespace, that is `/workspaces/` followed by your copy's name ([Codespaces deep dive](https://docs.github.com/en/codespaces/about-codespaces/deep-dive), [Codespaces with GitHub CLI](https://docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-with-github-cli)):```bashcd <your practice copy>- mkdir -p .practice- claude --version > .practice/version.txt- ```-- **Windows:** `New-Item -ItemType Directory -Force .practice` replaces the `mkdir` line.-4. Start a session in the same folder:-- ```bashclaude```The first time, Claude Code asks you to sign in. At the login prompt in the terminal, choose your account type; with a Claude subscription or Console account, you then finish in your browser. If the browser shows a code instead of sending you back, paste it into the terminal at the `Paste code here if prompted` prompt ([Authentication](https://code.claude.com/docs/en/authentication)). With an API key or a cloud provider, follow the [Quickstart](https://code.claude.com/docs/en/quickstart) instead.- In a repository you haven't trusted yet, Claude Code also shows the workspace trust dialog, which asks whether you trust the folder ([Security](https://code.claude.com/docs/en/security#additional-safeguards)). **No, exit** is highlighted at first, and pressing Enter on it quits Claude Code. You made this copy, so press the Down arrow to choose **Yes, I trust this folder**, then press Enter. Claude Code saves that trust for the whole repository, so it doesn't ask again here ([Configure permissions](https://code.claude.com/docs/en/permissions#project-allow-rules-and-workspace-trust)).+ In a repository you haven't trusted yet, Claude Code then shows the workspace trust dialog ([Security](https://code.claude.com/docs/en/security#additional-safeguards)). Trust a folder only when you know where its code came from: once you trust it, the repository's own `.claude/settings.json` can grant Claude permissions, such as allow rules, and the dialog lists them first ([Configure permissions](https://code.claude.com/docs/en/permissions#project-allow-rules-and-workspace-trust)). For a stranger's fork you just cloned, leave without trusting it and read its `.claude/` folder first. For your own practice copy, read the dialog and choose to trust the folder. Claude Code saves the trust for the whole repository, so it doesn't ask again here.- The header above the prompt then shows the version, the model and the folder.-5. Type `/status`. The **Status** tab lists the version, the model and the account you signed in with (rows such as **Login method** and **Email**). Press `Esc` to close it ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#general-controls)). Your version may be newer than the one at the top of this page: this guide is checked against the `stable` release channel, and Claude Code follows `latest` unless you choose otherwise ([Configure the release channel](https://code.claude.com/docs/en/setup#configure-release-channel)).-6. Ask two questions about the code:+ The header above the prompt shows the version, the model and the folder. The status bar under the prompt usually reads `⏵⏵ auto mode on`: auto mode is the built-in starting mode, where Claude works without asking you about routine actions and a separate classifier model reviews actions before they run and blocks anything that goes beyond your request ([Choose a permission mode](https://code.claude.com/docs/en/permission-modes#eliminate-prompts-with-auto-mode)). Claude Code may also show a one-time notice about it. If it reads `⏸ manual mode on` instead, something chose Manual, for example a setting or your organization, or auto mode isn't available to your session ([Which mode a session starts in](https://code.claude.com/docs/en/permission-modes#which-mode-a-session-starts-in)). This lesson works the same way in either mode. Lesson 2 covers the modes.+4. Type `/status`. The **Status** tab lists the version, the model and the account you signed in with (rows such as **Login method** and **Email**). It is the screen to compare when your session differs from a teammate's, such as a model they can pick and you can't: compare the account rows first. If `ANTHROPIC_API_KEY` is set in your shell, Claude Code uses that key once you approve it, not your subscription, and `/status` marks the credential that isn't in use ([Authentication](https://code.claude.com/docs/en/authentication#authentication-precedence)). Press `Esc` to close it ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#general-controls)). Your version may be newer than the one at the top of this page: this guide is checked against the `stable` release channel, and Claude Code follows `latest` unless you choose otherwise ([Configure the release channel](https://code.claude.com/docs/en/setup#configure-release-channel)).+5. Ask two questions about the code:```textwhat does this project do?@@ -86,32 +73,42 @@ The header Claude Code shows when it starts gives the version and the model. Thewhich file parses linkcheck.json, and how do I run the tests?```- Claude reads files to answer. Your wording will differ, but the answers should name `src/config.js` and `npm test`.-7. End the session with `/exit`.+ Claude reads files to answer, and may run a command, such as the tests, without asking. Your wording will differ, but the answers should name `src/config.js` and `npm test`.+6. Check the answer against the source. Open `src/config.js` in your editor: its first lines say it parses `linkcheck.json` and name the two fields it reads, `files` and `ignore`. In `package.json`, the `test` script is what `npm test` runs. Keep the session open for Your turn.## Your turn-Repeat the example in your practice copy, or in your own repository, with questions of your own:+Your team wants linkcheck in CI, so that a pull request with a broken link fails. A teammate's onboarding notes, `practice/b-1/onboarding.md` in your practice copy, say things about linkcheck that the CI job would depend on, and one of those claims is wrong. Find it before anyone plans the job around it.-1. In that folder, save `claude --version` to `.practice/version.txt`.-2. Start `claude` there. Your own repository shows the trust dialog again, because trust is saved per repository: choose **Yes, I trust this folder** only for code you know.-3. Open `/status` and note the model and the account.-4. Ask two questions of your own about the code, then end the session with `/exit`.+1. In the same session, ask Claude to check the notes:++ ```text+ check each claim in practice/b-1/onboarding.md against the code. For each one, say whether the code agrees, and cite the file and line.+ ```++2. For each claim Claude says the code contradicts, open the file and line it cites and read them yourself. Decide which claim is wrong from the code, not from the notes or from Claude's answer. If Claude also names cases a claim leaves out, that's fine: correct only a claim the code contradicts.+3. Correct that claim in your editor, in one sentence that says what the code does, and leave the other claims as they are. If Claude already edited the note, read its change with `git diff` ([git diff](https://git-scm.com/docs/git-diff)) and keep it only if it matches the code.+4. End the session with `/exit`, then run `git status` ([git status](https://git-scm.com/docs/git-status)): it should list only `practice/b-1/onboarding.md`. Commit it, so lesson 2 starts from a clean tree ([git commit](https://git-scm.com/docs/git-commit)):++ ```bash+ git commit -am "Correct the onboarding notes"+ ```## CheckYou are done when all of these are true:-- [ ] `.practice/version.txt` holds a line such as `X.Y.Z (Claude Code)`. Check it with `cat .practice/version.txt`.-- [ ] Self-check (not tested): you can say which model and which account `/status` showed.+- [ ] `claude --version` prints a Claude Code version, a line such as `X.Y.Z (Claude Code)`.+- [ ] The claim in `practice/b-1/onboarding.md` that the code contradicts is corrected: it now says what the code does.+- [ ] Self-check (not tested): you can say which model and which login method `/status` showed, and it is the account you meant to use.-Run `npm run check -- b-1` in your practice copy. In your own repository, run `npm run check -- b-1 --dir <your repo>` from your practice copy instead. An npm error such as `Could not read package.json` or `Missing script: "check"` means you ran it outside your practice copy: `cd` into the copy and run it again.+Run `npm run check -- b-1` in your practice copy. The check runs `claude --version` itself, in the terminal you run it from. An npm error such as `Could not read package.json` or `Missing script: "check"` means you ran it outside your practice copy: `cd` into the copy and run it again.-If the first item fails, run `claude --version` on its own: when it prints an error, fix it as Worked example step 2 describes; when it prints a version, save it again in the folder the check reads (your practice copy, or the repository you passed to `--dir`).+If the first item fails, run `claude --version` in that terminal: when it prints an error, fix it as Worked example step 2 describes, then open a new terminal and run the check again. If the second item fails, read the check's message: it quotes the claim that is still wrong, or says what the corrected claim lacks. Open the file and line Claude cited for that claim, and write what the code does.## Watch out-- A new session can edit most files and run most commands without asking you first ([Quickstart](https://code.claude.com/docs/en/quickstart)). In this lesson, only ask questions; the next lesson shows how to choose what Claude may do on its own. Even a question can lead Claude to run a command that writes files, such as running the tests to answer you: run `git status` when the session ends, and before lesson 2, commit or remove anything it lists.+- In auto mode, Claude can edit files and run commands without asking you first, and even a question can lead it to run one, such as the tests. "Auto mode reduces permission prompts but does not guarantee safety" ([Choose a permission mode](https://code.claude.com/docs/en/permission-modes#eliminate-prompts-with-auto-mode)). In this lesson, ask only for reading, and if Claude Code asks before an action, read what it wants to do before you answer. Lesson 2 shows how to choose what Claude may do on its own.## Go further@@ -121,6 +118,6 @@ If the first item fails, run `claude --version` on its own: when it prints an er----<sub>Sources: [Quickstart](https://code.claude.com/docs/en/quickstart) · [Advanced setup](https://code.claude.com/docs/en/setup) · [Authentication](https://code.claude.com/docs/en/authentication) · [Security](https://code.claude.com/docs/en/security) · [Configure permissions](https://code.claude.com/docs/en/permissions) · [Commands](https://code.claude.com/docs/en/commands) · [Interactive mode](https://code.claude.com/docs/en/interactive-mode) · [Troubleshoot installation](https://code.claude.com/docs/en/troubleshoot-install) · [gitignore](https://git-scm.com/docs/gitignore) · [Codespaces deep dive](https://docs.github.com/en/codespaces/about-codespaces/deep-dive) · [Codespaces with GitHub CLI](https://docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-with-github-cli)</sub>+<sub>Sources: [Quickstart](https://code.claude.com/docs/en/quickstart) · [Advanced setup](https://code.claude.com/docs/en/setup) · [Authentication](https://code.claude.com/docs/en/authentication) · [Model configuration](https://code.claude.com/docs/en/model-config) · [Security](https://code.claude.com/docs/en/security) · [Configure permissions](https://code.claude.com/docs/en/permissions) · [Choose a permission mode](https://code.claude.com/docs/en/permission-modes) · [Commands](https://code.claude.com/docs/en/commands) · [Interactive mode](https://code.claude.com/docs/en/interactive-mode) · [Troubleshoot installation](https://code.claude.com/docs/en/troubleshoot-install) · [Codespaces deep dive](https://docs.github.com/en/codespaces/about-codespaces/deep-dive) · [Codespaces with GitHub CLI](https://docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-with-github-cli) · [git diff](https://git-scm.com/docs/git-diff) · [git status](https://git-scm.com/docs/git-status) · [git commit](https://git-scm.com/docs/git-commit)</sub><sub>← [Beginner index](README.md) · [Permission modes and plan mode](02-permission-modes-and-plan-mode.md) → · Topic: [Models, effort and cost](../topics/models-effort-and-cost.md) · [Stuck on this lesson?](https://github.com/wesammustafa/Claude-Code-Everything-You-Need-to-Know/issues/new?template=lesson-feedback.yml&lesson=b-1)</sub>diff --git a/docs/beginner/02-permission-modes-and-plan-mode.md b/docs/beginner/02-permission-modes-and-plan-mode.mdindex d668d41..7bdc320 100644--- a/docs/beginner/02-permission-modes-and-plan-mode.md+++ b/docs/beginner/02-permission-modes-and-plan-mode.md@@ -1,6 +1,6 @@# Choose who approves what: permission modes and plan mode-<sub>**Beginner** · Lesson 2 of 5 · about 20 minutes · Needs: [Install, sign in and look around](01-install-and-look-around.md) · Verified against Claude Code v2.1.292 (stable) on 2026-10-15</sub>+<sub>**Beginner** · Lesson 2 of 5 · about 25 minutes · Needs: [Install, sign in and look around](01-install-and-look-around.md) · Verified against Claude Code v2.1.292 (stable) on 2026-10-19</sub>## Goal@@ -8,7 +8,7 @@ By the end of this lesson you can pick a permission mode for a task, switch mode## You need-- Your copy of the practice template, cloned, with no uncommitted changes, and Node.js LTS for its checks (a Codespace on your copy has both). To practice in one of your own repositories instead, commit or stash your work there first so it has no uncommitted changes either, and keep the template copy as well: the check runs from it. Set up the repository's `.practice/` folder as [lesson 1](01-install-and-look-around.md#you-need) describes, if you haven't yet.+- Your copy of the practice template, cloned, with no uncommitted changes, and Node.js LTS for its checks (a Codespace on your copy has both). This lesson runs in the practice copy: Your turn works a ticket that comes with it.- Usage: light.> [!NOTE]@@ -16,97 +16,110 @@ By the end of this lesson you can pick a permission mode for a task, switch mode## The idea-A [permission mode](https://code.claude.com/docs/en/permission-modes) decides which actions Claude can take without asking you first. You switch modes with `Shift+Tab`, and the status bar under the prompt always shows the one in force.+A [permission mode](https://code.claude.com/docs/en/permission-modes) decides which actions Claude takes without asking you first. A new session starts in auto mode, where a second model, the classifier, reviews actions instead of you and blocks anything that escalates beyond your request. Ordinary source-file edits in your working directory don't reach the classifier: auto mode approves them ([How the classifier evaluates actions](https://code.claude.com/docs/en/permission-modes#how-the-classifier-evaluates-actions)). Whether an edit belongs in the change is yours to judge. `Shift+Tab` switches modes, and the status bar under the prompt shows the one in force:-Four modes matter now:+- **Auto**, `⏵⏵ auto mode on`: no routine prompts. For most work, where you trust the general direction.+- **Plan**, `⏸ plan mode on`: Claude explores and writes a plan, and can't edit your files until you approve it. For a change you want to agree on first.+- **Manual**, `⏸ manual mode on`: Claude asks before edits and most commands. For sensitive work, or whenever approving each step is the point.+- **Accept edits**, `⏵⏵ accept edits on`: file edits and common file commands, such as `mkdir` and `mv`, run without asking. For code you will review with `git diff` ([git diff](https://git-scm.com/docs/git-diff)) afterwards.-| Status bar shows | Mode | Claude does this without asking |-|---|---|---|-| `⏸ manual mode on` | Manual | Reads only |-| `⏵⏵ accept edits on` | Accept edits | Reads, edits files, runs common file commands |-| `⏸ plan mode on` | Plan | Reads, plus commands a background safety check approves when auto mode is available, then writes a plan. It can't edit your files until you approve the plan |-| `⏵⏵ auto mode on` | Auto | Everything, with background safety checks |--Manual suits sensitive work and unfamiliar code, where you want to review every action yourself. Auto suits long tasks, where it saves you from approving every step.--Plan mode is the habit to build first: you see the whole change as a plan before Claude edits any of your files.+The habit to build: plan first, and approve only a plan you would merge.## Worked example-1. Start `claude` in your practice copy and look at the status bar. A new session usually starts in auto mode.-2. Press `Shift+Tab` until the status bar reads `⏸ plan mode on`. From auto, the first press gives Manual, then Accept edits, then Plan.+1. Start `claude` in your practice copy. The status bar reads `⏵⏵ auto mode on`, unless a setting or your organization starts your sessions in another mode, or auto mode isn't available to you ([Which mode a session starts in](https://code.claude.com/docs/en/permission-modes#which-mode-a-session-starts-in)).+2. Press `Shift+Tab` until the status bar reads `⏸ plan mode on`. Each press moves to the next mode, and the status bar names it.3. Ask for the change:```textMake parseConfig in src/config.js reject an empty file with a clear error message, and add a test for it.```-4. Claude reads files and may run commands to explore, but doesn't edit your files. If it needs a decision from you first, it asks a [multiple-choice question](https://code.claude.com/docs/en/tools-reference#askuserquestion-tool-behavior): pick an option or type your own answer, and it keeps planning. Then it shows a plan and asks how to proceed, with three choices:+4. Claude reads files and may run commands to explore, but doesn't edit your files. If it needs a decision from you first, it asks a [multiple-choice question](https://code.claude.com/docs/en/tools-reference#askuserquestion-tool-behavior): pick an option or type your own answer, and it keeps planning. Then it shows a plan and asks how to proceed, with these choices:- **Yes, and use auto mode** (it reads **Yes, auto-accept edits** if auto mode isn't available to you)- **Yes, manually approve edits**- - A text field that reads **Tell Claude what to change** (the [docs](https://code.claude.com/docs/en/permission-modes#review-and-approve-a-plan) call this choice **No, keep planning**)+ - A choice to keep planning and revise the plan (the [docs](https://code.claude.com/docs/en/permission-modes#review-and-approve-a-plan) call this choice **No, keep planning**)- The first choice is highlighted when the menu opens. Until you choose, the session stays in plan mode.-5. Send the plan back once, even if it already looks right, so you practice it. Use `Down arrow` to move the highlight to **Tell Claude what to change**, type this correction on that line, and press `Enter`:+ Check which choice is highlighted before you press `Enter`: **Yes, and use auto mode** approves the plan and switches to auto mode. Until you approve, the session stays in plan mode.+5. Read the plan the way you would read a teammate's: which files change, and what each change does. Say you want the error to name the file, so whoever sees it knows what to fix. The plan is the cheapest place to change your mind, because nothing is edited yet. Use the plan menu to send this revision, then press `Enter`:```text- Keep the change to src/config.js and test/config.test.js. Don't add new files.+ Make the error say "linkcheck.json is empty", and keep the change to src/config.js and test/config.test.js.```- Send it with `Enter`, not `Shift+Tab`: on this menu, `Shift+Tab` approves the plan ([CHANGELOG](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md)). Claude revises the plan and shows the menu again. If you press `Enter` before typing, Claude Code shows `User rejected Claude's plan:` and the session stays in plan mode, waiting for you: type the correction at the prompt instead.-6. When the revised plan looks right, leave it on screen and open another terminal in the same folder. Save what git sees, and the files the plan says it will change, one path per line, written the way `git status` shows them (relative to the repository root, with forward slashes):+ Send it with `Enter`, not `Shift+Tab`: on this menu, `Shift+Tab` approves the plan ([CHANGELOG](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md)). Claude revises the plan and shows the menu again. Your change can be below the top of the plan, so scroll to find it.+6. Leave the revised plan on screen, open another terminal in the same folder and run `git status` ([git status](https://git-scm.com/docs/git-status)). It says `nothing to commit, working tree clean`: plan mode hasn't changed a file.+7. Back in Claude Code, use `Down arrow` to move the highlight to **Yes, manually approve edits** and press `Enter`. Here approving each step is the point: you watch the plan land. After a plan you trust, **Yes, and use auto mode** is the everyday choice. The session switches to Manual mode, so Claude asks before each edit and before most shell commands, such as running the tests. Read each request:+ - An edit or a command the plan needs: **Yes**.+ - The test command, `npm test`: **Yes**, or **Yes, and don't ask again** if you would rather not be asked about it again. That saves a rule for this repository in `.claude/settings.local.json` ([Configure permissions](https://code.claude.com/docs/en/permissions#permission-system)), so keep it for commands whose effects you know.+ - A command that does more than the plan needs, such as `npm test && git add -A` ([git add](https://git-scm.com/docs/git-add)): **No**. To say what to do instead, move the highlight to **No**, press `Tab`, type it and press `Enter` ([Add a comment](https://code.claude.com/docs/en/permissions#add-a-comment-when-you-answer-a-permission-prompt)).++ A Bash command's request can also offer **Yes, and switch to auto mode** ([Switch permission modes](https://code.claude.com/docs/en/permission-modes#switch-permission-modes)). Skip it here: it approves the command and ends the step-by-step review.++ Answer with the arrow keys and `Enter`, not `Shift+Tab`: on an edit request, `Shift+Tab` picks the choice that allows edits for the rest of the session, where the request offers one ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#general-controls)).+8. When Claude is done, run `git status` in the other terminal again. It lists `src/config.js` and `test/config.test.js`, the two files the plan named. If it lists another file, look in the session for the edit or command that wrote it.+9. Set the example's change aside so Your turn starts clean ([git stash](https://git-scm.com/docs/git-stash)):```bash- git status --porcelain > .practice/b-2-before.txt- printf '%s\n' src/config.js test/config.test.js > .practice/b-2-plan.txt+ git stash push --include-untracked -m b-2-example```- **Windows:** `'src/config.js','test/config.test.js' | Set-Content .practice/b-2-plan.txt` replaces the `printf` line.-7. Back in Claude Code, use `Down arrow` to move the highlight to **Yes, manually approve edits** and press `Enter`. Pressing `Enter` on the highlighted first choice would let Claude edit without asking you. The session leaves plan mode for Manual mode, so Claude asks before each edit and before most shell commands, such as running the tests.+## Your turn- Read each request and answer with plain **Yes**: the other Yes choices stop Claude asking again for that kind of action, or switch the session to Accept edits or auto mode ([Configure permissions](https://code.claude.com/docs/en/permissions#permission-system)). If a command does more than the plan needs, choose **No** and tell Claude what to do instead. When Claude is done, save what git sees now, in the other terminal:+A teammate filed `practice/b-2/ticket.md` in your practice copy. Work it in plan mode, and approve only what this change should ship.- ```bash- git status --porcelain > .practice/b-2-after.txt+1. Read the ticket yourself first.+2. Start a fresh conversation for the new task: type `/exit`, then start `claude` again. To enter plan mode and start the task in one step, type `/plan` before it ([Commands](https://code.claude.com/docs/en/commands)):++ ```text+ /plan Work the ticket in practice/b-2/ticket.md```-8. Set the example's change aside so Your turn starts clean. Git ignores `.practice/`, so your snapshots stay:+ Check that the status bar reads `⏸ plan mode on`, and answer any question Claude asks.+3. Read the plan as its reviewer. For each change, ask whether you would merge it as part of this ticket. Use the plan menu to send back anything you wouldn't merge, in your own words, with your reason, until the plan is one you would approve.+4. While the final plan is on screen, save what git sees, and the files the plan says it will change, in the other terminal. Write each path the way `git status` shows it: relative to the repository root, with forward slashes, one per line. For a plan that changed `src/links.js` and `test/links.test.js`, it would be:```bash- git stash push --include-untracked -m b-2-example+ mkdir -p .practice+ git status --porcelain > .practice/b-2-before.txt+ printf '%s\n' src/links.js test/links.test.js > .practice/b-2-plan.txt```-## Your turn--Repeat the example in your practice copy, or your own repository, with a small change of your own:+ **Windows:** `New-Item -ItemType Directory -Force .practice` replaces the `mkdir` line, and `'src/links.js','test/links.test.js' | Set-Content .practice/b-2-plan.txt` replaces the `printf` line.+5. Approve with **Yes, manually approve edits**, and read each request as in step 7 of the example.+6. When Claude is done, save what git sees now:-1. Switch to plan mode with `Shift+Tab` until the status bar reads `⏸ plan mode on`.-2. Ask for the change, and answer any question Claude asks.-3. Send the plan back once: type one correction in **Tell Claude what to change** and press `Enter`.-4. While the final plan is on screen, run step 6's commands in another terminal, with your plan's file list.-5. Approve with **Yes, manually approve edits**, read and approve each edit and command as in step 7, then save `git status --porcelain > .practice/b-2-after.txt`.+ ```bash+ git status --porcelain > .practice/b-2-after.txt+ ```-Stop before committing. The next lesson starts from a clean tree and takes a new change to a commit.+Stop before committing. The next lesson sets this change aside with `git stash push --include-untracked -m b-2` and starts from a clean tree; this lesson's check still finds the change in that stash.## CheckYou are done when all of these are true:-- [ ] `.practice/b-2-before.txt`, saved while the plan was on screen, lists no files. `cat .practice/b-2-before.txt` prints nothing.-- [ ] Every path in `.practice/b-2-after.txt` appears in `.practice/b-2-plan.txt`.-- [ ] Self-check (not tested): say, in one sentence, when you would pick Manual instead of Auto.+- [ ] `.practice/b-2-before.txt`, saved while the plan was on screen, lists no changed files+- [ ] Every file in `.practice/b-2-after.txt` is listed in `.practice/b-2-plan.txt`+- [ ] An unknown key in `linkcheck.json`, such as `ignores`, makes the tool exit with code 2 and name the key+- [ ] A broken link still makes the tool exit with code 1 and report the link++In the other terminal, run `npm run check -- b-2` in your practice copy.++If `.practice/b-2-before.txt` lists files, either the tree wasn't clean when Your turn started (the example's files there mean step 9 was skipped), or Claude wrote a file before you approved: check that the status bar read `⏸ plan mode on`, and look in the session for a command Claude ran that wrote a file. Set the changes aside with `git stash push --include-untracked`, then repeat Your turn from step 2. If a file in `.practice/b-2-after.txt` is missing from `.practice/b-2-plan.txt`, check that the plan file writes it the way `git status` does, then compare the plan you approved with what Claude changed. If the unknown-key item fails, compare what Claude changed with the ticket's first request, and tell Claude what is missing. If a broken link no longer fails the tool, the plan you approved carried the ticket's last request. A build that passes with broken links hides the problem the tool exists to find, and the teammate's real trouble was the typo: once linkcheck catches it, `"ignore": ["vendor/"]` skips the links into `vendor/`. Ask Claude to undo that part, then save `.practice/b-2-after.txt` again. A flag or a config key that turns the failure off goes back too, though the check can't see one, because CI would only need to add it.-In the other terminal, run `npm run check -- b-2` in your practice copy. In your own repository, run `npm run check -- b-2 --dir <your repo>` from your practice copy instead.+## Watch out-If `.practice/b-2-before.txt` lists files, either the tree wasn't clean when Your turn started (the worked example's files there mean step 8 was skipped; in your own repository, they are your uncommitted work), or Claude wrote a file before you approved: check that the status bar read `⏸ plan mode on` when you sent the prompt, and look in the session for a command Claude ran that wrote a file. Either way, set the changes aside with `git stash push --include-untracked` (or commit your own work), then repeat Your turn from step 1 so the snapshots are saved again. If a changed path is missing from `.practice/b-2-plan.txt`, check that the plan file writes it the way `git status` does, then compare the plan you approved with what Claude changed.+- A limit you state in the conversation, such as "don't push", makes auto mode's classifier block matching actions, but it can be lost when the conversation is compacted ([Boundaries you state in conversation](https://code.claude.com/docs/en/permission-modes#boundaries-you-state-in-conversation)).## Go further-- Type `/plan <your task>` to enter plan mode and start the task in one step ([Commands](https://code.claude.com/docs/en/commands)).-- [Analyze before you edit with plan mode](https://code.claude.com/docs/en/permission-modes#analyze-before-you-edit-with-plan-mode): planning in more depth, including editing a plan before you approve it.+- While a plan is on screen, press `Ctrl+G` to open it in your default text editor and edit it before Claude proceeds ([Review and approve a plan](https://code.claude.com/docs/en/permission-modes#review-and-approve-a-plan)).+- When auto mode blocks an action, `/permissions` lists it under **Recently denied**, where you can press `r` to retry it with your approval ([When auto mode falls back](https://code.claude.com/docs/en/permission-modes#when-auto-mode-falls-back)).+- [Analyze before you edit with plan mode](https://code.claude.com/docs/en/permission-modes#analyze-before-you-edit-with-plan-mode): what plan mode lets Claude run while it plans.----<sub>Sources: [Choose a permission mode](https://code.claude.com/docs/en/permission-modes) · [Interactive mode](https://code.claude.com/docs/en/interactive-mode) · [Commands](https://code.claude.com/docs/en/commands) · [Tools reference](https://code.claude.com/docs/en/tools-reference) · [Configure permissions](https://code.claude.com/docs/en/permissions) · [Claude Code CHANGELOG](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md)</sub>+<sub>Sources: [Choose a permission mode](https://code.claude.com/docs/en/permission-modes) · [Interactive mode](https://code.claude.com/docs/en/interactive-mode) · [Commands](https://code.claude.com/docs/en/commands) · [Tools reference](https://code.claude.com/docs/en/tools-reference) · [Configure permissions](https://code.claude.com/docs/en/permissions) · [Claude Code CHANGELOG](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md) · [git diff](https://git-scm.com/docs/git-diff) · [git status](https://git-scm.com/docs/git-status) · [git add](https://git-scm.com/docs/git-add) · [git stash](https://git-scm.com/docs/git-stash)</sub><sub>← [Install, sign in and look around](01-install-and-look-around.md) · [Beginner index](README.md) · [Your first change, from request to commit](03-first-change.md) → · Topic: [Permissions and safety](../topics/permissions-and-safety.md) · [Stuck on this lesson?](https://github.com/wesammustafa/Claude-Code-Everything-You-Need-to-Know/issues/new?template=lesson-feedback.yml&lesson=b-2)</sub>diff --git a/docs/beginner/03-first-change.md b/docs/beginner/03-first-change.mdindex d8026b1..c20cf75 100644--- a/docs/beginner/03-first-change.md+++ b/docs/beginner/03-first-change.md@@ -1,35 +1,36 @@# Your first change, from request to commit-<sub>**Beginner** · Lesson 3 of 5 · about 20 minutes · Needs: [Permission modes and plan mode](02-permission-modes-and-plan-mode.md) · Verified against Claude Code v2.1.292 (stable) on 2026-10-15</sub>+<sub>**Beginner** · Lesson 3 of 5 · about 20 minutes · Needs: [Permission modes and plan mode](02-permission-modes-and-plan-mode.md) · Verified against Claude Code v2.1.292 (stable) on 2026-10-19</sub>## Goal-By the end of this lesson you can take one change from request to commit: explore, plan, implement, test, review the diff, correct, and commit.+By the end of this lesson you can take a change from request to commit, and review a change well enough to catch what it gets wrong before it is committed.## You need-- Your copy of the practice template, and Node.js LTS (a Codespace on your copy has it).-- To practice in one of your own repositories instead, keep the template copy as well: the check runs from it. Set up the repository's `.practice/` folder as [lesson 1](01-install-and-look-around.md#you-need) describes, if you haven't yet.-- No uncommitted changes where you practice. If lesson 2's change is still there, set it aside with `git stash push --include-untracked -m b-2`; in your own repository, commit it instead if you want to keep it. Later lessons don't use what you set aside, and `git stash list` shows it.+- Your copy of the practice template, and Node.js LTS (a Codespace on your copy has it). Practice in the template copy, not in your own repository: Your turn reviews a patch planted there.+- No uncommitted changes. If lesson 2's change is still there, set it aside with `git stash push --include-untracked -m b-2` ([git stash](https://git-scm.com/docs/git-stash)). Later lessons don't use it, and `git stash list` shows it.+- A second terminal open in the same folder, for git.- Usage: light.## The idea-Asking for a change and accepting whatever comes back is how sessions go wrong. Anthropic's [best practices](https://code.claude.com/docs/en/best-practices#explore-first-then-plan-then-code) recommend four phases: explore, plan, implement and commit. This lesson adds a check at each step:+Asking for a change and accepting whatever comes back is how sessions go wrong. Anthropic's [best practices](https://code.claude.com/docs/en/best-practices#explore-first-then-plan-then-code) recommend four phases: explore, plan, implement and commit.-1. **Explore** in plan mode: Claude reads and answers, and changes nothing.-2. **Plan**, and approve it only when it matches what you want.-3. **Implement**, approving edits as they come.-4. **Test**: the tests are what tell you the change works, not the summary Claude writes.-5. **Review the diff** line by line.-6. **Correct** anything you don't want, in plain words.-7. **Commit**, so the change is saved and easy to undo.+A new session usually starts in auto mode, and as [lesson 2](02-permission-modes-and-plan-mode.md#the-idea) showed, auto mode approves ordinary source-file edits in your project without the classifier seeing them ([How the classifier evaluates actions](https://code.claude.com/docs/en/permission-modes#how-the-classifier-evaluates-actions)). For these source edits, no second model reviews Claude's changes: you do. Whether the change is right is yours to judge, in two places: the plan, before Claude starts, and the diff, before anything is committed.++1. **Explore** in plan mode: Claude reads, and doesn't edit your files.+2. **Plan**, and approve it only when it changes the files you expect.+3. **Implement** in auto mode, and keep working while Claude does.+4. **Test**: read the real output, not Claude's summary.+5. **Review the diff**, the tests included, and **correct** what you find.+6. **Commit**, so the change is saved and easy to undo.## Worked exampleThe practice app checks Markdown links, but it skips any link with a title, such as `[setup](setup.md "Setup guide")`. You'll fix that.-1. Start `claude` in your practice copy and press `Shift+Tab` until the status bar reads `⏸ plan mode on`. Explore:+1. Start `claude` in your practice copy. The status bar usually reads `⏵⏵ auto mode on`. Press `Shift+Tab` until it reads `⏸ plan mode on`: from auto, the presses go to Manual, Accept edits, then Plan ([Choose a permission mode](https://code.claude.com/docs/en/permission-modes#switch-permission-modes)). Explore:```textHow does this app find links in a Markdown file? Which kinds of links would it miss?@@ -39,78 +40,82 @@ The practice app checks Markdown links, but it skips any link with a title, such2. Plan:```text- Plan a change so links with a title, like [setup](setup.md "Setup guide"), are checked too. Add a test for it to test/links.test.js.+ Plan a change so links with a title, in double or single quotes, are checked too, like [setup](setup.md "Setup guide") and [faq](faq.md 'FAQ'). Add a test for each to test/links.test.js.```- Read the plan. When it names only `src/links.js` and `test/links.test.js`, choose **Yes, manually approve edits**. If it names other files too, send it back as in [lesson 2](02-permission-modes-and-plan-mode.md#worked-example): in **Tell Claude what to change**, ask Claude to keep the change to those two files.-3. Implement and test. Approve each edit. Claude also asks before most commands, such as running the tests: read each one. Answer plain **Yes** when it does what the plan needs, as in lesson 2. Answer **No** and say what to do instead when it does more, such as a command that stashes, overwrites or moves files. Don't choose **Yes, and switch to auto mode**: background safety checks would then review the rest of this lesson's steps instead of you ([Choose a permission mode](https://code.claude.com/docs/en/permission-modes#switch-permission-modes)). Then ask, even if Claude already ran the tests, so you see the result yourself:+ Read the plan before you choose. It should change only `src/links.js` and `test/links.test.js`; a file it reads or names as needing no change is fine. If it also changes another file, such as `src/cli.js`, or adds one, send it back as in [lesson 2](02-permission-modes-and-plan-mode.md#worked-example): use the plan menu to ask Claude to keep the change to those two files.++ When the plan is right, choose **Yes, and use auto mode** (it reads **Yes, auto-accept edits** if auto mode isn't available to you). Claude edits and runs the tests without asking. If Claude Code does ask about an action, read it before you answer.+3. While Claude works, or once it's done, ask a side question:++ ```text+ /btw in one sentence, why does the current pattern skip a link with a title?+ ```++ Claude answers in an overlay, from what the session has already read, without tools and without interrupting the work. The question and answer never enter the conversation, so they don't steer Claude. Press `Space`, `Enter` or `Esc` to close it ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#side-questions-with-%2Fbtw)). To change what Claude does, send a normal message instead.+4. Read the test output yourself. When Claude is done, ask, even if it already ran the tests:```textrun the tests```- Claude Code collapses long command output to a short summary. Press `Ctrl+O` to expand it ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#general-controls)), find the test summary near the end, and press `Esc` to go back. It should report `fail 0`.-4. Review the diff. Type `/diff` to see the changes Claude made, beside anything else you haven't committed ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#review-changes-with-%2Fdiff)). One of two views opens:- - A panel beside the conversation. Its list leaves test files out until you click the line that counts them, so click it. That line counts test and generated files together, for example `1 test/generated (show)`. The panel can also open on its own once Claude edits files: if it's already open, read it there, because typing `/diff` closes it.- - A list above the prompt. Select a file with the arrow keys, press `Enter` to read its diff, and press `Esc` to go back.+ Claude Code collapses long command output to a short summary. Press `Ctrl+O` to open the transcript viewer, find the test summary near the end, and press `Ctrl+O` again to go back ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#general-controls)). It should report `fail 0`.++ This lesson's tests finish quickly. On a real project the tests, a build or a dev server can run for minutes: ask Claude to run the command in the background, or press `Ctrl+B` while it runs (in tmux, press it twice), and Claude can answer you while it runs. `/tasks` lists background work and stops a task you no longer need ([Background Bash commands](https://code.claude.com/docs/en/interactive-mode#background-bash-commands), [Tools reference](https://code.claude.com/docs/en/tools-reference#background-commands)).+5. Review the diff. Type `/diff` to see the changes in your working tree, Claude's edits included ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#review-changes-with-%2Fdiff)). One of two views opens:+ - A panel beside the conversation. Its list leaves test files and generated files out and counts them on a line of their own: click that line to see the test. The panel may already be open: read it there, because typing `/diff` closes it.+ - A dialog above the prompt. Select a file with the arrow keys, press `Enter` to read its diff, and press `Esc` to go back.- Read each line, the test included. In a second terminal, `git diff` prints the uncommitted changes to files git already tracks. For a new file Claude created, run `git add -N <file>` first so it shows up ([git add](https://git-scm.com/docs/git-add#Documentation/git-add.txt--N)). If the diff fills the screen and stops at a `:` prompt, git is showing it in a pager, usually `less`: press `q` to leave it ([git config](https://git-scm.com/docs/git-config#Documentation/git-config.txt-corepager), [less FAQ](https://www.greenwoodsoftware.com/less/faq.html#dashe)).-5. Correct. Read the new test. If it covers only double-quoted titles, ask:+ Read each line, the test included, and ask: does the test cover both kinds of quotes, and does the code leave the title out of the target? To read the diff in the second terminal instead, run `git diff` ([git diff](https://git-scm.com/docs/git-diff)). It leaves out a file git doesn't track yet until you run `git add -N <file>` ([git add](https://git-scm.com/docs/git-add#Documentation/git-add.txt--N)). If it stops at a `:` prompt, git is showing it in a pager, usually `less`: press `q` to leave it ([git config](https://git-scm.com/docs/git-config#Documentation/git-config.txt-corepager), [less FAQ](https://www.greenwoodsoftware.com/less/faq.html#dashe)).+6. Correct what the review found, in plain words. For example, if the test covers only double quotes:```textThe test covers only double-quoted titles. Add a case for a single-quoted title, like [faq](faq.md 'FAQ'), and run the tests again.```- If it already covers single quotes, ask for another small change you would want instead, such as giving each kind of title its own test. Then check the diff again.-6. Commit:+ Then read the diff again. If the review found nothing to correct, go on: Your turn has something to find.+7. Commit:```textcommit this with a message that says what changed```- Claude asks before it runs the commit. Read the whole command, then choose **Yes**. If it also creates a branch, that's fine: the check works on any branch. To keep the commit on your current branch, say so in your prompt. Then, in the second terminal, save the commit for the check and confirm nothing is left over:-- ```bash- git rev-parse HEAD > .practice/b-3-commit.txt- git status- ```-- `git status` ends with `nothing to commit, working tree clean`.+ If Claude puts the commit on a new branch, that's fine: the check works on any branch. To keep it on your current branch, say so in your prompt. In the second terminal, `git status` ([git status](https://git-scm.com/docs/git-status)) ends with `nothing to commit, working tree clean`.## Your turn-Repeat the example with a second gap: links whose target sits in angle brackets, such as `[my notes](<my notes.md>)`.+A teammate sent a patch, `practice/b-3/protocol-relative.patch`. Its description says what it changes, and its test passes. Decide whether it does only what it says, and fix it before it goes into a commit.-1. Explore in plan mode: ask how the app reads a link's target.-2. Plan the change, with a test in `test/links.test.js`. Send the plan back if it names other files, then approve it with **Yes, manually approve edits**.-3. Approve the edits and any test commands with **Yes**, then ask Claude to run the tests.-4. Review the whole diff with `/diff`, the test file included.-5. Ask for one correction, even a small one, and check the diff again.-6. Once the correction is in, ask Claude to commit the change, its test and your correction together. Then, in the second terminal, run `git rev-parse HEAD > .practice/b-3-commit.txt`.--In your own repository, pick a small change of your own that comes with a test.+1. Read the patch, its description first. In the second terminal, run `cat practice/b-3/protocol-relative.patch` (**Windows:** `Get-Content practice/b-3/protocol-relative.patch`), or open it in your editor. For each kind of link the checker handles, ask: does the new line skip it, and does the description say it should? The description's last sentence is a claim you can test.+2. Apply it, so its change is in your working tree: `git apply practice/b-3/protocol-relative.patch`. This changes the files and makes no commit ([git apply](https://git-scm.com/docs/git-apply)). `git status` lists `src/links.js` as modified and `test/external.test.js` under `Untracked files`. Run `git add -N test/external.test.js`, so `git diff` shows the new file too. `npm test` passes: passing tests don't make the patch right.+3. Tell Claude what the patch gets wrong, in your own words, and ask for a fix and a test that would fail on the patch's version.+4. Review the result as in the [Worked example](#worked-example)'s steps 4 and 5: read the test output yourself, then the whole diff, the tests included. In `/diff`, read the `Current` view: a turn view shows only Claude's own edits, so it leaves out the patch's lines ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#review-changes-with-%2Fdiff)).+5. Ask Claude to commit the fix, its test and the patch's test together. `git status` ends with `nothing to commit, working tree clean`.## CheckYou are done when all of these are true:-- [ ] The commit named in `.practice/b-3-commit.txt` changes a test file and at least one other file: `git show --stat $(cat .practice/b-3-commit.txt)`. **Windows:** `git show --stat (Get-Content .practice/b-3-commit.txt)`.+- [ ] Links with a title, in double or single quotes, are checked.+- [ ] Protocol-relative links, such as `//cdn.example.com/app.js`, are skipped, and every other link is checked as before.+- [ ] Your tests catch the planted flaw: with the patch's `isExternal` put back, they fail.+- [ ] Your last commit changes a test file and at least one other file: `git show --stat HEAD` ([git show](https://git-scm.com/docs/git-show)).- [ ] The tests pass: `npm test` reports `fail 0`.- [ ] Nothing is left uncommitted: `git status --porcelain` prints nothing.-- [ ] Self-check (not tested): you read the whole diff before committing and asked Claude for at least one correction.+- [ ] Self-check (not tested): you found the patch's flaw by reading it, and you read each diff, the tests included, before it was committed.-In the second terminal, run `npm run check -- b-3` in your practice copy. In your own repository, run `npm run check -- b-3 --dir <your repo>` from your practice copy instead. If that repository has no `npm test` script, first save your test command's exit code with `<your test command>; echo $? > .practice/b-3-tests.txt` (**Windows:** `<your test command>; $LASTEXITCODE > .practice/b-3-tests.txt`).+In the second terminal, run `npm run check -- b-3` in your practice copy. The check writes a few Markdown files to a temporary folder and runs the app on them, and runs your tests once more with the patch's version of `isExternal`.-If the commit changes no test file, or only tests, the code and its test didn't land in one commit: ask Claude to amend the commit with the missing test (`git commit --amend`), or to combine the last two commits into one, as long as you haven't pushed them. Then save the commit again with `git rev-parse HEAD > .practice/b-3-commit.txt`. If the tests fail, read the first failure and ask Claude to fix the code, not the test. If `git status --porcelain` lists files, commit them or set them aside with `git stash push --include-untracked`.+If titled links are still skipped, or reported with the title in the target, the worked example isn't finished: ask Claude to leave the title out of the target, with a test for each kind of quotes. If the check says a link is still skipped, the patch's flaw is still there: compare its description with what its new line skips. If `//cdn.example.com/app.js` is reported as broken, the patch isn't applied: run the `git apply` in Your turn, step 2. If your tests still pass with the patch's version, none of them covers what the patch broke: ask Claude for one that fails on it. Once you commit, the check names the link the patch gets wrong. If your last commit has no test file, or only tests, ask Claude to amend it (`git commit --amend` ([git commit](https://git-scm.com/docs/git-commit))), or to combine it with the commit before, as long as you haven't pushed them. If the tests fail, read the first failure and ask Claude to fix the code, not the test. If `git status --porcelain` lists files, commit them or set them aside with `git stash push --include-untracked`.## Go further- [Common workflows](https://code.claude.com/docs/en/common-workflows): step-by-step guides for fixing bugs, refactoring and testing.-- [Prompt library](https://code.claude.com/docs/en/prompt-library): copy-ready prompts, tagged by task.- [Give Claude a way to verify its work](https://code.claude.com/docs/en/best-practices#give-claude-a-way-to-verify-its-work): why a test beats a summary.+- [Prompt library](https://code.claude.com/docs/en/prompt-library): copy-ready prompts, tagged by task.----<sub>Sources: [Best practices](https://code.claude.com/docs/en/best-practices) · [Choose a permission mode](https://code.claude.com/docs/en/permission-modes) · [Interactive mode](https://code.claude.com/docs/en/interactive-mode) · [Commands](https://code.claude.com/docs/en/commands) · [git add](https://git-scm.com/docs/git-add) · [git config](https://git-scm.com/docs/git-config) · [less FAQ](https://www.greenwoodsoftware.com/less/faq.html)</sub>+<sub>Sources: [Best practices](https://code.claude.com/docs/en/best-practices) · [Choose a permission mode](https://code.claude.com/docs/en/permission-modes) · [Interactive mode](https://code.claude.com/docs/en/interactive-mode) · [Tools reference](https://code.claude.com/docs/en/tools-reference) · [git add](https://git-scm.com/docs/git-add) · [git apply](https://git-scm.com/docs/git-apply) · [git config](https://git-scm.com/docs/git-config) · [less FAQ](https://www.greenwoodsoftware.com/less/faq.html) · [git stash](https://git-scm.com/docs/git-stash) · [git diff](https://git-scm.com/docs/git-diff) · [git status](https://git-scm.com/docs/git-status) · [git show](https://git-scm.com/docs/git-show) · [git commit](https://git-scm.com/docs/git-commit)</sub><sub>← [Permission modes and plan mode](02-permission-modes-and-plan-mode.md) · [Beginner index](README.md) · [Keep a session on track](04-keep-a-session-on-track.md) → · Topic: [Permissions and safety](../topics/permissions-and-safety.md) · [Stuck on this lesson?](https://github.com/wesammustafa/Claude-Code-Everything-You-Need-to-Know/issues/new?template=lesson-feedback.yml&lesson=b-3)</sub>diff --git a/docs/beginner/04-keep-a-session-on-track.md b/docs/beginner/04-keep-a-session-on-track.mdindex e465195..05f509c 100644--- a/docs/beginner/04-keep-a-session-on-track.md+++ b/docs/beginner/04-keep-a-session-on-track.md@@ -1,111 +1,145 @@# Keep a session on track-<sub>**Beginner** · Lesson 4 of 5 · about 20 minutes · Needs: [Your first change, from request to commit](03-first-change.md) · Verified against Claude Code v2.1.292 (stable) on 2026-10-15</sub>+<sub>**Beginner** · Lesson 4 of 5 · about 25 minutes · Needs: [Your first change, from request to commit](03-first-change.md) · Verified against Claude Code v2.1.292 (stable) on 2026-10-19</sub>## Goal-By the end of this lesson you can keep a session on track: see how full its context is, clear or compact it, rewind a change, and resume an earlier conversation.+By the end of this lesson you can keep a session on track: back out of a change that went the wrong way, keep the context to what matters, and pick the right conversation up again later.## You need-- Your copy of the practice template with no uncommitted changes, and Node.js LTS (a Codespace on your copy has it). To practice in one of your own repositories instead, keep the template copy as well: the check runs from it. Set up the repository's `.practice/` folder as [lesson 1](01-install-and-look-around.md#you-need) describes, if you haven't yet. Start that repository with no uncommitted changes too: commit them, or set them aside with `git stash push --include-untracked`.+- Your copy of the practice template with no uncommitted changes, and Node.js LTS (a Codespace on your copy has it). Your turn runs a script that only the practice copy has, so do this whole lesson there. It needs the copy's `.practice/` folder: if earlier lessons didn't make it, run `mkdir .practice`.+- A second terminal in the same folder, for git.- Usage: light.## The idea-Everything in a conversation, your prompts, Claude's replies and every file it read, sits in the session's context window. The window is large but not endless, and a long, wandering conversation leaves Claude less room for the work that matters now ([Explore the context window](https://code.claude.com/docs/en/context-window)). Five commands keep it in hand ([Commands](https://code.claude.com/docs/en/commands)):+Everything in a conversation, your prompts, Claude's replies and every file it read, sits in the session's context window. A dead end left there crowds out what you need next ([Explore the context window](https://code.claude.com/docs/en/context-window#when-your-context-fills-up)). And sessions usually start in auto mode, where Claude edits without asking you first ([Choose a permission mode](https://code.claude.com/docs/en/permission-modes#which-mode-a-session-starts-in)), so you need a fast way back.-| Command | What it does |+Before each prompt that starts a turn, Claude Code takes a checkpoint, and it tracks the files Claude then changes with its file editing tools. `/rewind`, or `Esc` twice on an empty prompt, lists your prompts: pick one, then choose what you want back ([Checkpointing](https://code.claude.com/docs/en/checkpointing#rewind-and-summarize)).++| You want | Choose ||---|---|-| `/context` | Shows how full the context window is, as a colored grid |-| `/compact` | Summarizes the conversation so far, to free space |-| `/clear` | Starts a new conversation with empty context |-| `/rewind` | Goes back to an earlier prompt, restoring the code, the conversation or both |-| `/resume` | Picks up an earlier conversation |+| The files back, and Claude to remember what it tried | **Restore code** |+| Files and conversation back, to send a better prompt | **Restore code and conversation** |+| The files kept, and a long stretch of conversation shrunk | **Summarize from here** |-Compact when you want to keep going on the same task; clear when you start a different one. Rewind when a change went the wrong way ([Checkpointing](https://code.claude.com/docs/en/checkpointing)).+For the whole conversation ([Commands](https://code.claude.com/docs/en/commands)): `/context` shows what fills the window, as a colored grid; `/compact` summarizes it when you keep going on the same task; `/clear` starts empty for a new task; `/branch` copies it so you can try another direction and keep the original; and `/resume` opens an earlier one.## Worked example-1. Start `claude` in your practice copy and type `/context`. The grid shows how much of the window is used, broken down by category, including your messages and any memory files, such as `CLAUDE.md`, that loaded ([Explore the context window](https://code.claude.com/docs/en/context-window)). Your practice copy has no `CLAUDE.md` yet, so you may see no memory files; [lesson 5](05-project-memory.md) adds one.-2. Fill it a little:+The job: tidy up `brokenLinks` in `src/check-links.js`. You'll try one approach, back out of it, and land the one you want.++1. Start `claude` in your practice copy. In auto mode, Claude edits files and runs most commands without asking; if Claude Code does ask about something, read it and answer as in [lesson 2](02-permission-modes-and-plan-mode.md).+2. Explore:```text- Explain how src/check-links.js decides that a link is broken.+ Explain how src/check-links.js finds broken links, and which files call brokenLinks.```- Run `/context` again: the messages part has grown.-3. Compact, telling Claude what to keep:+ Your wording will differ, but Claude should name `src/cli.js` and `test/links.test.js` as the callers. Every file it reads to answer goes into the context window.+3. Try an approach:```text- /compact keep what we learned about check-links.js+ Make brokenLinks asynchronous, reading files with fs/promises, and update its callers.```- The conversation is replaced by a summary: in `/context` the messages part shrinks and free space grows. After one short question there is little to summarize, so the change is small; compacting pays off when a conversation gets long.-4. Make a change to undo. Rewind can't undo changes Claude makes by running commands (see [Watch out](#watch-out)), so the prompt asks for its file editing tool. Approve the edit if Claude asks:+ In the second terminal, `git status --short` ([git status](https://git-scm.com/docs/git-status)) lists the files Claude changed, `src/check-links.js`, `src/cli.js` and usually `test/links.test.js`, and `git diff` ([git diff](https://git-scm.com/docs/git-diff)) shows the change. Say you decide against it: for a short command-line run, reading files asynchronously buys nothing, and every caller now has to wait for the function.+4. Put the files back. Type `/rewind`, or press `Esc` twice with an empty prompt. Pick the prompt from step 3 and choose **Restore code**. The files go back, and the conversation stays, so Claude still knows what it tried. In the second terminal, run `git status --short`. If it still lists files, Claude changed those files with a command: run `git restore src test` to discard this lesson's uncommitted async attempt, then check again ([Checkpointing](https://code.claude.com/docs/en/checkpointing#bash-command-changes-not-tracked), [git restore](https://git-scm.com/docs/git-restore)). Now `git status --short` prints nothing. If a diff panel is open beside the conversation, it may still show the edit: Claude Code refreshes the panel each time Claude edits a file or runs a shell command ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#diff-panel)), so trust git.++ If the menu offers only **Restore conversation**, the summarize options and **Never mind**, Claude changed the files with a command, which rewind can't undo: choose **Never mind**, press `Esc` to close the menu, and run `git restore src test` ([git restore](https://git-scm.com/docs/git-restore)) in the second terminal.+5. Shrink the dead end. The whole async attempt is still in the conversation. Type `/context` and note the messages part of the grid. Open the rewind menu again and pick the same prompt. Highlight **Summarize from here** with the arrow keys, type this where the row reads **add context (optional)**, and press `Enter`:```text- In src/cli.js, change the success message to "All relative links are fine." Use your file editing tool, not a shell command.+ we tried async and dropped it: every caller had to change```- In a second terminal in the same folder, save what git sees:+ Everything from that prompt on becomes a summary, marked **Summarized conversation**: Claude keeps the lesson in less space, and `/context` now shows a smaller messages part. Summarizing also puts the step 3 prompt back in the input box ([Checkpointing](https://code.claude.com/docs/en/checkpointing#rewind-and-summarize)): press `Esc` twice quickly to clear it.+6. Ask for the approach you want, then commit it:- ```bash- git status --porcelain > .practice/b-4-before-rewind.txt+ ```text+ Keep brokenLinks synchronous. Instead, move the code that checks one file's links into its own function in src/check-links.js, and run the tests.```- The file lists `src/cli.js`.-5. Rewind. Type `/rewind`, or press `Esc` twice with an empty prompt. Pick the prompt from step 4 and choose **Restore code and conversation**. If the menu offers only **Restore conversation**, the summarize options and **Never mind**, Claude changed the file with a command, which rewind can't undo: choose **Never mind**, press `Esc` to close the menu ([Interactive mode](https://code.claude.com/docs/en/interactive-mode)), run `git restore src/cli.js` in the second terminal, and repeat step 4.+ Read the diff in the second terminal, and run `npm run linkcheck -- samples` there: it still prints `guide.md:5: broken link to missing.md`, the sample's one broken link. Then:++ ```text+ commit this with a message that says what changed+ ```- Once the code is restored, save what git sees in the second terminal:+ `git status` in the second terminal ends with `nothing to commit, working tree clean`.+7. The job is done and the next one is unrelated, so clear rather than compact. Name the conversation you're leaving as you clear it ([Commands](https://code.claude.com/docs/en/commands)):- ```bash- git status --porcelain > .practice/b-4-after-rewind.txt+ ```text+ /clear check-links-refactor```- This file is empty: the edit is gone. If a diff panel is open beside the conversation, it may still show the edit: Claude Code refreshes the panel each time Claude edits a file or runs a shell command ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#diff-panel)). The empty file shows what git sees.-6. The rewind put your step 4 prompt back in the input box, so anything you type now is added to it. Press `Esc` twice quickly to clear it. Then type `/clear`. The conversation starts over with empty context, and the old one stays available.-7. Type `/exit`, then reopen the most recent conversation in this folder ([Manage sessions](https://code.claude.com/docs/en/sessions)):+ The new conversation starts with empty context, and the old one is saved under that name. `/compact` is for the other case: the same task, in a conversation grown long.+8. Type `/exit`. Later, open the refactor conversation again by its name ([Manage sessions](https://code.claude.com/docs/en/sessions#name-your-sessions)):```bash- claude --continue+ claude --resume check-links-refactor```- If it opens the empty conversation from step 6, run `/resume` and pick the earlier one. Inside a session, `/resume` with no argument opens a picker of earlier conversations. The conversation you pick may still show the edit you rewound, because it was saved before the rewind. Your files stay as the rewind left them (`git status --porcelain` prints nothing), so don't ask Claude to make the edit again. If Claude offers to redo the rewound edit, say no.+ It shows the refactor and its commit. `claude --continue` opens the most recent conversation in this folder instead, which after `/clear` can be the empty one.## Your turn-Repeat the example in your practice copy, or your own repository:+A teammate offers a script that renames `findLinks` in `src/links.js` to `extractLinks`. Try it in a branch of the conversation, then back out. This time one of the changes is made by a command, to a file Claude hasn't edited in this conversation.++1. The conversation you resumed holds the whole refactor, and you're staying on the link checker, so compact rather than clear:++ ```text+ /compact keep what we changed in src/check-links.js and why+ ```++ Claude Code replaces the conversation so far with a summary that focuses on what you asked to keep ([Commands](https://code.claude.com/docs/en/commands)).+2. Branch the conversation ([Manage sessions](https://code.claude.com/docs/en/sessions#branch-a-session)):++ ```text+ /branch try-rename+ ```++ You're now in a copy of the conversation, and the original, `check-links-refactor`, stays as it was.+3. Ask:++ ```text+ Run node practice/b-4/rename-export.mjs, which renames findLinks in src/links.js. Then update its callers with your file editing tool, not a shell command.+ ```++4. In the second terminal, save what git sees: `git status --porcelain > .practice/b-4-before-rewind.txt`. It lists `src/links.js`, which the script changed, and the callers Claude updated, `src/check-links.js` and usually `test/links.test.js`.+5. Say the rename is off: another tool imports `findLinks` by that name. Before you rewind, decide which of those files **Restore code** will put back. Then rewind the step 3 prompt with **Restore code**, and save what git sees: `git status --porcelain > .practice/b-4-after-rewind.txt`.-1. Run `/context`, ask one question about the code, and run `/context` again.-2. Run `/compact` with a sentence about what to keep.-3. Ask for a small edit to one file, ending the prompt with "Use your file editing tool, not a shell command.", and approve it if Claude asks. Save `git status --porcelain > .practice/b-4-before-rewind.txt`.-4. Rewind that prompt with **Restore code and conversation**, and save `git status --porcelain > .practice/b-4-after-rewind.txt`.-5. Press `Esc` twice quickly to clear the restored prompt, then run `/clear`, then `/exit`, then `claude --continue`.+ If the menu offers only **Restore conversation**, the summarize options and **Never mind**, Claude updated the callers with commands: choose **Never mind**, press `Esc`, run `git restore src test`, and repeat from step 3.+6. Read that file, and run `npm run linkcheck -- samples`. Get `src/` back to your last commit so the link check runs again, and run it to see.+7. Go back to the original conversation with `/resume check-links-refactor`.## CheckYou are done when all of these are true:-- [ ] `.practice/b-4-before-rewind.txt` lists the file Claude changed: `cat .practice/b-4-before-rewind.txt`.-- [ ] `.practice/b-4-after-rewind.txt` lists no files: `cat .practice/b-4-after-rewind.txt` prints nothing.-- [ ] Self-check (not tested): you can say when you'd use `/compact` and when `/clear`.+- [ ] A commit after your copy's first one changes `src/check-links.js`, which still exports a synchronous `brokenLinks`: `git log --stat -3` ([git log](https://git-scm.com/docs/git-log)) lists it.+- [ ] `.practice/b-4-before-rewind.txt` lists `src/links.js` and `src/check-links.js`: `cat .practice/b-4-before-rewind.txt`.+- [ ] `.practice/b-4-after-rewind.txt` lists `src/links.js` and no other file in `src/` or `test/`: `cat .practice/b-4-after-rewind.txt`.+- [ ] `src/` and `test/` have no uncommitted changes, your last commit's `src/links.js` still exports `findLinks`, and `npm run linkcheck -- samples` runs without an error.+- [ ] Self-check (not tested): the conversation `/resume check-links-refactor` opened doesn't mention the rename.-Run `npm run check -- b-4` in your practice copy. In your own repository, run `npm run check -- b-4 --dir <your repo>` from your practice copy instead.+Run `npm run check -- b-4` in your practice copy.-If the first file lists nothing, you saved it before the edit was made; make the edit again, save the file after it, then rewind again. If the second file still lists the file Claude changed, rewind that prompt with an option that restores code, then save the second file again. When the menu no longer lists that prompt (after **Restore conversation**) or offers no option that restores code (Claude used a command), run `git restore <file>` and repeat Your turn steps 3 and 4 instead. Files you changed before the lesson also stay listed, because rewind can't undo them: commit them or set them aside with `git stash push --include-untracked`, then save the second file again.+If no commit changes `src/check-links.js`, finish Worked example step 6 and commit. If `.practice/b-4-before-rewind.txt` is missing a path, save it again once the script has run and Claude has updated the callers. If `.practice/b-4-after-rewind.txt` still lists `src/check-links.js` or `test/links.test.js`, rewind the step 3 prompt with **Restore code** and save again; if they stay changed, Claude changed them with a command: run `git restore src test`, then repeat Your turn from step 3. If it doesn't list `src/links.js`, and you didn't restore that file yourself, Claude had already edited `src/links.js` in this conversation, and rewind also puts back a command's change to a file Claude edited: run `git restore src test`, type `/exit`, start `claude` for a new session, and repeat Your turn from step 3. If the link check stops with an error about `findLinks`, or the check says your last commit no longer exports it, `src/links.js` still holds the script's rename: run `git restore src/links.js`, or, once the rename is in a commit, undo that commit with `git revert <sha>` ([git revert](https://git-scm.com/docs/git-revert)), with the sha `git log` lists for it.## Watch out-- Rewind undoes only the edits Claude made with its file editing tools. Changes made by commands it ran, such as deleting a file with `rm`, stay ([Checkpointing](https://code.claude.com/docs/en/checkpointing#bash-command-changes-not-tracked)); commit your work so git can bring it back.+- Rewind puts back the files Claude edited with its file editing tools. A command's change to any other file, such as `rm`, `mv` or a script, stays ([Checkpointing](https://code.claude.com/docs/en/checkpointing#bash-command-changes-not-tracked)), while a change to a file Claude already edited in the session can be put back with it ([Checkpointing](https://code.claude.com/docs/en/checkpointing#external-changes-not-tracked)). Commit your work so git can bring it back.## Go further- [Explore the context window](https://code.claude.com/docs/en/context-window): an interactive view of what fills a session.- [Session management and 1M context](https://claude.com/blog/using-claude-code-session-management-and-1m-context): when to compact, clear or start fresh.+- [Manage sessions](https://code.claude.com/docs/en/sessions): naming, the session picker and branching in full.----<sub>Sources: [Commands](https://code.claude.com/docs/en/commands) · [Explore the context window](https://code.claude.com/docs/en/context-window) · [Checkpointing](https://code.claude.com/docs/en/checkpointing) · [Interactive mode](https://code.claude.com/docs/en/interactive-mode) · [Manage sessions](https://code.claude.com/docs/en/sessions)</sub>+<sub>Sources: [Commands](https://code.claude.com/docs/en/commands) · [Explore the context window](https://code.claude.com/docs/en/context-window) · [Choose a permission mode](https://code.claude.com/docs/en/permission-modes) · [Checkpointing](https://code.claude.com/docs/en/checkpointing) · [Interactive mode](https://code.claude.com/docs/en/interactive-mode) · [Manage sessions](https://code.claude.com/docs/en/sessions) · [git status](https://git-scm.com/docs/git-status) · [git diff](https://git-scm.com/docs/git-diff) · [git restore](https://git-scm.com/docs/git-restore) · [git log](https://git-scm.com/docs/git-log) · [git revert](https://git-scm.com/docs/git-revert)</sub><sub>← [Your first change, from request to commit](03-first-change.md) · [Beginner index](README.md) · [Project memory with CLAUDE.md](05-project-memory.md) → · Topic: [Memory and context](../topics/memory-and-context.md) · [Stuck on this lesson?](https://github.com/wesammustafa/Claude-Code-Everything-You-Need-to-Know/issues/new?template=lesson-feedback.yml&lesson=b-4)</sub>diff --git a/docs/beginner/05-project-memory.md b/docs/beginner/05-project-memory.mdindex dacbbf4..0a43d38 100644--- a/docs/beginner/05-project-memory.md+++ b/docs/beginner/05-project-memory.md@@ -1,26 +1,31 @@# Project memory with CLAUDE.md-<sub>**Beginner** · Lesson 5 of 5 · about 20 minutes · Needs: [Your first change, from request to commit](03-first-change.md) · Verified against Claude Code v2.1.292 (stable) on 2026-10-15</sub>+<sub>**Beginner** · Lesson 5 of 5 · about 20 minutes · Needs: [Your first change, from request to commit](03-first-change.md) · Verified against Claude Code v2.1.292 (stable) on 2026-10-19</sub>## Goal-By the end of this lesson you can create a project CLAUDE.md and show that a new session follows it.+By the end of this lesson you can create a project CLAUDE.md, show that a new session follows it, and decide which memory file each instruction belongs in.## You need-- Your copy of the practice template with no uncommitted changes, and Node.js LTS (a Codespace on your copy has it). To practice in one of your own repositories instead, keep the template copy as well: the check runs from it. Set up the repository's `.practice/` folder as [lesson 1](01-install-and-look-around.md#you-need) describes, if you haven't yet.+- Your copy of the practice template with no uncommitted changes, and Node.js LTS (a Codespace on your copy has it). Do this lesson in the practice copy: Your turn's notes are about its code. The lesson ends by giving one of your own repositories the same start.- Usage: light.## The idea-Each session starts with a fresh context window, so you can end up repeating your project's habits. A `CLAUDE.md` file at the project root fixes that: Claude Code reads it at the start of every session ([How Claude remembers your project](https://code.claude.com/docs/en/memory)).+Each session starts with a fresh context window. Your instruction files load at the start of each one, and where you write an instruction decides who gets it ([How Claude remembers your project](https://code.claude.com/docs/en/memory#choose-where-to-put-claude-md-files)):-- Put in it what every session should know: the build and test commands, conventions, the project's layout, "always do X" rules. Keep it short; the docs suggest under 200 lines.-- Commit it, so everyone who works on the project gets the same instructions.-- `/init` writes a first version for you from what it finds in the code.-- Claude treats CLAUDE.md as context, not as configuration it must obey. A rule that must never be broken needs a [hook](https://code.claude.com/docs/en/hooks-guide), which the [Intermediate level](../intermediate/README.md) teaches.+| Where | What goes in it | Who gets it |+|---|---|---|+| `./CLAUDE.md` | Commands, conventions, layout | The team: commit it |+| `~/.claude/CLAUDE.md` | Your habits for every project | Only you |+| `./CLAUDE.local.md` | Your notes for this project | Only you: add it to `.gitignore` |+| Auto memory | Notes Claude saves, such as what you ask it to remember | Only you, on this machine |-A session reads CLAUDE.md when it starts, so after you change the file, start a new session to be sure it uses the change.+- `/init` writes a first `CLAUDE.md` from the code. Keep it brief and specific ([Write effective instructions](https://code.claude.com/docs/en/memory#write-effective-instructions)).+- Say "add this to CLAUDE.md" to put an instruction in the file; "remember" puts it in auto memory ([View and edit with `/memory`](https://code.claude.com/docs/en/memory#view-and-edit-with-%2Fmemory)).+- An edit to CLAUDE.md mid-session waits for the next `/clear`, `/compact` or new session ([Editing CLAUDE.md mid-session](https://code.claude.com/docs/en/prompt-caching#editing-claude-md-mid-session)).+- These files are context, not configuration Claude must obey: a rule that must never be broken needs a [hook](https://code.claude.com/docs/en/hooks-guide), which the [Intermediate level](../intermediate/README.md) teaches.## Worked example@@ -30,24 +35,17 @@ A session reads CLAUDE.md when it starts, so after you change the file, start a/init```- Claude reads the code and writes a `CLAUDE.md` with the commands and conventions it found. Approve the file if it asks. In a second terminal, read it with `cat CLAUDE.md`.-2. Open `CLAUDE.md` in your editor, or type `/memory` and choose **Project instructions**, the `./CLAUDE.md` in this folder. Don't pick the user file in `~/.claude/`: it applies to all your projects ([View and edit with `/memory`](https://code.claude.com/docs/en/memory#view-and-edit-with-%2Fmemory)). A terminal editor such as Vim takes over the terminal until you save and quit.+ Claude reads the code and writes a `CLAUDE.md` with the commands and conventions it found. If Claude Code asks before it writes the file, allow it. In a second terminal, read the file with `cat CLAUDE.md`.+2. Edit it as you would before your team sees it. Open `CLAUDE.md` in your editor, or type `/memory` and choose **Project instructions**, the `./CLAUDE.md` in this folder. `/memory` also lists your user file in `~/.claude/`, which applies to all your projects, and has a toggle and a folder for auto memory ([View and edit with `/memory`](https://code.claude.com/docs/en/memory#view-and-edit-with-%2Fmemory)). A terminal editor such as Vim takes over the terminal until you save and quit.+ - In the practice copy, `/init` may also describe the course, and even this lesson: `checks/`, `learn/`, `capstone/` and `.github/`. Delete those parts, the `npm run check`, `npm run learn` and `npm run test:checks` lines, and any rule that says to keep your work off `main`: that rule is for the template repository, not your copy.+ - Compare each command that's left with the `scripts` in `package.json`. Keep `npm test`, which the [capstone](capstone.md) checks for.+ - Add a convention that shows up in files. Put it under a `## Conventions` heading, and add that heading at the end of the file if `/init` didn't write one:- In the practice copy, `/init` may also describe the course's own files: `checks/`, `learn/`, `capstone/` and `.github/`. Delete what it says about them and about `npm run check`, `npm run learn` and `npm run test:checks`, including any rule that says to keep your work off `main`: that rule is for the template repository, not your copy. Keep the other commands, including `npm test`, which the [capstone](capstone.md) checks for.+ ```markdown+ - Every new JavaScript file in `src/` starts with the line `// SPDX-License-Identifier: MIT`.+ ```- Then add a rule that shows up in files, so you can see whether a session follows it. Put it under a `## Conventions` heading, and add that heading at the end of the file if `/init` didn't write one:-- ```markdown- - Every new source file starts with the line `// Part of linkcheck.`- ```-- In the second terminal, save the rule's exact line for the check:-- ```bash- echo '// Part of linkcheck.' > .practice/b-5-rule.txt- ```-- **Windows:** `'// Part of linkcheck.' | Set-Content .practice/b-5-rule.txt`+ A license header is a common project rule, and no linkcheck file has one yet, so you'll see whether a session follows it. The rule names the files it covers: a `//` line at the top of a shell script or a JSON file would break either one, and every session reads this file.3. Save `CLAUDE.md`, then commit it in the second terminal:```bash@@ -56,67 +54,67 @@ A session reads CLAUDE.md when it starts, so after you change the file, start a```4. Type `/exit`, then start a new session with `claude`, so it loads CLAUDE.md with your rule. Type `/context all` and find `CLAUDE.md` under **Memory files**: the session has loaded it. Plain `/context` can collapse that list, and `all` expands it ([Commands](https://code.claude.com/docs/en/commands)).-5. Ask for a change that creates a new file:+5. Ask for a change that creates a new file. The request doesn't mention the header:```textAdd src/stats.js with a function countLinks(markdown) that returns how many links findLinks finds. Add a test in test/stats.test.js, run the tests and commit.```- Approve any permission prompts Claude shows. In auto mode you may see none: auto mode lets Claude work without routine permission prompts ([Choose a permission mode](https://code.claude.com/docs/en/permission-modes#eliminate-prompts-with-auto-mode)).-6. In the second terminal, look at the first line of the new file, save the commit for the check, and confirm nothing is left over:+ A new session normally starts in auto mode, so Claude may finish without asking you anything; if Claude Code asks, read what it wants to do before you answer ([Which mode a session starts in](https://code.claude.com/docs/en/permission-modes#which-mode-a-session-starts-in)).+6. In the second terminal, look at the first line of the new file and confirm nothing is left over:```bashhead -1 src/stats.js- git rev-parse HEAD > .practice/b-5-commit.txtgit status```**Windows:** `Get-Content src/stats.js -TotalCount 1` replaces `head -1`.- The first line should read `// Part of linkcheck.`, though you never asked for it in this session. `git status` should read `nothing to commit, working tree clean`. If it lists `src/stats.js`, Claude hasn't committed yet: ask it to commit, then save the commit again.+ The first line should read `// SPDX-License-Identifier: MIT`, though you never asked for it in this session. `git status` ([git status](https://git-scm.com/docs/git-status)) should read `nothing to commit, working tree clean`. If it lists `src/stats.js`, Claude hasn't committed yet: ask it to.## Your turn-Repeat the example in your practice copy, or your own repository, with a new rule and a new file. Your practice copy already has a `CLAUDE.md`, so skip `/init` there:--1. Open `CLAUDE.md` and replace the example's rule with a new one:-- ```markdown- - Every new source file starts with the line `// linkcheck source.`- ```+These are four things you kept telling Claude during a week on linkcheck. Three of them belong in three different places, and one is wrong: fix it or leave it out.-2. In the second terminal, save the new rule's exact line: `echo '// linkcheck source.' > .practice/b-5-rule.txt` (**Windows:** `'// linkcheck source.' | Set-Content .practice/b-5-rule.txt`).-3. Commit `CLAUDE.md` there.-4. Exit, start a new session, and check that `/context all` lists `CLAUDE.md` under **Memory files**.-5. Ask for a new file and its test, and let Claude commit:+```markdown+1. CLI errors go to stderr and start with `linkcheck:`.+2. Run the tests with `npm run tests` before you commit.+3. My sample docs are in `~/scratch/linkcheck-docs`: run the CLI on them when I ask for a smoke test.+4. Keep your replies short, with no summary at the end. I want that in every project.+```- ```text- Add src/external.js with a function countExternal(markdown) that returns how many of the links findLinks finds are external, according to isExternal. Add a test in test/external.test.js, run the tests and commit.- ```+Decide where each line goes before you write anything:-6. As in the example's step 6, check the first line of `src/external.js`, save the commit to `.practice/b-5-commit.txt`, and run `git status`.+1. For each line, choose the project's `CLAUDE.md`, a `CLAUDE.local.md`, your user file, or nowhere. A line that goes in a committed file must be true: compare it with `package.json` and `src/cli.js`, because every session, and every teammate's, will read it.+2. Tell Claude in a session what goes in the project's file: `Add this to CLAUDE.md:` and the line. Edit the file yourself if you prefer.+3. Put what is yours alone for this project in a `CLAUDE.local.md` at the project root, and add the line `CLAUDE.local.md` to `.gitignore`.+4. A habit you want in every project goes in your user file: `/memory`, then **User instructions**. That file reaches every session you start, in every project, so this step is up to you.+5. Commit `CLAUDE.md` and `.gitignore`. `git status` should be clean, since git now ignores `CLAUDE.local.md`.-In your own repository, start with `/init`; if the repository already has a `CLAUDE.md`, `/init` suggests improvements rather than overwriting it. Write the rule in your language's comment style, such as `# Part of my-project.`, save that exact line to `.practice/b-5-rule.txt` in step 2, and ask for a small new file. If the repository has an `AGENTS.md`, put `@AGENTS.md` on the first line of `CLAUDE.md`: by default, once a `CLAUDE.md` exists, Claude reads it instead of `AGENTS.md` ([AGENTS.md](https://code.claude.com/docs/en/memory#agents-md)).+Afterwards, give one of your own repositories the same start: `/init`, compare each command it wrote with the code, then commit `CLAUDE.md` there. [Intermediate lesson 2](../intermediate/02-organize-memory.md) starts from that file. If the repository has an `AGENTS.md`, put `@AGENTS.md` on the first line of `CLAUDE.md`: by default, once a `CLAUDE.md` exists, Claude reads it instead of `AGENTS.md` ([AGENTS.md](https://code.claude.com/docs/en/memory#agents-md)).## CheckYou are done when all of these are true:-- [ ] A committed CLAUDE.md holds the rule saved in `.practice/b-5-rule.txt`: `git show HEAD:CLAUDE.md` shows it.-- [ ] The commit named in `.practice/b-5-commit.txt` adds at least one file other than tests and Markdown, and each such file starts with that rule: `git show --stat $(cat .practice/b-5-commit.txt)` lists them. **Windows:** `git show --stat (Get-Content .practice/b-5-commit.txt)`.-- [ ] Self-check (not tested): you started a new session after adding the rule to CLAUDE.md, and you can say why that matters.+- [ ] A committed CLAUDE.md has a rule that every new JavaScript file in `src/` starts with a given line: `git show HEAD:CLAUDE.md` ([git show](https://git-scm.com/docs/git-show)) shows it.+- [ ] A commit made after that rule adds JavaScript files to `src/`, and each of them starts with the rule's line: `git log --stat -3` ([git log](https://git-scm.com/docs/git-log)) lists them.+- [ ] The committed CLAUDE.md holds the notes' rule for CLI errors, and every `npm run` script it names is in `package.json`.+- [ ] A committed `.gitignore` keeps `CLAUDE.local.md` out, git tracks no `CLAUDE.local.md`, and the committed CLAUDE.md holds neither personal note: `git check-ignore CLAUDE.local.md` ([git check-ignore](https://git-scm.com/docs/git-check-ignore)) prints its name.+- [ ] Self-check (not tested): the session that wrote `src/stats.js` started after you committed the rule, and its `/context all` listed `CLAUDE.md` under **Memory files**. Your `CLAUDE.local.md` holds the sample-docs note: git ignores that file, so the check can't see it.-Run `npm run check -- b-5` in your practice copy. In your own repository, run `npm run check -- b-5 --dir <your repo>` from your practice copy instead.+Run `npm run check -- b-5` in your practice copy.-If CLAUDE.md isn't committed, run `git add CLAUDE.md` and commit it. If a new file doesn't start with the rule, start a new session and run `/context all`. When `CLAUDE.md` is missing under **Memory files**, the session can't see it: start `claude` in the folder that holds `CLAUDE.md`. When it is listed, Claude read the rule but didn't follow it. Either way, ask the session for a different new file, such as `src/summary.js` with a test, and to commit it. Then save that commit with `git rev-parse HEAD > .practice/b-5-commit.txt` and run the check again. Fixing the old file in place won't pass, because the check reads only the files that commit adds.+If CLAUDE.md isn't committed, run `git add CLAUDE.md` and commit it. If a new file doesn't start with the rule, start a new session and run `/context all`. When `CLAUDE.md` is missing under **Memory files**, the session can't see it: start `claude` in the folder that holds `CLAUDE.md`. When it is listed, Claude read the rule but didn't follow it. Either way, ask the session for a different new file, such as `src/summary.js` with a test, and to commit it: the check looks for a commit that adds new files to `src/`, so fixing the old file in place won't pass. If the check names an `npm run` script, it quotes the line: that script isn't in `package.json`, so fix or delete the line, even one that warns against the command, and commit CLAUDE.md. If the `.gitignore` item fails, add the line `CLAUDE.local.md` to `.gitignore` and commit it; a rule only in your global git excludes file doesn't count. If `CLAUDE.local.md` was committed, run `git rm --cached CLAUDE.local.md` ([git rm](https://git-scm.com/docs/git-rm)) and commit.## Go further- [Write an effective CLAUDE.md](https://code.claude.com/docs/en/best-practices#write-an-effective-claude-md): what to put in it and what to leave out.- [Using CLAUDE.md files](https://claude.com/blog/using-claude-md-files): Anthropic's guide, with examples.+- [Auto memory](https://code.claude.com/docs/en/memory#auto-memory): what Claude saves for itself, where, and how to turn it off.----<sub>Sources: [How Claude remembers your project](https://code.claude.com/docs/en/memory) · [Commands](https://code.claude.com/docs/en/commands) · [Choose a permission mode](https://code.claude.com/docs/en/permission-modes) · [Best practices](https://code.claude.com/docs/en/best-practices) · [Automate actions with hooks](https://code.claude.com/docs/en/hooks-guide)</sub>+<sub>Sources: [How Claude remembers your project](https://code.claude.com/docs/en/memory) · [How Claude Code uses prompt caching](https://code.claude.com/docs/en/prompt-caching) · [Commands](https://code.claude.com/docs/en/commands) · [Choose a permission mode](https://code.claude.com/docs/en/permission-modes) · [Best practices](https://code.claude.com/docs/en/best-practices) · [Automate actions with hooks](https://code.claude.com/docs/en/hooks-guide) · [git status](https://git-scm.com/docs/git-status) · [git show](https://git-scm.com/docs/git-show) · [git log](https://git-scm.com/docs/git-log) · [git check-ignore](https://git-scm.com/docs/git-check-ignore) · [git rm](https://git-scm.com/docs/git-rm)</sub><sub>← [Keep a session on track](04-keep-a-session-on-track.md) · [Beginner index](README.md) · [Beginner capstone](capstone.md) → · Topic: [Memory and context](../topics/memory-and-context.md) · [Stuck on this lesson?](https://github.com/wesammustafa/Claude-Code-Everything-You-Need-to-Know/issues/new?template=lesson-feedback.yml&lesson=b-5)</sub>diff --git a/docs/beginner/README.md b/docs/beginner/README.mdindex 0ad2559..52d807e 100644--- a/docs/beginner/README.md+++ b/docs/beginner/README.md@@ -1,8 +1,8 @@# Beginner-<sub>**Beginner** · about 2½ hours · Verified against Claude Code v2.1.292 (stable) on 2026-10-15</sub>+<sub>**Beginner** · about 2½ hours · Verified against Claude Code v2.1.292 (stable) on 2026-10-19</sub>-One session, one change. You install Claude Code, decide what it may do without asking, take one change from request to commit, keep a long session on track, and give it a project memory.+One session, one change. You install Claude Code and check what it tells you against the code, decide what it may do without asking, take a change from request to commit and catch what it gets wrong, back out of a wrong turn and keep a long session on track, and give it a project memory.## You're ready for this level if you can@@ -18,7 +18,7 @@ Before lesson 1, make your own copy of the [practice template](https://github.coTo go step by step, run `npm run learn` in your copy and use Claude Code in a second terminal beside it. The app takes you through every core lesson and the capstone, one step at a time, and checks your work as you go. Each page below teaches the same lesson on its own.-Each core lesson and the capstone end with a check you run in your copy as `npm run check -- <id>`, where the id is `b-1` to `b-5` for the lessons and `b-capstone` for the capstone. The Electives end with a checklist you confirm yourself. The checks need Node.js LTS, which a Codespace on your copy has preinstalled. To practice in one of your own repositories instead, keep the template copy as well: the checks run from it with `--dir`.+Each core lesson and the capstone end with a check you run in your copy as `npm run check -- <id>`, where the id is `b-1` to `b-5` for the lessons and `b-capstone` for the capstone. The Electives end with a checklist you confirm yourself. The checks need Node.js LTS, which a Codespace on your copy has preinstalled. Every Beginner exercise runs in the template copy, because each one works with files planted there; lesson 5 ends by giving one of your own repositories a `CLAUDE.md`, and the [Intermediate level](../intermediate/README.md) practices in your own repository.On native Windows, if PowerShell refuses to run `npm` with `running scripts is disabled on this system` ([Troubleshoot installation](https://code.claude.com/docs/en/troubleshoot-install#running-scripts-is-disabled-on-this-system)), follow the Windows note in [lesson 1](01-install-and-look-around.md#you-need).@@ -30,11 +30,11 @@ On native Windows, if PowerShell refuses to run `npm` with `running scripts is d4. [Keep a session on track](04-keep-a-session-on-track.md)5. [Project memory with CLAUDE.md](05-project-memory.md)-Each lesson takes about 20 minutes, and the capstone 30 to 60.+Each lesson takes 20 to 25 minutes, and the capstone 30 to 60.## Capstone-[Fix a reported bug, from plan to commit](capstone.md): record your Claude Code version, then fix a reported bug in the practice template: plan the fix, change two source files, add a test that fails before the fix and passes after it, and commit. Its check covers what it can see in files and git, and the capstone page lists the rest of the [Beginner Exit](#by-the-end-of-this-level-you-can) for you to tick yourself.+[Fix a reported bug, from plan to commit](capstone.md): reproduce a reported bug in the practice template, plan the fix in plan mode with a test that fails before the fix and passes after it, review the diff against the report, and commit. Its check covers what it can see in files and git, and the capstone page lists the rest of the [Beginner Exit](#by-the-end-of-this-level-you-can) for you to tick yourself.## By the end of this level you candiff --git a/docs/beginner/capstone.md b/docs/beginner/capstone.mdindex a8af95e..b66635e 100644--- a/docs/beginner/capstone.md+++ b/docs/beginner/capstone.md@@ -1,46 +1,48 @@# Beginner capstone: fix a reported bug, from plan to commit-<sub>**Beginner** · Capstone · 30 to 60 minutes · Needs: the five [Beginner lessons](README.md), or their skills · Verified against Claude Code v2.1.292 (stable) on 2026-10-15</sub>+<sub>**Beginner** · Capstone · 30 to 60 minutes · Needs: the five [Beginner lessons](README.md), or their skills · Verified against Claude Code v2.1.292 (stable) on 2026-10-19</sub>-This task puts the whole Beginner level together. Unlike the lessons, it has no worked example: the steps say what to do, and you choose the prompts. The [Beginner Exit](README.md#by-the-end-of-this-level-you-can) is the list of what you can do by the end of this level. The check reads the files and the commit this task leaves behind, and you tick the rest of the Exit yourself under [What the check can't see](#what-the-check-cant-see). When both are done, you've shown the Beginner Exit, whether you took the lessons or not.+This task puts the whole Beginner level together. Unlike the lessons, it has no worked example: the steps say what to do, and you choose the prompts and make the calls. The [Beginner Exit](README.md#by-the-end-of-this-level-you-can) is the list of what you can do by the end of this level. The check reads the files and the commit this task leaves behind, and you tick the rest of the Exit yourself under [What the check can't see](#what-the-check-cant-see). When both are done, you've shown the Beginner Exit, whether you took the lessons or not.## You need-- Your copy of the practice template, with no uncommitted changes, and Node.js LTS (a Codespace on your copy has it). If `git status --porcelain` lists files, commit them or set them aside with `git stash push --include-untracked`. The capstone runs in the template only.+- Your copy of the practice template, with no uncommitted changes, and Node.js LTS (a Codespace on your copy has it). If `git status --porcelain` ([git status](https://git-scm.com/docs/git-status)) lists files, commit them or set them aside with `git stash push --include-untracked` ([git stash](https://git-scm.com/docs/git-stash)). The capstone runs in the template only.- If you skipped the lessons: create the `.practice/` folder in your copy (`mkdir -p .practice`; **Windows:** `New-Item -ItemType Directory -Force .practice`). The template already tells git to ignore it.- A committed `CLAUDE.md` in your copy that names the test command, `npm test`: `git show HEAD:CLAUDE.md` shows it. Lesson 5 gives you one; if yours doesn't name `npm test`, add it.-- If you skipped lesson 5, or did it only in your own repository: start `claude` in your copy and run `/init`. In the new `CLAUDE.md`, delete what it says about the course's own files (`checks/`, `learn/`, `capstone/` and `.github/`) and about `npm run check`, `npm run learn` and `npm run test:checks`, including any rule to keep your work off `main`: that rule is for the template repository, not your copy. Make sure the file names `npm test`.+- If you skipped lesson 5: start `claude` in your copy and run `/init`. In the new `CLAUDE.md`, delete what it says about the course's own files (`checks/`, `learn/`, `capstone/` and `.github/`) and about `npm run check`, `npm run learn` and `npm run test:checks`, including any rule to keep your work off `main`: that rule is for the template repository, not your copy. Make sure the file names `npm test`, then end that session with `/exit`, so the task starts in a new one.- Commit any change to `CLAUDE.md` on its own before you start (`git add CLAUDE.md`, then `git commit -m "Add CLAUDE.md"`): the fix commit may change only the files the plan names.+- Two terminals open in your copy: one for Claude Code, one for your own commands.- Usage: moderate.> [!NOTE]-> On native Windows, run every command in PowerShell. A command with no **Windows** line works there as written; where a **Windows** line follows a command, use it instead. If `Shift+Tab` does nothing, press `Alt+M` instead ([Interactive mode](https://code.claude.com/docs/en/interactive-mode)).+> On native Windows, run every command in PowerShell. A command with no **Windows** line works there as written; where a **Windows** line follows a command, use it instead. If `Shift+Tab` does nothing, press `Alt+M` instead ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#general-controls)).## The task-A teammate filed the bug report in `capstone/beginner-bug.md` in your practice copy: when `linkcheck.json` lists a folder that doesn't exist, the tool says every link resolves and exits with code 0.+A teammate filed the bug report in `capstone/beginner-bug.md` in your practice copy: when `linkcheck.json` lists a folder that doesn't exist, the tool says every link resolves and exits with code 0. Read it first: its "What should happen" section is what done means.-To try the bug by hand, make a new folder outside your practice copy and save `{ "files": ["docs"] }` in it as `linkcheck.json`. Then run `npm run linkcheck -- <that folder>` in your copy: until the bug is fixed, it prints `All relative links resolve.` Don't put a `linkcheck.json` in your copy, because the check counts it as a change. **Windows:** save the file with `'{ "files": ["docs"] }' | Set-Content <that folder>\linkcheck.json`, not `>`. In Windows PowerShell 5.1, `>` writes UTF-16 ([about_Character_Encoding](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding?view=powershell-5.1)), which the tool rejects as invalid JSON with exit code 2, even before the fix.+Reproduce the bug before you fix it. In your own terminal, make a new folder outside your practice copy and save `{ "files": ["docs"] }` in it as `linkcheck.json`. Then run `npm run linkcheck -- <that folder>` in your copy: until the bug is fixed, it prints `All relative links resolve.` Don't put a `linkcheck.json` in your copy, because the check counts it as a change. **Windows:** save the file with `'{ "files": ["docs"] }' | Set-Content <that folder>\linkcheck.json`, not `>`. In Windows PowerShell 5.1, `>` writes UTF-16 ([about_Character_Encoding](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding?view=powershell-5.1)), which the tool rejects as invalid JSON with exit code 2, even before the fix.Fix it the way the Beginner lessons taught:-1. Save the output of `claude --version` to `.practice/version.txt`.-2. Start a session and switch to plan mode before your first prompt. Then have Claude read the bug report and plan the fix. The fix touches two source files and at least one test file. Ask for a plan that adds the test and runs it before changing the code, so you see it fail ([Best practices](https://code.claude.com/docs/en/best-practices#provide-specific-context-in-your-prompts): "write a failing test that reproduces the issue, then fix it").-3. While the final plan is on screen, open another terminal in the same folder. Save `git status --porcelain` to `.practice/capstone-before.txt`. Save the files the plan will change, every test file included, to `.practice/capstone-plan.txt`: one path per line, relative to the repository root, with forward slashes, such as `src/cli.js`.-4. Approve the plan. Watch the new test fail, then pass after the fix. To read the test output, not only Claude's summary, press `Ctrl+O` as in [lesson 3](03-first-change.md#worked-example), and `Esc` to go back ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#general-controls)).-5. Review the whole diff, the test file included, as in [lesson 3](03-first-change.md#worked-example). The diff panel's list leaves test files out until you click the line that counts them ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#diff-panel)). `git diff` leaves out a new file until you run `git add -N <file>` ([git add](https://git-scm.com/docs/git-add#Documentation/git-add.txt--N)). Ask for at least one correction that stays inside the files the plan names, and make sure `npm test` passes.-6. Commit the fix and its test together, then save the commit with `git rev-parse HEAD > .practice/capstone-commit.txt`. The check reads only that commit, so if you change it later, save it again.+1. Start a new session in your copy. It usually starts in auto mode. Here you want to approve the plan before any file changes, so switch to plan mode before your first prompt: press `Shift+Tab` until the status bar shows `⏸ plan mode on`, or start the prompt with `/plan` ([Permission modes](https://code.claude.com/docs/en/permission-modes#analyze-before-you-edit-with-plan-mode)).+2. Have Claude read the bug report and plan the fix. Don't name the files to change: let Claude find them. Ask for a plan that adds the test first and runs it before changing the code, so you see it fail ([Best practices](https://code.claude.com/docs/en/best-practices#provide-specific-context-in-your-prompts): "write a failing test that reproduces the issue, then fix it").+3. Review the plan before you approve it. Open the files it names and check that the code it describes is there, as you checked Claude's answer in [lesson 1](01-install-and-look-around.md#your-turn). The plan should add a test of what the bug report's "What should happen" asks for, run it and see it fail before any source file changes, and change only the files the bug needs. If it falls short, use the plan menu to tell Claude what to change, as in [lesson 2](02-permission-modes-and-plan-mode.md#worked-example) ([Permission modes](https://code.claude.com/docs/en/permission-modes#review-and-approve-a-plan)).+4. While the final plan is on screen, in your own terminal, save `git status --porcelain` to `.practice/capstone-before.txt`. Save the files the plan will change, every test file included, to `.practice/capstone-plan.txt`: one path per line, relative to the repository root, with forward slashes, such as `src/cli.js`.+5. Approve with **Yes, and use auto mode** (it reads **Yes, auto-accept edits** where auto mode isn't available): you've approved what Claude will do, so it can work without a prompt for each edit. If Claude Code asks before an action anyway, read what it will run before you answer. Watch the new test fail, then pass after the fix. Claude may write a test or run the tests with a shell command, so read the test output itself, not only Claude's summary: press `Ctrl+O`, as in [lesson 3](03-first-change.md#worked-example), and `Esc` to go back ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#transcript-viewer)).+6. Review the whole diff, the tests included, against the bug report, as in [lesson 3](03-first-change.md#worked-example). Does the error name the missing folder? Does the tool exit with code 2? Does the test check the case the report describes? The diff panel's list leaves test files out until you click the line that counts them ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#diff-panel)), and a change Claude made with a shell command shows only in the `Current` view, not in the view of the turn that made it ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#review-changes-with-%2Fdiff)). `git diff` ([git diff](https://git-scm.com/docs/git-diff)) leaves out a new file until you run `git add -N <file>` ([git add](https://git-scm.com/docs/git-add#Documentation/git-add.txt--N)). Ask Claude to correct anything that falls short, inside the files the plan names, and make sure `npm test` passes.+7. Commit the fix and its test together, then save the commit with `git rev-parse HEAD > .practice/capstone-commit.txt` ([git rev-parse](https://git-scm.com/docs/git-rev-parse)). The check reads only that commit, so if you change it later, save it again.-Keep the session on track as you go: check `/context`, and compact or rewind when it helps.+Keep the session on track as you go. Check `/context` before you commit, and again whenever the session grows. For a quick question about what Claude has already read, use `/btw`, which keeps the question and its answer out of the conversation ([Interactive mode](https://code.claude.com/docs/en/interactive-mode#side-questions-with-%2Fbtw)). If Claude's fix heads the wrong way, open `/rewind` and choose **Restore code** to undo its edits and keep the conversation, then tell it what to do instead ([Checkpointing](https://code.claude.com/docs/en/checkpointing#rewind-and-summarize)). A shell command's changes to a file Claude hasn't edited in this session stay after a rewind, so check `git status` afterwards ([Checkpointing](https://code.claude.com/docs/en/checkpointing#external-changes-not-tracked)).## CheckYou are done when all of these are true:-- [ ] `.practice/version.txt` holds the output of `claude --version`.- [ ] `.practice/capstone-before.txt`, saved while the plan was on screen, lists no changed files.- [ ] The commit in `.practice/capstone-commit.txt` changes only files listed in `.practice/capstone-plan.txt`, including a test file.-- [ ] The bug is fixed: with the bug report's `linkcheck.json` in a folder outside your copy, `npm run linkcheck -- <that folder>` exits with code 2.+- [ ] The commit's test fails without its fix: with the other files the commit changes put back as they were before it, `npm test` fails.+- [ ] The bug is fixed: with the bug report's `linkcheck.json` in a folder outside your copy, `npm run linkcheck -- <that folder>` exits with code 2, and its error names the missing folder, `docs`.- [ ] `npm test` passes.- [ ] A committed `CLAUDE.md` names the test command, `npm test`.- [ ] `git status --porcelain` prints nothing.@@ -51,10 +53,10 @@ Run `npm run check -- b-capstone` in your practice copy. Each item that fails prThe check doesn't look at these parts of the Beginner Exit. Tick them yourself, honestly:-- [ ] I can tell which model and account a session uses, with `/status`.-- [ ] I can switch permission modes with `Shift+Tab` and say which one a task needs.-- [ ] I read the whole diff before committing and asked Claude for at least one correction.-- [ ] I can keep a session on track with `/context`, `/clear`, `/compact`, `/rewind` and `/resume`.+- [ ] I can tell which version, model and account a session uses, with `/status` ([Commands](https://code.claude.com/docs/en/commands)).+- [ ] I can say which permission mode a task needs: auto mode for work whose direction I trust, plan mode when I want to approve a plan before any change, and Manual mode when I want Claude Code to ask before most edits and commands.+- [ ] I read the whole diff, the tests included, against the bug report before committing, and asked Claude to correct anything that fell short, or found nothing to correct.+- [ ] I checked `/context` before committing, and I know when I'd use the other session commands: `/compact` to keep going on the same task in a long conversation, `/clear` to start a new task with empty context, and `/resume` to go back to an earlier conversation. If Claude's fix had gone the wrong way, I'd undo its edits with `/rewind` and check `git status` for anything a shell command changed.- [ ] I've seen a new session follow a rule from CLAUDE.md that I didn't repeat in the prompt. If you skipped lesson 5, its [Worked example](05-project-memory.md#worked-example) shows you how.When every box on this page is ticked, you're ready for the [Intermediate level](../intermediate/README.md). Its "ready if" list is the Beginner Exit.@@ -63,6 +65,6 @@ If this level helped, a star helps other developers find the guide.----<sub>Sources: [Best practices](https://code.claude.com/docs/en/best-practices) · [Interactive mode](https://code.claude.com/docs/en/interactive-mode) · [git add](https://git-scm.com/docs/git-add) · [about_Character_Encoding](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding?view=powershell-5.1) · the [Beginner lessons](README.md), which cite the official pages for each step.</sub>+<sub>Sources: [Permission modes](https://code.claude.com/docs/en/permission-modes) · [Commands](https://code.claude.com/docs/en/commands) · [Best practices](https://code.claude.com/docs/en/best-practices) · [Interactive mode](https://code.claude.com/docs/en/interactive-mode) · [Checkpointing](https://code.claude.com/docs/en/checkpointing) · [git add](https://git-scm.com/docs/git-add) · [about_Character_Encoding](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding?view=powershell-5.1) · the [Beginner lessons](README.md), which cite the official pages for each step. · [git status](https://git-scm.com/docs/git-status) · [git stash](https://git-scm.com/docs/git-stash) · [git diff](https://git-scm.com/docs/git-diff) · [git rev-parse](https://git-scm.com/docs/git-rev-parse)</sub><sub>← [Project memory with CLAUDE.md](05-project-memory.md) · [Beginner index](README.md) · [Intermediate index](../intermediate/README.md) → · [Stuck on this capstone?](https://github.com/wesammustafa/Claude-Code-Everything-You-Need-to-Know/issues/new?template=lesson-feedback.yml&lesson=b-capstone)</sub>