/code-walk:code-walkfrom code-walk
Creates guided code walkthroughs as web pages with git-referenced code snippets instead of pasted code. Useful for reviewing branches, PRs, commits, or explaining how code works.
Ships in code-walk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A walk is a Markdown file. Fenced blocks whose info string starts with show or diff are git arguments; the server renders the real code/diff. Never paste code into a walk — reference it.
CLI: code-walk (if missing: npx -y github:jeffbaumes/code-walk <command>).
code-walk outline main...HEAD — changed files, hunks (hunk=N, line ranges) and commits, printed as block lines. Copy from it; don't guess line numbers..code-walk/<short-name>.md in the repo (or a temp dir for other people's repos). Start it, right after the frontmatter, with the viewing hint (below).code-walk check .code-walk/<short-name>.md — fix every error it reports.code-walk serve .code-walk/<short-name>.md --open (run in the background). The page live-reloads on save, so later edits just need a save. Give the user the printed URL.Anyone who opens the raw .md (on GitHub, in an editor, in a diff) sees only fenced git arguments. Begin every walk, right after the frontmatter, with this blockquote so they know how to view it, using the walk's real path:
> 📖 **Code Walk** — a guided tour whose code is git references, so this file looks sparse as plain text. To view it, run `npx -y github:jeffbaumes/code-walk serve .code-walk/<short-name>.md` ([code-walk](https://github.com/jeffbaumes/code-walk)).
The viewer doesn't render this quote, and code-walk check warns if it's missing.
The info string is show/diff arguments, then an optional line selection. Refs are anything git accepts (sha, branch, tag, HEAD~2).
```show main:src/limiter.ts L20-48 ← file at a commit (L20 = one line)
```
```show :src/limiter.ts ← staged version
```
```show src/limiter.ts L5-9 ← working-tree file
```
```show a1b2c3d ← commit: message + full diff
```
```show a1b2c3d -- src/limiter.ts ← one file's changes in a commit
```
```diff main...feature -- src/router.ts ← PR-style diff (from merge base)
```
```diff main..feature -- src/router.ts R14-19 ← new-side lines 14-19
```
```diff main..feature -- src/router.ts L3-9 ← old-side lines
```
```diff main..feature -- src/router.ts L14-R19 ← old line 14 through new line 19
```
```diff main...feature -- src/router.ts hunk=2 ← 2nd hunk (numbering from outline)
```
```diff --cached -- src/x.ts ← HEAD → staged
```
```diff -- src/x.ts ← staged → working tree (git's bare diff!)
```
```diff HEAD -- src/x.ts ← HEAD → working tree (all uncommitted)
```
```mermaid
flowchart LR
a --> b
```
--stat)Add --stat to any diff or show <commit> block to render a summary instead of code: files with status, +/− counts and change bars, plus commit count and totals. Numbers come from git on every render; never type stats into prose. Use as many as helpful (whole branch, per commit, one directory).
The optional body groups files. files is a glob, a list of globs, or a map glob → note. The first matching group wins; dir/ means everything under it; unmatched files land in Ungrouped, so nothing is hidden. Each group gets a subtotal.
```diff --stat main...feature
- group: Backend
note: Token bucket and its wiring
files:
src/limiter.ts: New in-memory token bucket
src/**: Other server changes
- group: Tests
files: [test/, "**/*.test.ts"]
```
Files in a summary link to their snippets elsewhere in the walk. check warns about patterns that match nothing.
-- <path> a diff shows every changed file. Line selections need exactly one file.highlight: 29-30 (new side / file lines; L12-13 for the old side).repo: https://github.com/owner/name, or as repos: values). Code Walk clones into a cache and refs like main, feature/x and tags work; staged and working-tree blocks don't. Use this for other people's repos instead of cloning by hand.-C <name> (first is default):---
title: Rate limiting across gateway and SDK
repos:
gateway: .. # paths relative to the walk file
sdk: ../../client-sdk
---
```diff -C sdk main...feature -- src/retry.ts
```
diff --stat of the whole change, 1–3 sentences on what changed and why, then a mermaid diagram if more than a couple of components interact.highlight: for the lines that matter.The user can select lines in the page and leave comments (c). When they say something like "I left some comments", "address my review comments" or "make the changes from the walk":
code-walk comments (run in the repo). It finds the walk on its own and prints each open comment with its id, file, line range, section, the exact lines it's attached to, and the thread so far. Use --all to include resolved ones, or pass a walk path if nothing is found.
Handle each comment:
--resolve and let the user decide.Reply to each one. The page updates live.
code-walk comments reply <id> "Changed X to Y in src/router.ts" --resolve
If your changes should appear in the walk, update its references (for example, switch to diff HEAD -- <path>) and run code-walk check again.
To draft a review for the user to edit, write a walk over the change, run check, then attach each point to exact lines. The reference is a block info string ending in a range that the walk shows.
code-walk comments add --walk .code-walk/review.md "diff main...feature -- src/router.ts R14-16" "question: where does clientId come from?"
When the user replies to one of your draft comments with an instruction (for example "shorten this"), edit the comment, then add a short reply confirming the change. Don't resolve drafts the user still plans to post.
code-walk comments edit <id> --old "<exact current text>" --new "<replacement>"
Edits work like a string-replace file edit. --old must match the current text exactly once, so run code-walk comments first. If the user changed the comment since you last read it, the edit is refused and the current text is printed; re-read it and retry rather than overwriting. To rewrite the whole message, pass the whole current text as --old. --reply <reply-id> edits a reply instead; reply ids appear in the listing as ↳ [id].
Keep each comment to one point. Use labels like nit: and question:, and write them so they can be posted as-is.
Comments live next to the walk in <walk>.comments.json.
When the user wants a walk they can send or host (no server, no local repo needed to view it):
code-walk build .code-walk/<short-name>.md -o <short-name>.html
The page is one self-contained HTML file. Existing comments are shown read-only (--no-comments leaves them out); new comments need code-walk serve. A directory builds every walk in it plus an index page. The file embeds the code it references, so check with the user before publishing a walk over private code. Inlined Mermaid is several MB; add --mermaid-cdn to load it from jsDelivr (pinned, with an integrity hash) when the page goes somewhere that allows that CDN, such as a Claude Artifact.
When the user wants a walk as a Claude Artifact (a link they can open without a server, or share):
code-walk check .code-walk/<short-name>.md and fix every error. The build fails on an unresolved reference too.
Build into your scratchpad (or any temp dir) with Mermaid from the CDN:
code-walk build .code-walk/<short-name>.md -o <scratchpad>/<short-name>.html --mermaid-cdn
Publish that file with the Artifact tool: file_path = the built page, icon = code, and a one-sentence description. Publish it unchanged. The page already has its title, styles, light and dark themes, and the comment threads, so don't restyle or rewrite it.
To update it, edit the walk (or its comments), rebuild to the same path, and publish the same file_path again so the URL stays the same. From a later conversation, pass the Artifact's url instead.
Why --mermaid-cdn: without it every page with a diagram carries about 5 MB of minified Mermaid. Artifacts allow scripts from cdn.jsdelivr.net, and the flag pins the installed version with an integrity hash, so the page renders exactly as the inline build would. What's left to read before publishing is the walk itself, not a minified library.
What the Artifact shows: the walk and its comments, read-only. New comments and replies still need code-walk serve, then a rebuild and republish. The theme follows the viewer's OS setting. Artifacts start private, but the page embeds the code it references, so confirm with the user before sharing a walk over private code.
http://localhost:4747/w/<walk>#<git args, + for spaces>&<selection>
#show+a1b2c3d4e5f6:src/limiter.ts&L29-30 → git show a1b2c3d4e5f6:src/limiter.ts, lines 29–30.#diff+2b88ce2dbf1f..de7efebec33f+--+src/router.ts&L14-R19 → that diff; L = old-side line numbers, R = new-side.#diff+--cached+de7efebec33f+--+src/x.ts&R3-4 → commit vs staged; #diff+--+src/x.ts → staged vs working tree; #show+src/x.ts → working-tree file.-C+<name>+… → repo <name> from the walk's frontmatter (walk file is usually .code-walk/<walk>.md).#comment-<id> → a review comment. Run code-walk comments --all and find that id.Fastest: code-walk resolve '<url>' prints the referenced lines (selected lines marked >), with sides and the repo path.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub jeffbaumes/code-walk --plugin code-walk