Skip to content

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.

docs: add Advanced lesson 1, parallel sessions with worktrees (#93)

Wesam Abousaidb028bc3ffb22
diff --git a/.github/scripts/lib/stamps.mjs b/.github/scripts/lib/stamps.mjs
index 4dab1ea..12b979b 100644
--- a/.github/scripts/lib/stamps.mjs
+++ b/.github/scripts/lib/stamps.mjs
@@ -5,9 +5,7 @@ export const STAMP = /Verified against Claude Code v(\d+)\.(\d+)\.(\d+) \(stable
// Pages from before the rework that are not yet split. They carry a
// "From the previous edition, not yet re-verified" note instead of a Stamp.
-export const PRE_REWORK = [
- 'docs/reference/faq.md',
-];
+export const PRE_REWORK = [];
// Pages exempt until a pull request rewrites them.
export const AWAITING_REWRITE = [];
@@ -16,6 +14,7 @@ export const AWAITING_REWRITE = [];
export const STUBS = [
'docs/reference/changelog.md',
'docs/reference/effort-levels.md',
+ 'docs/reference/faq.md',
];
const STAMPED = /^docs\/(beginner|intermediate|advanced)\/.+\.md$|^docs\/topics\/[^/]+\.md$|^docs\/reference\/[^/]+\.md$/;
diff --git a/README.md b/README.md
index 6a2af88..c41b707 100644
--- a/README.md
+++ b/README.md
@@ -48,13 +48,13 @@ macOS, Linux and WSL. For Windows and other installers, see the [official setup
**Intermediate Electives:** [Skill patterns](docs/intermediate/electives/skill-patterns.md) · [Claude in Chrome](docs/intermediate/electives/claude-in-chrome.md) · [The status line](docs/intermediate/electives/status-line.md) · [Fast mode](docs/intermediate/electives/fast-mode.md)
-**Advanced** (being rebuilt): [Level index](docs/advanced/README.md)
+**Advanced** (being rebuilt): [Level index](docs/advanced/README.md) · [Parallel sessions with worktrees](docs/advanced/01-parallel-sessions.md)
**Topics:** [All topics](docs/topics/README.md) · [Permissions and safety](docs/topics/permissions-and-safety.md) · [Memory and context](docs/topics/memory-and-context.md) · [Models, effort and cost](docs/topics/models-effort-and-cost.md) · [Skills](docs/topics/skills.md) · [Hooks](docs/topics/hooks.md) · [Subagents and parallel work](docs/topics/subagents-and-parallel-work.md) · [MCP](docs/topics/mcp.md) · [Plugins](docs/topics/plugins.md) · [Automation](docs/topics/automation.md)
**Reference:** [Reference index](docs/reference/README.md) · [Models and effort](docs/reference/models.md) · [Commands by level](docs/reference/commands.md) · [Feature map](docs/reference/feature-map.md) · [Further learning](docs/reference/further-reading.md) · [Glossary](docs/reference/glossary.md) · [Changelog](docs/reference/changelog.md)
-**From the previous edition, not yet re-verified:** [Subagents and parallel work](docs/legacy/subagents-and-parallel-work.md) · [Agent teams](docs/agent-teams.md) · [Dynamic workflows](docs/workflows.md) · [FAQ](docs/reference/faq.md)
+**From the previous edition, not yet re-verified:** [Subagents and parallel work](docs/legacy/subagents-and-parallel-work.md) · [Agent teams](docs/agent-teams.md) · [Dynamic workflows](docs/workflows.md)
**Examples:** [How to use the examples](examples/README.md)
@@ -85,7 +85,8 @@ The previous edition's README sections moved. If a link brought you here, find i
- <a id="hooks"></a><a id="setting-up-claude-hooks"></a><a id="setting-up-hooks"></a><a id="hook-events"></a><a id="hook-input"></a><a id="hook-output"></a><a id="security-considerations"></a><a id="hook-execution-details-and-debugging"></a><a id="execution--debugging"></a>Moved to [Enforce a rule with a hook](docs/intermediate/05-hooks.md).
- <a id="ai-agents"></a>Moved to [Subagents and parallel work topic](docs/topics/subagents-and-parallel-work.md).
- <a id="2-general-purpose-subagents--when-one-claude-isnt-enough"></a><a id="3-specialized-subagents--drop-in-role-prompts"></a>Moved to [Delegate to a custom subagent](docs/intermediate/06-subagents.md). The drop-in role prompts were removed in edition v2026.10: see the [CHANGELOG](CHANGELOG.md#removed-listings).
-- <a id="running-agents-in-parallel"></a><a id="subagents--running-agents-in-parallel"></a><a id="1-git-worktrees--parallel-branches-parallel-sessions"></a><a id="orchestrating-specialists-from-the-main-session"></a>Moved to [Subagents and parallel work (previous edition)](docs/legacy/subagents-and-parallel-work.md).
+- <a id="running-agents-in-parallel"></a><a id="subagents--running-agents-in-parallel"></a><a id="orchestrating-specialists-from-the-main-session"></a>Moved to [Subagents and parallel work (previous edition)](docs/legacy/subagents-and-parallel-work.md).
+- <a id="1-git-worktrees--parallel-branches-parallel-sessions"></a>Moved to [Parallel sessions with worktrees](docs/advanced/01-parallel-sessions.md).
- <a id="agent-teams-experimental---2026"></a><a id="agent-teams-experimental"></a><a id="enable-it"></a><a id="the-example-that-justifies-the-cost"></a><a id="staff-a-team-with-the-role-prompts-you-already-have"></a><a id="three-things-that-catch-people-out"></a><a id="monitoring-and-the-naming-trap"></a><a id="best-practices"></a>Moved to [Agent teams (previous edition)](docs/agent-teams.md).
- <a id="dynamic-workflows"></a><a id="try-it-in-2-minutes--no-script-required"></a><a id="starting-your-own"></a>Moved to [Dynamic workflows (previous edition)](docs/workflows.md).
- <a id="beyond-one-terminal--the-2026-automation-surface"></a>Moved to [Feature map](docs/reference/feature-map.md).
@@ -93,7 +94,7 @@ The previous edition's README sections moved. If a link brought you here, find i
- <a id="fast-mode"></a><a id="fast-mode-"></a>Moved to [Fast mode](docs/intermediate/electives/fast-mode.md).
- <a id="beyond-your-own-skills--the-ecosystem"></a><a id="featured-mcp-servers"></a><a id="more-mcp-servers-worth-knowing"></a><a id="super-claude-framework"></a><a id="the-bmad-method--ai-agent-framework"></a>Removed in edition v2026.10: listings no lesson uses. See the [CHANGELOG](CHANGELOG.md#removed-listings).
- <a id="updates--deprecations-february-2026"></a><a id="updates--deprecations"></a><a id="updates--deprecations-as-of-july-2026"></a>Removed in edition v2026.10: the guide's summaries of Claude Code releases. See the [CHANGELOG](CHANGELOG.md#removed-changelog-mirror).
-- <a id="faq"></a>Moved to [FAQ (previous edition)](docs/reference/faq.md).
+- <a id="faq"></a>Moved to [FAQ](docs/reference/faq.md), which says where each answer went.
- <a id="references"></a>Moved to [Further learning](docs/reference/further-reading.md).
- <a id="steal-this-setup"></a><a id="5-bonus-steal-this-repos-setup"></a>Moved to [Examples](examples/README.md).
- <a id="-when-to-use-what"></a>Moved to [When to use what](docs/intermediate/README.md#when-to-use-what).
diff --git a/docs/advanced/01-parallel-sessions.md b/docs/advanced/01-parallel-sessions.md
new file mode 100644
index 0000000..36ed6c8
--- /dev/null
+++ b/docs/advanced/01-parallel-sessions.md
@@ -0,0 +1,130 @@
+# Parallel sessions with worktrees
+
+<sub>**Advanced** · Lesson 1 of 7 · about 20 minutes · Needs: [Advanced index](README.md) · Verified against Claude Code v2.1.285 (stable) on 2026-10-09</sub>
+
+## Goal
+
+By the end of this lesson you can run two Claude Code sessions at once, each in its own git worktree, and merge their work into one branch.
+
+## You need
+
+- One of your own repositories with a test command and no uncommitted changes, checked out on its default branch and up to date with a remote you can push to (Watch out says why), and your copy of the practice template with Node.js LTS and the Advanced checks ([Practice](README.md#practice)): the check runs from the copy. Set up the repository's `.practice/` folder as [Beginner lesson 1](../beginner/01-install-and-look-around.md#you-need) describes, if you haven't yet.
+- If you haven't run `claude` in that repository before, run it there once and accept the trust dialog: until then `claude --worktree` exits with an error ([Start Claude in a worktree](https://code.claude.com/docs/en/worktrees#start-claude-in-a-worktree)).
+- macOS, Linux or WSL 2, and three terminals open at the repository's root: two for the sessions, one for git.
+- Usage: moderate. Two sessions work at the same time.
+
+## The idea
+
+A [git worktree](https://git-scm.com/docs/git-worktree) is a second working folder, on its own branch, that shares the repository's history. `claude --worktree <name>` (or `-w <name>`) creates one under `.claude/worktrees/<name>/` on a new branch, `worktree-<name>`, and starts the session in it ([Start Claude in a worktree](https://code.claude.com/docs/en/worktrees#start-claude-in-a-worktree)). Each session edits its own copy of the files. Claude Code also stops a worktree session's file-editing tools from changing your main checkout, and its commands from running there or pointing git at it ([How Claude Code enforces isolation](https://code.claude.com/docs/en/worktrees#how-claude-code-enforces-isolation)).
+
+Commits and branches are shared. Uncommitted edits, installed dependencies and gitignored files such as `.env` are not: each worktree is a fresh checkout. A `.worktreeinclude` file at the repository root copies the gitignored files it lists into each new worktree ([Copy gitignored files into worktrees](https://code.claude.com/docs/en/worktrees#copy-gitignored-files-into-worktrees)); list only what the project needs, since every worktree gets its own copy of each secret.
+
+The work comes back through git: each session commits on its branch, you merge the branches from your main checkout, then remove the worktrees.
+
+## Worked example
+
+1. In your main checkout, ignore the folder the worktrees live in, then commit and push the rule. Without it, worktree contents show up as untracked files in your main checkout. The push puts it on the remote's default branch, where new worktrees start (Watch out says more):
+
+ ```bash
+ printf '\n.claude/worktrees/\n' >> .gitignore
+ git add .gitignore && git commit -m "Ignore Claude Code worktrees"
+ git push
+ ```
+
+ The leading `\n` puts the rule on a line of its own, even if your `.gitignore` doesn't end with a newline. Afterwards `git status --short` prints nothing, and `git log -1 --oneline` shows the commit.
+2. In terminal 1, start a session in a new worktree and give it a docs task:
+
+ ```bash
+ claude --worktree docs-pass
+ ```
+
+ ```text
+ Tidy the wording of the README's first section, then wait for me before you commit.
+ ```
+
+ Claude Code creates `.claude/worktrees/docs-pass/` on the branch `worktree-docs-pass`, and the session works there. Approve the edit when it asks. Asking it to wait holds the commit until step 4 even where no permission prompt would: a worktree session uses your main checkout's `.claude/settings.local.json` ([Settings files and precedence](https://code.claude.com/docs/en/settings#where-claude-code-keeps-the-local-file-in-a-git-repository)), so with the sandbox's auto-allow mode from [Intermediate lesson 4](../intermediate/04-permissions-and-sandbox.md) on there, sandboxed commands such as `git commit` run without asking ([Sandbox modes](https://code.claude.com/docs/en/sandboxing#sandbox-modes)).
+3. In terminal 2, start a second session with the short flag and give it a test task:
+
+ ```bash
+ claude -w test-pass
+ ```
+
+ ```text
+ This worktree is a fresh checkout: install the dependencies, then add one missing test for a small exported function and run the tests. Wait for me before you commit.
+ ```
+
+ Claude Code creates `.claude/worktrees/test-pass/` on the branch `worktree-test-pass`; the session installs the dependencies there before it adds the test. Approve its steps the same way.
+4. In terminal 3, in your main checkout, look at all three checkouts while both sessions wait for you:
+
+ ```bash
+ git worktree list
+ git status --short
+ git -C .claude/worktrees/docs-pass status --short
+ git -C .claude/worktrees/test-pass status --short
+ ```
+
+ `git worktree list` shows your main checkout first, then `.claude/worktrees/docs-pass` on `[worktree-docs-pass]` and `.claude/worktrees/test-pass` on `[worktree-test-pass]`; git may mark each one `locked` while its session runs. `git status --short` doesn't list either session's edits: they happen in other folders. Each `git -C` command lists only the changes of the session in that folder, such as the README in `docs-pass`, and never the other session's. Now tell each session to commit: `git log --oneline --graph --all` then shows a new commit on each branch.
+5. Still in your main checkout, merge both branches, then run your tests:
+
+ ```bash
+ git merge worktree-docs-pass
+ git merge worktree-test-pass
+ ```
+
+ [`git merge`](https://git-scm.com/docs/git-merge) brings each branch's commits into yours. The first merge just moves your branch forward (a fast-forward): `worktree-docs-pass` started from the commit you pushed in step 1, so your branch has no commits it lacks. The second makes a merge commit, because your branch now has a commit `worktree-test-pass` lacks, and opens your editor for its message: save and close it. Run this step yourself: while a session is isolated in its worktree, Claude Code blocks its git commands that reach into the main checkout. If both tasks changed the same lines, git stops with a conflict: resolve it, or start `claude` in the main checkout and ask it to.
+6. In each session, run `/exit`. The worktree's branch has a new commit, so Claude Code asks whether to keep or remove the worktree: choose remove ([Clean up worktrees](https://code.claude.com/docs/en/worktrees#clean-up-worktrees)). `git worktree list` no longer shows either worktree.
+
+> [!CAUTION]
+> Removing a worktree deletes its folder and its branch, along with any work in them you haven't merged. Merge first, or choose keep.
+
+## Your turn
+
+Pick two small changes in your repository that touch different files, such as a fix in one module and a missing test for another. Make each one in its own worktree session, with both sessions running at the same time, and bring both into your branch.
+
+If the work they should build on isn't on the remote's default branch yet (see Watch out), get it there first, or add `"worktree": {"baseRef": "head"}` to `.claude/settings.local.json`, your personal settings file from [Intermediate lesson 4](../intermediate/04-permissions-and-sandbox.md), so new worktrees start from your local `HEAD` ([`worktree.baseRef`](https://code.claude.com/docs/en/settings-reference#worktree-baseref)).
+
+Acceptance criteria:
+
+- A committed `.gitignore` ignores `.claude/worktrees/`, and doesn't ignore the rest of `.claude/`.
+- Each change is made in its own session, started with `claude --worktree <name>`, and committed on that worktree's branch.
+- `.practice/a-1-worktrees.txt` holds the output of `git worktree list --porcelain`, saved from the main checkout while both worktrees existed and both had committed:
+
+ ```bash
+ git worktree list --porcelain > .practice/a-1-worktrees.txt
+ ```
+
+- Both branches are merged into your branch with `git merge`, not [`git merge --squash`](https://git-scm.com/docs/git-merge#Documentation/git-merge.txt---squash).
+- Your tests pass after both merges (not checked).
+- Both worktrees are removed, and any branch you kept is deleted only after it's merged.
+- Optional, not checked: if your project needs a gitignored file to run, such as a local config, list it in a `.worktreeinclude` file at your repository root.
+
+## Check
+
+You are done when all of these are true:
+
+- [ ] A committed `.gitignore` ignores `.claude/worktrees/`, and not the rest of `.claude/`.
+- [ ] `.practice/a-1-worktrees.txt` lists two worktrees under `.claude/worktrees/` whose commits split from each other, and both are merged into your branch.
+- [ ] Neither of those worktrees still exists: `git worktree list` doesn't show them.
+- [ ] Self-check (not tested): while both sessions worked, neither saw the other's uncommitted edits.
+
+Run `npm run check -- a-1 --dir <your repo>` from your practice copy.
+
+If the first item fails, run `git -c core.excludesFile=/dev/null check-ignore -v .claude/worktrees/x` in your repository (the `-c` part swaps your global excludes file, [`core.excludesFile`](https://git-scm.com/docs/gitignore), for an empty one, as the check does): it should name your `.gitignore` and the line that matches ([git-check-ignore](https://git-scm.com/docs/git-check-ignore#Documentation/git-check-ignore.txt---verbose)). A rule only in `.git/info/exclude` or your global excludes file isn't committed, and a broad rule such as `.claude/` would also hide the settings and skills you commit for your team. If the second item fails, read the hint the check prints: save the file after both sessions commit and before you remove either worktree, and merge each branch with `git merge`. If the third item fails, run `git worktree remove <path>` from your main checkout on each path the check names, with `git worktree unlock <path>` first if git says it's locked. That leaves the worktree's branch: delete it once it's merged, with `git merge-base --is-ancestor worktree-<name> HEAD && git branch -D worktree-<name>`. The first command succeeds only when the branch is part of `HEAD` ([git-merge-base](https://git-scm.com/docs/git-merge-base#Documentation/git-merge-base.txt---is-ancestor)), and `-D` deletes it without git's own merged test, which checks the branch's upstream, when it has one, rather than `HEAD` ([git-branch](https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--D)).
+
+## Watch out
+
+- In most repositories on macOS, Linux and WSL 2, choosing "Yes, and don't ask again" for a Bash command in a worktree session saves the rule to your main checkout's `.claude/settings.local.json`. It then applies in the main checkout and in every worktree of the repository, and it stays after the worktree is removed ([What worktrees share with the main checkout](https://code.claude.com/docs/en/worktrees#what-worktrees-share-with-the-main-checkout)). Approve only commands you'd allow everywhere.
+- Running several sessions at once multiplies token usage ([Run agents in parallel](https://code.claude.com/docs/en/agents)). Give each session one small task, and exit it once its branch is merged.
+- A new worktree branches from the remote's default branch, not from your local `HEAD` ([Choose the base branch](https://code.claude.com/docs/en/worktrees#choose-the-base-branch)). Commits that aren't on that branch yet, such as unpushed commits or your feature branch's work, aren't in it, and merging its branch into a branch that's behind the remote's default branch brings in the commits that branch lacks. With no remote, a new worktree starts from your local `HEAD` instead.
+
+## Go further
+
+- [Isolate subagents with worktrees](https://code.claude.com/docs/en/worktrees#isolate-subagents-with-worktrees): `isolation: worktree` in a subagent's frontmatter gives each run a checkout of its own.
+- [Message your other Claude Code sessions](https://code.claude.com/docs/en/cross-session-messaging): let the sessions in your worktrees pass findings to each other.
+- [Run multiple Claude sessions](https://code.claude.com/docs/en/best-practices#run-multiple-claude-sessions): the Writer/Reviewer pattern, where a fresh session reviews what another one wrote.
+
+---
+
+<sub>Sources: [Run parallel sessions with worktrees](https://code.claude.com/docs/en/worktrees) · [All settings](https://code.claude.com/docs/en/settings-reference) · [Settings files and precedence](https://code.claude.com/docs/en/settings) · [Configure the sandboxed Bash tool](https://code.claude.com/docs/en/sandboxing) · [Run agents in parallel](https://code.claude.com/docs/en/agents) · [git-worktree](https://git-scm.com/docs/git-worktree) · [git-merge](https://git-scm.com/docs/git-merge) · [git-check-ignore](https://git-scm.com/docs/git-check-ignore) · [gitignore](https://git-scm.com/docs/gitignore) · [git-merge-base](https://git-scm.com/docs/git-merge-base) · [git-branch](https://git-scm.com/docs/git-branch)</sub>
+
+<sub>← [Advanced index](README.md) · Topic: [Subagents and parallel work](../topics/subagents-and-parallel-work.md) · [Stuck on this lesson?](https://github.com/wesammustafa/Claude-Code-Everything-You-Need-to-Know/issues/new?template=lesson-feedback.yml&lesson=a-1)</sub>
diff --git a/docs/advanced/README.md b/docs/advanced/README.md
index b61714c..2bd88f4 100644
--- a/docs/advanced/README.md
+++ b/docs/advanced/README.md
@@ -17,9 +17,17 @@ Beyond one session: parallel sessions, orchestration, unattended runs in scripts
Practice in your own repository, and run each check from your copy of the [practice template](https://github.com/wesammustafa/claude-code-practice) as `npm run check -- <lesson-id> --dir <your repo>`. The GitHub Actions lesson and the capstone are the exceptions: they run in a separate template copy, which you tear down afterwards so no live credential is left behind.
+A copy you made for an earlier level may not have the Advanced checks: `npm run check` then lists no `a-` lessons. Bring them in from the template, in your copy:
+
+```bash
+git fetch https://github.com/wesammustafa/claude-code-practice main
+git checkout FETCH_HEAD -- checks capstone
+git commit -m "Add the Advanced checks"
+```
+
## Lessons
-1. Parallel sessions with worktrees
+1. [Parallel sessions with worktrees](01-parallel-sessions.md)
2. Choose an orchestration pattern
3. Run and save a dynamic workflow
4. Script Claude Code with `claude -p`
diff --git a/docs/legacy/subagents-and-parallel-work.md b/docs/legacy/subagents-and-parallel-work.md
index f0a48b1..acf9dee 100644
--- a/docs/legacy/subagents-and-parallel-work.md
+++ b/docs/legacy/subagents-and-parallel-work.md
@@ -17,29 +17,13 @@ Claude Code has **four** ways to run agents at once. They're easy to confuse, so
Two supporting tools that aren't a coordination style of their own:
-- **[Git worktrees](#1-git-worktrees--parallel-branches-parallel-sessions)**: separate checkouts so parallel sessions never touch the same files.
+- **[Git worktrees](../advanced/01-parallel-sessions.md)**: separate checkouts, so parallel sessions each edit their own copy of the files.
- **`/batch`**: a bundled skill that researches the codebase, splits one large change into **5–30 independent units**, and spawns a background subagent per unit **in its own worktree, each opening a PR**. It's a packaged use of subagents + worktrees, and the fastest way to feel this whole category.
> [!TIP]
> **Checking on running work** depends on what you started: `/tasks` for anything backgrounded in the current session, `claude agents` for background sessions, `/workflows` for workflow runs. Note `/agents` (removed as a wizard in v2.1.198) is a different thing entirely from `claude agents`.
-<a id="1-git-worktrees--parallel-branches-parallel-sessions"></a>
-## 1. Git worktrees: parallel branches, parallel sessions
-
-[Git worktrees](https://git-scm.com/docs/git-worktree) let one repo have multiple branches checked out at the same time, each in its own folder. Pair them with one Claude Code session per worktree to run independent streams of work.
-
-```bash
-git worktree add -b feature-a ../feature-a # create the worktree
-cd ../feature-a && claude # start Claude in it
-# Repeat in another terminal for feature-b. Each session is independent.
-git worktree remove ../feature-a # clean up when done
-```
-
-> [!TIP]
-> Use [tmux](https://github.com/tmux/tmux/wiki/Installing) to keep each worktree's session attached even when you close the terminal.
->
-> [!TIP]
-> Prefer not to manage them by hand? `claude agents` (agent view) puts **each dispatched session in its own worktree automatically**, and `/batch` does the same per unit of work.
+Worktrees now have their own lesson: [Parallel sessions with worktrees](../advanced/01-parallel-sessions.md).
Subagents now have their own lesson: [Delegate to a custom subagent](../intermediate/06-subagents.md).
diff --git a/docs/reference/commands.md b/docs/reference/commands.md
index 104b6ed..557d173 100644
--- a/docs/reference/commands.md
+++ b/docs/reference/commands.md
@@ -3,7 +3,7 @@
<sub>Verified against Claude Code v2.1.285 (stable) on 2026-10-05</sub>
-The built-in commands and bundled skills the lessons use, grouped by the level that teaches them. It is not the full list: the official [commands reference](https://code.claude.com/docs/en/commands#all-commands) has every command and its options, and typing `/` in a session shows the commands available to you. Each lesson name below becomes a link when the lesson is published.
+The built-in commands, bundled skills and `claude` command-line forms the lessons use, grouped by the level that teaches them. It is not the full list: the official [commands reference](https://code.claude.com/docs/en/commands#all-commands) has every command and its options, the [CLI reference](https://code.claude.com/docs/en/cli-reference#cli-flags) has the command-line flags, and typing `/` in a session shows the commands available to you. Each lesson name below becomes a link when the lesson is published.
<a id="common-built-in-slash-commands"></a>
## Beginner
@@ -39,6 +39,7 @@ Electives: `/statusline` ([The status line](../intermediate/electives/status-lin
## Advanced
+- `claude --worktree <name>` (`-w`): start a session in an isolated git worktree at `.claude/worktrees/<name>` ([CLI reference](https://code.claude.com/docs/en/cli-reference#cli-flags)). [Parallel sessions with worktrees](../advanced/01-parallel-sessions.md)
- `/workflows`: watch, pause, resume and save dynamic workflows. *Run and save a dynamic workflow*
- `/install-github-app`: install the Claude GitHub App for a repository, with optional workflow and secret setup. *GitHub Actions*
- `/usage`: the session's cost, your plan's usage limits and activity stats. *Put bounds on autonomous runs*
@@ -57,6 +58,6 @@ A command you write yourself is a skill: a `SKILL.md` file in `.claude/skills/<n
---
-<sub>Sources: [Commands](https://code.claude.com/docs/en/commands) · [Checkpointing](https://code.claude.com/docs/en/checkpointing) · [Manage sessions](https://code.claude.com/docs/en/sessions) · [Extend Claude with skills](https://code.claude.com/docs/en/skills) · [Interactive mode](https://code.claude.com/docs/en/interactive-mode) · [Claude Code cheatsheet](https://support.claude.com/en/articles/14553413-claude-code-cheatsheet)</sub>
+<sub>Sources: [Commands](https://code.claude.com/docs/en/commands) · [CLI reference](https://code.claude.com/docs/en/cli-reference) · [Checkpointing](https://code.claude.com/docs/en/checkpointing) · [Manage sessions](https://code.claude.com/docs/en/sessions) · [Extend Claude with skills](https://code.claude.com/docs/en/skills) · [Interactive mode](https://code.claude.com/docs/en/interactive-mode) · [Claude Code cheatsheet](https://support.claude.com/en/articles/14553413-claude-code-cheatsheet)</sub>
<sub>Up: [Reference](README.md)</sub>
diff --git a/docs/reference/faq.md b/docs/reference/faq.md
index ee4d151..fb05d07 100644
--- a/docs/reference/faq.md
+++ b/docs/reference/faq.md
@@ -1,194 +1,18 @@
-# FAQ — Claude Code & Claude Plans
+<a id="faq--claude-code--claude-plans"></a>
+# FAQ
-> [!NOTE]
-> From the previous edition, not yet re-verified. The guide is being rebuilt as lessons; this page keeps the earlier material reachable until they land.
+This page moved. Below, each group of its questions links to the page that now answers it. Anthropic's own Claude Code user FAQ is listed in [Further learning](further-reading.md#start-anywhere).
-*[← Back to README](../../README.md#faq)*
+<a id="models"></a><a id="q-what-claude-models-are-available-in-2026"></a><a id="q-can-i-use-the-1m-context-window"></a>The models you can pick and their aliases, including the one with a longer context window: [Aliases](models.md#aliases) on Models and effort.
-A consolidated FAQ covering models, pricing, tokens, plans, Fast Mode, worktrees, and Pro-plan optimization. For Skills-specific questions, see [`docs/skills.md` → Skills FAQ](../skills.md#skills-faq).
+<a id="reasoning-effort"></a><a id="q-how-many-reasoning-effort-levels-are-there-and-whats-my-default"></a><a id="q-does-ultrathink-actually-raise-effort"></a><a id="q-why-cant-i-persist-max-or-ultracode-in-settingsjson"></a>Choosing an effort level for a task: [Pick the model and effort](../intermediate/03-model-and-effort.md). The levels, with a link to the level each model starts at: [Effort levels](models.md#effort-levels). What `ultrathink` does, how long `max` lasts, and why Ultracode isn't a level: the [Gotchas](models.md#gotchas) on Models and effort.
----
+<a id="skills--commands"></a><a id="q-whats-the-difference-between-custom-slash-commands-and-skills"></a>Custom commands and skills: [Turn a repeated workflow into a skill](../intermediate/01-first-skill.md).
-## Models
+<a id="tokens--limits"></a><a id="q-how-many-messages-do-i-get-on-the-pro-plan"></a><a id="q-how-are-tokens-counted"></a><a id="q-how-much-code-can-i-work-on-per-5-hour-window"></a><a id="pricing--plans"></a><a id="q-what-are-the-claude-subscription-plans"></a><a id="q-api-pricing-pay-as-you-go"></a><a id="q-pro-vs-max-5x-vs-max-20x"></a>Plans, prices and usage limits: the guide carries none. See [claude.com/pricing](https://claude.com/pricing) for the plans, [Use Claude Code with your Pro or Max plan](https://support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-or-max-plan) for how usage limits apply to Claude Code, and the [API pricing page](https://platform.claude.com/docs/en/about-claude/pricing) for pay-as-you-go prices. [Manage costs effectively](https://code.claude.com/docs/en/costs) shows how to track and reduce your token use.
-### Q: What Claude models are available in 2026?
+<a id="fast-mode"></a><a id="q-what-is-fast-mode-and-when-should-i-use-it"></a>Fast mode and when it's worth its cost: the [Fast mode](../intermediate/electives/fast-mode.md) Elective.
-As of October 4, 2026: **Sonnet 5.5**, **Opus 5.5** ([default](https://code.claude.com/docs/en/model-config#default-model-setting) since Claude Code v2.1.280), **Fable 5.1** (Mythos class), and **Haiku 4.5**, with Fable 5, Opus 5, Opus 4.8/4.7/4.6/4.5, and Sonnet 5/4.6 available as legacy models. Full specs, model IDs, and pricing live in one place, [Models](models.md), so this FAQ doesn't duplicate them.
+<a id="sessions-terminals--worktrees"></a><a id="q-what-happens-when-i-run-multiple-claude-code-sessions-in-different-terminals"></a><a id="q-how-do-git-worktrees-affect-claude-code-sessions"></a><a id="q-how-do-i-get-fully-separate-claude-code-contexts"></a>Several sessions at once, each in a git worktree of its own: [Parallel sessions with worktrees](../advanced/01-parallel-sessions.md).
-**Key features:**
-
-- **Adaptive thinking** — current models scale reasoning depth automatically; on Fable 5 it can't be disabled.
-- **1M context window** — standard on Sonnet 5, Opus 4.8, and Fable 5 (no beta flag, no long-context surcharge).
-- **Fast Mode**: up to 2.5× faster output at 2× pricing, on Opus 5.5 (the default), Opus 5, and Opus 4.8. Toggle with `/fast`.
-
-> Anthropic ships new models often. Check the [official model overview](https://platform.claude.com/docs/en/about-claude/models/overview) for the current list.
-
-### Q: Can I use the 1M context window?
-
-Yes. 1M-token context is **standard** on Sonnet 5, Opus 4.8, and Fable 5 — in Claude Code and via the API — and the full window bills at standard per-token pricing.
-
-**Best for:** analyzing entire large codebases at once, processing extensive documentation, complex multi-file refactoring.
-
----
-
-## Reasoning effort
-
-### Q: How many reasoning effort levels are there, and what's my default?
-
-The API knows **five** (`low / medium / high / xhigh / max`, default `high`, except `medium` on Opus 5.5); Claude Code adds **`ultracode`**, a separate toggle (not an effort level) that turns on automatic multi-agent workflow orchestration at the session's effort level (v2.1.284+). `max` is session-only; `ultracode` can be saved with its own [`ultracode` setting](https://code.claude.com/docs/en/settings-reference#ultracode).
-
-Current Claude Code defaults (as of October 4, 2026): Opus 5.5 and Sonnet 5.5 → `medium`; Opus 4.7 → `xhigh`; every other model that supports effort → `high`. On the API, Sonnet 5.5 defaults to `high`. Run `/effort` to see and change yours. Full breakdown: [Effort levels](effort-levels.md).
-
-### Q: Does `ultrathink` actually raise effort?
-
-It adds an in-context "think harder" instruction but **does not change the API effort level**. If you're already on `xhigh` or `max`, the keyword is essentially redundant. For a deliberately deeper turn, set `/effort max`, prompt, then `/effort auto` to reset.
-
-### Q: Why can't I persist `max` or `ultracode` in `settings.json`?
-
-Only `max` is session-only: `"effortLevel"` in `settings.json` accepts `low` / `medium` / `high` / `xhigh`, so set `max` per session with `/effort`. `ultracode` isn't an effort level, and you can save it with its own [`ultracode` setting](https://code.claude.com/docs/en/settings-reference#ultracode).
-
----
-
-## Skills & commands
-
-### Q: What's the difference between custom slash commands and skills?
-
-They're officially one system now — `.claude/commands/deploy.md` and `.claude/skills/deploy/SKILL.md` both create `/deploy`. See [`docs/skills.md` → Skills FAQ](../skills.md#skills-faq) for security best practices, team sharing, and troubleshooting.
-
----
-
-## Tokens & limits
-
-### Q: How many messages do I get on the Pro plan?
-
-Anthropic no longer publishes exact message counts. Third-party estimates put Pro at roughly **~45 messages per 5-hour rolling window** — and Claude Code's five-hour rate limits were **doubled on May 6, 2026** for Pro/Max/Team, with peak-hours limit reductions removed ([announcement](https://www.anthropic.com/news/higher-limits-spacex)). Limits reset every 5 hours; Sonnet 5.5, Opus 5.5, and Haiku 4.5 (plus legacy Opus and Sonnet models) are included. Depending on your plan and seat tier, [Fable usage can bill to usage credits](https://code.claude.com/docs/en/model-config#fable-and-usage-credits) instead of your plan's included limits.
-
-### Q: How are tokens counted?
-
-Everything in your interaction counts: your prompts, Claude's responses, system instructions, tool definitions, and any file content Claude reads.
-
-| Input | Token cost |
-|---|---|
-| English text | ~1 token per 0.75 words (1,000 tokens ≈ 750 words) |
-| Punctuation / code symbols | Each counts as ~1 token |
-| Images | `(width_px × height_px) / 750` tokens |
-| File reads | Each line counts; `CLAUDE.md` adds context every session |
-
-> 💡 Use the [Claude tokenizer](https://claude-tokenizer.vercel.app/) for an exact count, or `/usage` inside Claude Code to track live usage. Note: Fable 5 and Opus 4.7+ use a tokenizer that produces ~30% more tokens for the same text than older models.
-
-### Q: How much code can I work on per 5-hour window?
-
-Enough for a focused feature session on a small-to-mid project. Tokens are shared across reading existing code, Claude's analysis, your back-and-forth, and the file edits themselves — so treat any lines-per-window number as an order-of-magnitude guess, not a budget.
-
----
-
-## Pricing & plans
-
-### Q: What are the Claude subscription plans?
-
-As of October 4, 2026 (verify on [claude.com/pricing](https://claude.com/pricing) before committing):
-
-| Plan | Price | Models | Usage limit | Claude Code |
-|---|---|---|---|---|
-| **Free** | $0 | Limited | Base | Not included |
-| **Pro** | $20/mo ($17/mo annual) | All | ~5-hour rolling window | Full |
-| **Max 5x** | from $100/mo | All | 5× Pro | Full |
-| **Max 20x** | $200/mo | All | 20× Pro | Full |
-
-- **Unified subscription** — one subscription covers both web (claude.ai) and CLI (Claude Code).
-- **All models** means the current lineup (Sonnet 5.5, Opus 5.5, Haiku 4.5) plus legacy Opus and Sonnet models; for Fable, [claude.com/pricing](https://claude.com/pricing) lists "Usage credits" on Pro and "50% of weekly limits" on Max 5x and Max 20x.
-
-### Q: API pricing (pay-as-you-go)?
-
-See the [Models page](models.md#pricing) for the full table. Headline rates: Sonnet 5.5 $2/$10, Opus 5.5 $4/$20, Fable 5.1 $10/$50, Haiku 4.5 $1/$5. Legacy Sonnet 5 also stays at $2/$10: its introductory price became the standard price on August 10, 2026, so the increase to $3/$15 planned for September 1, 2026 did not happen.
-
-### Q: Pro vs. Max 5x vs. Max 20x?
-
-Same models, more capacity — Max 5x is ~5× Pro's usage, Max 20x is ~20×.
-
-**Upgrade if:** you frequently hit Pro limits, run multiple parallel sessions or agent teams, or need guaranteed availability during peak hours.
-
----
-
-## Fast Mode
-
-### Q: What is Fast Mode and when should I use it?
-
-Fast Mode (research preview) delivers up to **2.5× faster output** at **2× pricing**, running on **Opus 5.5** (the default fast-mode model since Claude Code v2.1.280; [fast mode docs](https://code.claude.com/docs/en/fast-mode)). Opus 5 and Opus 4.8 also support it, at $10/$50 per MTok.
-
-- Toggle with `/fast` in the CLI, the **Toggle fast mode** command in the VS Code extension, or the model menu at claude.ai/code. The **↯** indicator confirms it's on.
-- On subscription plans, fast mode draws from usage credits rather than plan limits.
-
-| | Standard Opus 5.5 | Fast Mode |
-|---|---|---|
-| Input (per MTok) | $4 | $8 |
-| Output (per MTok) | $20 | $40 |
-
-> ⚠️ Fast mode on Opus 4.7 was deprecated on June 25, 2026 and **removed on July 24, 2026** (Claude Code v2.1.219); Opus 4.6 doesn't support fast mode (its fast requests run at standard speed).
-
-**Use it for:** rapid iteration, live debugging, time-sensitive deployments, demo prep.
-**Skip it for:** long background tasks and exploratory work — speed doesn't help work you're not watching.
-
----
-
-## Sessions, terminals & worktrees
-
-### Q: What happens when I run multiple Claude Code sessions in different terminals?
-
-**Usage limits are shared.** All Claude Code sessions on your account draw from the same 5-hour budget — running 3 parallel sessions exhausts it ~3× faster.
-
-**Conversation context is independent.** Each terminal has its own history; Claude in tab 1 doesn't know what happened in tab 2. Each session analyzes the codebase independently.
-
-### Q: How do Git worktrees affect Claude Code sessions?
-
-Worktrees create a hybrid:
-
-- **Separate working directories** — each worktree shows different file contents. Edits in feature-A don't appear in feature-B.
-- **Shared `.git`** — git history, branches, and commit logs are visible across all worktrees. Claude can see commits from other features (but not their working changes).
-
-```bash
-# Terminal 1: feature/auth
-git commit -m "Add auth middleware"
-
-# Terminal 2: feature/payment
-cat middleware.js # Won't show auth changes
-git log --oneline --all # WILL show the auth commit
-```
-
-### Q: How do I get fully separate Claude Code contexts?
-
-Use **separate clones** instead of worktrees:
-
-```bash
-~/project-auth/ # Complete separate clone
-~/project-payment/ # Complete separate clone
-```
-
-Each clone has its own `.git`, no shared state, fully isolated views.
-
----
-
-## Optimization
-
-### Q: How do I maximize my Pro usage?
-
-**Session management:**
-
-- `/compact` to reduce context in long sessions.
-- Close unused sessions to avoid accidental token consumption.
-- Start fresh contexts when switching task types.
-
-**Token efficiency:**
-
-- Batch related work — let one session deliver a feature, don't re-explain context across sessions.
-- Use `/model` strategically: Haiku for simple tasks, Sonnet 5 for everyday, Opus 4.8 when reasoning depth matters.
-- Be specific in prompts to avoid back-and-forth.
-
-**Project structure:**
-
-- Keep `CLAUDE.md` concise — it loads every session.
-- Point Claude at specific files rather than letting it scan the whole repo.
-
----
-
-[← Back to README](../../README.md#faq) · [Skills FAQ](../skills.md#skills-faq) · [Changelog](changelog.md)
+<a id="optimization"></a><a id="q-how-do-i-maximize-my-pro-usage"></a>Making your usage go further by keeping a session's context small: [Keep a session on track](../beginner/04-keep-a-session-on-track.md).
diff --git a/docs/reference/feature-map.md b/docs/reference/feature-map.md
index a598521..6b42016 100644
--- a/docs/reference/feature-map.md
+++ b/docs/reference/feature-map.md
@@ -62,7 +62,7 @@ How to read it:
| Feature | Label | Who gets it |
|---|---|---|
-| [Worktrees](https://code.claude.com/docs/en/worktrees) | – | Every provider |
+| [Worktrees](https://code.claude.com/docs/en/worktrees); taught in [Parallel sessions with worktrees](../advanced/01-parallel-sessions.md) | – | Every provider |
| [Dynamic workflows](https://code.claude.com/docs/en/workflows) | – | Every provider; on Pro, turn them on in `/config` |
| [Agent view](https://code.claude.com/docs/en/agent-view) | "Agent view is in research preview." | Every provider |
| [Agent teams](https://code.claude.com/docs/en/agent-teams) | "Agent teams are experimental and disabled by default." | Every provider |
diff --git a/docs/topics/subagents-and-parallel-work.md b/docs/topics/subagents-and-parallel-work.md
index 754f28a..203ccde 100644
--- a/docs/topics/subagents-and-parallel-work.md
+++ b/docs/topics/subagents-and-parallel-work.md
@@ -7,6 +7,7 @@ Ways to split work across contexts and sessions: subagents, worktrees, dynamic w
## Lessons
- Intermediate: [Delegate to a custom subagent](../intermediate/06-subagents.md)
+- Advanced: [Parallel sessions with worktrees](../advanced/01-parallel-sessions.md)
More of this topic's lessons and Electives are linked here as they are published.