Codiff
Use Codiff either to review a narrative walkthrough of a code change or to hand a Markdown
plan to the user for visual editing before execution.
You write the JSON yourself because you already hold the conversation that produced the
change. Codiff owns the format and authoring guidance, so this skill only handles the handoff.
Choose The Mode
- Use plan share mode for
$codiff plan share, or when a share request is clearly about the
proposed plan in the current discussion.
- Use walkthrough share mode when the request includes
share, upload, link, URL, web,
or browser wording and is about code changes. An underspecified $codiff share defaults to a
walkthrough.
- Use plan mode for
$codiff plan or when the user explicitly asks to edit or approve a
plan in Codiff before execution.
- Use desktop mode for plain
$codiff, /codiff, "open Codiff", or "show me Codiff".
- In share mode, only pass
--open when the user explicitly asks to open the resulting share in
a browser. Otherwise return the URL without opening it.
Plan Mode
Write the complete proposed plan to a Markdown file. Use a unique temporary file outside the
repository unless the user named a canonical plan file.
Make the intended next action explicit in the document. The user should be able to edit,
remove, or reorder any part of the plan.
Open the blocking handoff:
node scripts/open-codiff.mjs --plan /tmp/codiff-plan-<id>.md
Wait for Codiff to return. status: "done" means the user clicked Done. status: "closed"
means the user closed the window after Codiff flushed the file and comments. A canceled handoff
means the app could not complete the handoff and must not be treated as approval.
Read the CODIFF_PLAN_RESULT JSON emitted when Codiff closes. Re-read the entire Markdown file
and process every thread in review.threads whose status is "open". Treat edits, additions,
removals, reordered steps, and open comments as user direction. Use quoted anchor context for
detached comments. Resolved comments are retained history and must not be processed again.
After successfully applying one or more open comments, acknowledge only the handled thread IDs
using the exact reviewPath from CODIFF_PLAN_RESULT:
node scripts/open-codiff.mjs --resolve-plan-comments "<reviewPath>" <thread-id>...
Do not resolve comments that were ambiguous, deferred, or not applied.
For status: "done", execute the edited plan when the next action is clear. For
status: "closed", continue only when documentChanged is true or unresolved comments contain
user direction; otherwise treat the close as cancellation. If the feedback is materially
ambiguous, ask one focused question before changing code.
The edited Markdown file is the feedback. Do not require comments, annotations, or a separate
approval document.
Plan Share Mode
Write the complete plan to a Markdown file, using the same authoring rules as plan mode.
Upload it without opening a blocking desktop handoff:
node scripts/open-codiff.mjs --plan /tmp/codiff-plan-<id>.md --share
Add --open only when the user explicitly asks to open the shared plan in a browser.
Return only the /p/… URL printed by the command.
Walkthrough Workflow
Get the current guidance from Codiff. It explains the data model and prints the JSON
schema:
node scripts/open-codiff.mjs --guide
Pick the change. Default to the staged diff (git diff --staged). If the user named a
target such as a commit, HEAD, a PR/MR, a range, or a path, use that. If nothing is
staged, fall back to the working tree (git diff) and say so.
Author the JSON per the guide and write it to a unique temporary file outside the
repository, such as $TMPDIR/codiff-walkthrough-<id>.json.
Complete the selected handoff.
Desktop mode:
node scripts/open-codiff.mjs --file /tmp/codiff-walkthrough-<id>.json /path/to/repository
Share mode:
node scripts/open-codiff.mjs --share --file /tmp/codiff-walkthrough-<id>.json /path/to/repository
Share and open in the default browser:
node scripts/open-codiff.mjs --share --open --file /tmp/codiff-walkthrough-<id>.json /path/to/repository
Forward an explicit target after the flags:
node scripts/open-codiff.mjs --share --file /tmp/codiff-walkthrough-<id>.json HEAD /path/to/repository
node scripts/open-codiff.mjs --share --file /tmp/codiff-walkthrough-<id>.json mr 123 /path/to/repository
The share command prints the final walkthrough URL to stdout. When the cached Cloudflare
Access token is missing or unusable, Codiff automatically opens the system browser for
authentication and resumes after sign-in. This authentication browser is independent of
--open, which only controls whether the completed walkthrough is opened.
Agent integration: The launcher passes CLAUDE_SESSION_ID to Codiff in desktop mode and
identifies shared walkthroughs as authored by Claude.
Codiff validates and repairs the document against the live diff, so anchors that drift
are pinned to a real section rather than dropped.
Emit walkthrough JSON only into the temporary file. In desktop walkthrough mode, do not
summarize the conversation back to the user. In walkthrough share mode, respond with the URL
printed by the command. In plan share mode, respond with the shared plan URL. In plan mode,
continue from the edited Markdown after the blocking handoff returns.
Source: nkzw-tech/codiff — distributed by TomeVault.
1---2name: codiff3description: Open Codiff for a narrative code walkthrough, a blocking plan handoff, or a shared walkthrough URL. Use when the user writes "$codiff", "/codiff", "$codiff plan", "$codiff share", "show me codiff", "open Codiff", or asks to review a change or edit a plan in Codiff. Use when this capability is needed.4---56# Codiff78Use Codiff either to review a **narrative walkthrough** of a code change or to hand a Markdown9plan to the user for visual editing before execution.1011You write the JSON yourself because you already hold the conversation that produced the12change. Codiff owns the format and authoring guidance, so this skill only handles the handoff.1314## Choose The Mode1516- Use **plan share mode** for `$codiff plan share`, or when a share request is clearly about the17 proposed plan in the current discussion.18- Use **walkthrough share mode** when the request includes `share`, `upload`, `link`, `URL`, `web`,19 or browser wording and is about code changes. An underspecified `$codiff share` defaults to a20 walkthrough.21- Use **plan mode** for `$codiff plan` or when the user explicitly asks to edit or approve a22 plan in Codiff before execution.23- Use **desktop mode** for plain `$codiff`, `/codiff`, "open Codiff", or "show me Codiff".24- In share mode, only pass `--open` when the user explicitly asks to open the resulting share in25 a browser. Otherwise return the URL without opening it.2627## Plan Mode28291. Write the complete proposed plan to a Markdown file. Use a unique temporary file outside the30 repository unless the user named a canonical plan file.312. Make the intended next action explicit in the document. The user should be able to edit,32 remove, or reorder any part of the plan.333. Open the blocking handoff:3435 ```bash36 node scripts/open-codiff.mjs --plan /tmp/codiff-plan-<id>.md37 ```38394. Wait for Codiff to return. `status: "done"` means the user clicked **Done**. `status: "closed"`40 means the user closed the window after Codiff flushed the file and comments. A canceled handoff41 means the app could not complete the handoff and must not be treated as approval.425. Read the `CODIFF_PLAN_RESULT` JSON emitted when Codiff closes. Re-read the entire Markdown file43 and process every thread in `review.threads` whose `status` is `"open"`. Treat edits, additions,44 removals, reordered steps, and open comments as user direction. Use quoted anchor context for45 detached comments. Resolved comments are retained history and must not be processed again.466. After successfully applying one or more open comments, acknowledge only the handled thread IDs47 using the exact `reviewPath` from `CODIFF_PLAN_RESULT`:4849 ```bash50 node scripts/open-codiff.mjs --resolve-plan-comments "<reviewPath>" <thread-id>...51 ```5253 Do not resolve comments that were ambiguous, deferred, or not applied.54557. For `status: "done"`, execute the edited plan when the next action is clear. For56 `status: "closed"`, continue only when `documentChanged` is true or unresolved comments contain57 user direction; otherwise treat the close as cancellation. If the feedback is materially58 ambiguous, ask one focused question before changing code.5960The edited Markdown file is the feedback. Do not require comments, annotations, or a separate61approval document.6263## Plan Share Mode64651. Write the complete plan to a Markdown file, using the same authoring rules as plan mode.662. Upload it without opening a blocking desktop handoff:6768 ```bash69 node scripts/open-codiff.mjs --plan /tmp/codiff-plan-<id>.md --share70 ```71723. Add `--open` only when the user explicitly asks to open the shared plan in a browser.734. Return only the `/p/…` URL printed by the command.7475## Walkthrough Workflow76771. **Get the current guidance from Codiff.** It explains the data model and prints the JSON78 schema:7980 ```bash81 node scripts/open-codiff.mjs --guide82 ```83842. **Pick the change.** Default to the staged diff (`git diff --staged`). If the user named a85 target such as a commit, `HEAD`, a PR/MR, a range, or a path, use that. If nothing is86 staged, fall back to the working tree (`git diff`) and say so.87883. **Author the JSON** per the guide and write it to a unique temporary file outside the89 repository, such as `$TMPDIR/codiff-walkthrough-<id>.json`.90914. **Complete the selected handoff.**9293 Desktop mode:9495 ```bash96 node scripts/open-codiff.mjs --file /tmp/codiff-walkthrough-<id>.json /path/to/repository97 ```9899 Share mode:100101 ```bash102 node scripts/open-codiff.mjs --share --file /tmp/codiff-walkthrough-<id>.json /path/to/repository103 ```104105 Share and open in the default browser:106107 ```bash108 node scripts/open-codiff.mjs --share --open --file /tmp/codiff-walkthrough-<id>.json /path/to/repository109 ```110111 Forward an explicit target after the flags:112113 ```bash114 node scripts/open-codiff.mjs --share --file /tmp/codiff-walkthrough-<id>.json HEAD /path/to/repository115 node scripts/open-codiff.mjs --share --file /tmp/codiff-walkthrough-<id>.json mr 123 /path/to/repository116 ```117118 The share command prints the final walkthrough URL to stdout. When the cached Cloudflare119 Access token is missing or unusable, Codiff automatically opens the system browser for120 authentication and resumes after sign-in. This authentication browser is independent of121 `--open`, which only controls whether the completed walkthrough is opened.122123 **Agent integration:** The launcher passes `CLAUDE_SESSION_ID` to Codiff in desktop mode and124 identifies shared walkthroughs as authored by Claude.125126 Codiff validates and repairs the document against the live diff, so anchors that drift127 are pinned to a real section rather than dropped.128129Emit walkthrough JSON only into the temporary file. In desktop walkthrough mode, do not130summarize the conversation back to the user. In walkthrough share mode, respond with the URL131printed by the command. In plan share mode, respond with the shared plan URL. In plan mode,132continue from the edited Markdown after the blocking handoff returns.133134---135> Source: [nkzw-tech/codiff](https://github.com/nkzw-tech/codiff) — distributed by [TomeVault](https://tomevault.io).136<!-- tomevault:4.0:skill_md:2026-06-30 -->