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
docs: correct the Beginner lessons where a real run on Claude Code 2.1.285 differed (#115)
Wesam Abousaid2029593abc4f
diff --git a/docs/beginner/02-permission-modes-and-plan-mode.md b/docs/beginner/02-permission-modes-and-plan-mode.mdindex 8f6ad01..863f597 100644--- a/docs/beginner/02-permission-modes-and-plan-mode.md+++ b/docs/beginner/02-permission-modes-and-plan-mode.md@@ -53,7 +53,7 @@ Plan mode is the habit to build first: you see the whole change as a plan beforeKeep the change to src/config.js and test/config.test.js. Don't add new files.```- 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.+ 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):```bash@@ -107,6 +107,6 @@ If `.practice/b-2-before.txt` lists files, either the tree wasn't clean when You----<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)</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)</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 bf69bcf..558bcfc 100644--- a/docs/beginner/03-first-change.md+++ b/docs/beginner/03-first-change.md@@ -51,10 +51,10 @@ The practice app checks Markdown links, but it skips any link with a title, suchClaude 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. 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 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.- 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)).+ 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:```text@@ -111,6 +111,6 @@ If the commit changes no test file, or only tests, the code and its test didn't----<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)</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) · [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>← [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 ca11bb0..7314c80 100644--- a/docs/beginner/04-keep-a-session-on-track.md+++ b/docs/beginner/04-keep-a-session-on-track.md@@ -63,15 +63,15 @@ Compact when you want to keep going on the same task; clear when you start a difgit status --porcelain > .practice/b-4-after-rewind.txt```- This file is empty: the edit is gone.-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: after the first press, a hint at the bottom reads `Esc again to clear`. Then type `/clear`. The conversation starts over with empty context, and the old one stays available.+ 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)):```bashclaude --continue```- 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 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.## Your turn@@ -81,7 +81,7 @@ Repeat the example in your practice copy, or your own repository: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 to clear the restored prompt, then run `/clear`, then `/exit`, then `claude --continue`.+5. Press `Esc` twice quickly to clear the restored prompt, then run `/clear`, then `/exit`, then `claude --continue`.## Checkdiff --git a/docs/beginner/05-project-memory.md b/docs/beginner/05-project-memory.mdindex 22293f1..e6b9ff2 100644--- a/docs/beginner/05-project-memory.md+++ b/docs/beginner/05-project-memory.md@@ -33,7 +33,7 @@ A session reads CLAUDE.md when it starts, so after you change the file, start aClaude 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.- In the practice copy, `/init` may also describe the course's own files: `checks/`, `capstone/` and `.github/`. Delete what it says about them and about `npm run check`, 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.+ 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.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:@@ -62,7 +62,7 @@ A session reads CLAUDE.md when it starts, so after you change the file, start aAdd 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.+ 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:```bash@@ -117,6 +117,6 @@ If CLAUDE.md isn't committed, run `git add CLAUDE.md` and commit it. If a new fi----<sub>Sources: [How Claude remembers your project](https://code.claude.com/docs/en/memory) · [Commands](https://code.claude.com/docs/en/commands) · [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) · [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>← [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/capstone.md b/docs/beginner/capstone.mdindex 6d2810c..f63b192 100644--- a/docs/beginner/capstone.md+++ b/docs/beginner/capstone.md@@ -9,7 +9,7 @@ This task puts the whole Beginner level together. Unlike the lessons, it has no- 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.- 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/`, `capstone/` and `.github/`) and about `npm run check`, 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, 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`.- 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.- Usage: moderate.@@ -25,10 +25,10 @@ To try the bug by hand, make a new folder outside your practice copy and save `{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 a test. 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, the 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.-5. Review the whole diff, the test file included, as in [lesson 3](03-first-change.md#worked-example). `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.+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.Keep the session on track as you go: check `/context`, and compact or rewind when it helps.