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: add the Beginner lesson on permission modes and plan mode (#62)
Wesam Abousaid597ab43456b3
diff --git a/docs/beginner/01-install-and-look-around.md b/docs/beginner/01-install-and-look-around.mdindex b124206..d25cab2 100644--- a/docs/beginner/01-install-and-look-around.md+++ b/docs/beginner/01-install-and-look-around.md@@ -116,4 +116,4 @@ If the first item fails, run `claude --version` on its own. If the shell says `c<sub>Sources: [Quickstart](https://code.claude.com/docs/en/quickstart) · [Advanced setup](https://code.claude.com/docs/en/setup) · [Commands](https://code.claude.com/docs/en/commands) · [Troubleshoot installation](https://code.claude.com/docs/en/troubleshoot-install) · [gitignore](https://git-scm.com/docs/gitignore)</sub>-<sub>← [Beginner index](README.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>+<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.mdnew file mode 100644index 0000000..d178e71--- /dev/null+++ b/docs/beginner/02-permission-modes-and-plan-mode.md@@ -0,0 +1,102 @@+# Choose who approves what: permission modes and plan mode++<sub>**Beginner** · Lesson 2 of 5 · about 15 minutes · Needs: [Install, sign in and look around](01-install-and-look-around.md) · Verified against Claude Code v2.1.285 (stable) on 2026-10-05</sub>++## Goal++By the end of this lesson you can pick a permission mode for a task, switch modes during a session, and use plan mode to approve a plan before Claude edits your files.++## 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, 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.+- Usage: light.++> [!NOTE]+> On native Windows, run the commands in PowerShell and use the lines marked **Windows** where they differ. If `Shift+Tab` does nothing, press `Alt+M` instead ([Interactive mode](https://code.claude.com/docs/en/interactive-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.++Four modes matter now:++| 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 |++Plan mode is the habit to build first: you see the whole change as a plan before Claude edits any of your files.++## 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.+3. Ask for the change:++ ```text+ Make 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. Then it shows a plan and asks how to proceed, with three choices: **Yes, and use auto mode** (it reads **Yes, auto-accept edits** if auto mode isn't available to you); **Yes, manually approve edits**; **No, keep planning**. Until you choose, the session stays in plan mode.+5. If the plan touches more than you asked for, such as a new test file, choose **No, keep planning** and say what to change:++ ```text+ Keep the change to src/config.js and test/config.test.js. Don't add new files.+ ```++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:++ ```bash+ git status --porcelain > .practice/b-2-before.txt+ printf '%s\n' src/config.js test/config.test.js > .practice/b-2-plan.txt+ ```++ **Windows:** `'src/config.js','test/config.test.js' | Set-Content .practice/b-2-plan.txt` replaces the `printf` line.+7. Back in Claude Code, choose **Yes, manually approve edits**. The session leaves plan mode, and Claude asks before each edit. Approve them one at a time. When Claude is done, save what git sees now, in the other terminal:++ ```bash+ git status --porcelain > .practice/b-2-after.txt+ ```++8. Set the example's change aside so Your turn starts clean. Git ignores `.practice/`, so your snapshots stay:++ ```bash+ git stash push --include-untracked -m b-2-example+ ```++## Your turn++Repeat the example in your practice copy, or your own repository, with a small change of your own:++1. Switch to plan mode with `Shift+Tab` until the status bar reads `⏸ plan mode on`.+2. Ask for the change.+3. Send the plan back once with **No, keep planning** and one correction.+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**, approve each edit, then save `git status --porcelain > .practice/b-2-after.txt`.++Stop before committing. The next lesson takes a change to a commit.++## Check++You 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.++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.++If `.practice/b-2-before.txt` lists files, check that the status bar read `⏸ plan mode on` when you sent the prompt, then look in the session for a command Claude ran that wrote a file. If a changed path is missing from `.practice/b-2-plan.txt`, compare the plan you approved with what Claude changed.++## 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.++---++<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)</sub>++<sub>← [Install, sign in and look around](01-install-and-look-around.md) · [Beginner index](README.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/README.md b/docs/beginner/README.mdindex 6f5beed..3cfcb58 100644--- a/docs/beginner/README.md+++ b/docs/beginner/README.md@@ -19,7 +19,7 @@ Before lesson 1, make your own copy of the [practice template](https://github.co## Lessons1. [Install, sign in and look around](01-install-and-look-around.md)-2. Permission modes and plan mode+2. [Permission modes and plan mode](02-permission-modes-and-plan-mode.md)3. Your first change, from request to commit4. Keep a session on track5. Project memory with CLAUDE.mddiff --git a/docs/reference/commands.md b/docs/reference/commands.mdindex e5206b0..f350e2b 100644--- a/docs/reference/commands.md+++ b/docs/reference/commands.md@@ -10,7 +10,7 @@ The built-in commands and bundled skills the lessons use, grouped by the level t- `/status`: your version, model, account and connectivity. [Install, sign in and look around](../beginner/01-install-and-look-around.md)- `/exit`: end the session. [Install, sign in and look around](../beginner/01-install-and-look-around.md)-- `/plan`: enter plan mode from the prompt, optionally with the task. *Permission modes and plan mode*+- `/plan`: enter plan mode from the prompt, optionally with the task. [Permission modes and plan mode](../beginner/02-permission-modes-and-plan-mode.md)- `/diff`: review the changes in your working tree, including Claude's edits. *Your first change, from request to commit*- `/context`: how full the context window is, as a colored grid. *Keep a session on track*- `/clear`: start a new conversation with empty context. *Keep a session on track*diff --git a/docs/reference/feature-map.md b/docs/reference/feature-map.mdindex e35d368..066ab56 100644--- a/docs/reference/feature-map.md+++ b/docs/reference/feature-map.md@@ -32,8 +32,8 @@ How to read it:| Feature | Label | Who gets it ||---|---|---|-| [Plan mode](https://code.claude.com/docs/en/permission-modes) | – | Every provider |-| [Auto mode](https://code.claude.com/docs/en/permission-modes) | – | A Claude subscription, the Console and Claude Platform on AWS; on Bedrock, Agent Platform and Foundry with newer models only. Team and Enterprise admins can turn it off |+| [Plan mode](https://code.claude.com/docs/en/permission-modes); taught in [Permission modes and plan mode](../beginner/02-permission-modes-and-plan-mode.md) | – | Every provider |+| [Auto mode](https://code.claude.com/docs/en/permission-modes); taught in [Permission modes and plan mode](../beginner/02-permission-modes-and-plan-mode.md) | – | A Claude subscription, the Console and Claude Platform on AWS; on Bedrock, Agent Platform and Foundry with newer models only. Team and Enterprise admins can turn it off || [Checkpointing and rewind](https://code.claude.com/docs/en/checkpointing) | – | Every provider || [CLAUDE.md memory](https://code.claude.com/docs/en/memory) | – | Every provider || [Sandbox](https://code.claude.com/docs/en/sandboxing) | – | Every provider |diff --git a/docs/topics/permissions-and-safety.md b/docs/topics/permissions-and-safety.mdindex 7c97a52..6104205 100644--- a/docs/topics/permissions-and-safety.md+++ b/docs/topics/permissions-and-safety.md@@ -6,7 +6,9 @@ What Claude Code may do without asking, and how to keep it away from what it sho## Lessons-This topic's lessons are linked here in level order, with its Electives, as they are published.+- Beginner: [Permission modes and plan mode](../beginner/02-permission-modes-and-plan-mode.md)++Later lessons on this topic are linked here in level order, with its Electives, as they are published.## Official docs