Wiki Handoff
Overview
Bidirectional ritual for the project wiki:
- Persist what was learned, decided, built, or deferred so a future session
can pick up cold.
- Bridge mid-session checkpoints to
/compact so the active window stays
healthy without losing facts.
The wiki schema is project-specific. Always discover and read the schema
file first — it overrides every default in this skill.
Modes
| Mode |
When |
What it does |
handoff (default) |
"handoff", "wrap this up", "capture this", "ingest this session", end of a substantive session |
Full session digest: write/extend pages, update index, append log entry, then commit + push if git is on |
snapshot |
"snapshot", "save and continue", "checkpoint to wiki" — invoked mid-session |
Minimal write of new facts since session start, plus a recommended /compact <instruction> string that names what's now safely persisted and what to drop from the active window |
Choose based on what the user said and on whether the session is ending or
continuing.
Don't Use When
- Trivial sessions (one-line bugfix, formatting). The git log is enough.
- Information is already obvious from
git log / git blame / the code
itself. The wiki is for non-derivable knowledge.
Pre-flight (always, both modes)
Run before any writes:
- Locate the schema. See Schema Discovery. If none
found → Initialize Wiki.
- Detect git.
git rev-parse --is-inside-work-tree 2>/dev/null.
If false, set git=off — the workflow still writes files but skips
commit / push / status steps. Tell the user once at the end.
- Read existing pages you plan to touch. Extend, never overwrite. If
new info contradicts old, flag it inline.
- Use the absolute YYYY-MM-DD from the system context. Never write
"today" or "yesterday".
Schema Discovery
Search this order; first hit wins:
wiki/CLAUDE.md
wiki/SCHEMA.md
./CLAUDE.md — only if it contains the LLM Wiki pattern (mentions
index.md, log.md, raw/wiki/schema layers, or "LLM Wiki")
./WIKI.md
If the schema specifies a directory layout, frontmatter shape, link
convention, or topic scope, defer to it over the defaults in this
skill. In particular:
- Link style — schema picks
[[wikilinks]] vs [text](path.md). Don't
override.
- Subdirectories — if existing
wiki/ is flat, write flat. Don't
mkdir entities/concepts/sources/comparisons/ unless schema says so.
- Page types — use the schema's taxonomy; the default table below is
fallback only.
Initialize Wiki (first-time setup)
Trigger: schema discovery returned nothing and wiki/ is either
absent or contains no markdown files.
If wiki/ has files but no schema, do not bootstrap a parallel
layout. Instead, infer the existing shape (flat vs categorized, link
style, frontmatter) and write a schema file that matches before
proceeding.
Steps:
- Locate the bundled seed. It lives at
seeds/llm-wiki.md next to
this SKILL.md. If you don't know the SKILL.md path, try in order:
~/.agents/skills/wiki-handoff/seeds/llm-wiki.md,
~/Developments/wiki-handoff/seeds/llm-wiki.md. Last resort: find ~ -path '*wiki-handoff/seeds/llm-wiki.md' 2>/dev/null | head -1.
Do not fetch from the internet — the seed is bundled to be offline-safe.
- Copy it to
wiki/CLAUDE.md.
- Ask the user one question before scaffolding directories:
Flat layout (wiki/<topic>.md) or categorized
(wiki/{entities,concepts,sources,comparisons}/)? Default: flat.
- Create empty
wiki/index.md with # Index heading and one section
per category (matching the chosen layout).
- Create empty
wiki/log.md with # Log heading.
- Create empty
raw/sources/ for source pointers.
- If git is on, commit as a separate scope:
wiki: initialize from llm-wiki seed.
- Tell the user the wiki was initialized from the seed and point them at
wiki/CLAUDE.md to adjust the schema before the next handoff. Then
proceed with the requested mode.
What to Capture — the Non-derivable Gate
Before writing each page or paragraph, answer this:
Could a future session derive this from git log, the code,
CLAUDE.md, or an existing wiki page?
- Yes → skip. Write nothing.
- No → write it.
This gate is the wiki's only defense against bloat. Apply it strictly.
| Capture |
Skip |
| Decisions and the reasons behind them |
Function signatures, file structure |
| Approaches that were tried and failed, and why |
Code patterns (the code shows them) |
| Platform gotchas and workarounds |
Anything in CLAUDE.md already |
| Capture-surface rankings, comparison tables |
Re-narration of git log |
| Relationships between components |
Step-by-step what-I-did blow-by-blow |
| Deferred work + the actual blocker |
"We decided to use X" without the why |
Workflow — handoff
- Pre-flight.
- Inventory the session. From the conversation, list:
- New things introduced → entity pages
- Concepts/techniques that recur → concept pages (non-trivial only)
- External sources cited → source pages (only if a
raw/ doc exists)
- Existing pages that need an update
Apply the non-derivable gate to every item before writing.
- Write the pages. Follow the schema's frontmatter and link style.
Be terse — a 5-line page is fine.
- Update the index. One line per new page in the right category.
- Append to the log. Format:
## [YYYY-MM-DD] <op> | <short title>
followed by 1–3 lines.
- Git on → commit per scope (
wiki: <subject>), push, verify
git status clean.
Git off → tell the user the files are written but not versioned;
suggest git init if they want handoff durability across machines.
Workflow — snapshot
The point of snapshot is to make /compact safe: persist the
load-bearing facts to wiki before compacting, so the compactor doesn't
need to recall them.
- Pre-flight.
- Diff the session. What's new since this conversation started
that isn't already in the wiki? Apply the non-derivable gate.
- Write only the deltas. Skip the full index overhaul that
handoff
does — just write the new/extended pages and append one log line:
## [YYYY-MM-DD] snapshot | <subject>.
- Produce the recommended
/compact string and show it verbatim:/compact focus on <current task>. The following are now persisted in the wiki — drop from active window:
- <wiki/page-1.md> — <what it covers>
- <wiki/page-2.md> — <what it covers>
Keep in window: <current diff / test failures / in-progress artifact>.
- Don't push in snapshot mode unless the user asks. Optional commit
is fine; default is no commit, just files on disk.
Frontmatter (default — verify against schema)
---
title: <page title>
type: entity | concept | source | comparison | overview | note
created: YYYY-MM-DD
updated: YYYY-MM-DD
sources: [list of raw/ filenames cited, or []]
tags: [optional]
---
Page Type Quick Reference (default — verify against schema)
| Path |
Use when |
Body shape |
wiki/entities/<name>.md |
A concrete thing exists in the project |
What it is, layout, surface area, cross-refs, open follow-ups |
wiki/concepts/<name>.md |
A non-trivial idea/technique that recurs |
Definition, when to apply, gotchas |
wiki/sources/<slug>.md |
Summarizing a raw/ document |
One-paragraph summary + key points + link to raw |
wiki/comparisons/<name>.md |
Comparing two or more approaches |
Tradeoff table, recommendation |
If the project uses a flat wiki/<topic>.md layout, ignore the path
column and write flat.
Pre-push Sanity (git only)
Before git push, in this order:
git status — only the files you intended.
git log --oneline -5 — commit messages match project style.
git diff origin/<branch>..HEAD — review what's about to land.
If a commit message reads "what I did" instead of "what changed and
why", reword before pushing.
Common Mistakes
- Skipping schema discovery. Always run it first; defer to whatever
it returns over this skill's defaults.
- Bootstrapping a parallel layout. If
wiki/ already has files but
no schema file, do not mkdir new subdirs — read the existing
layout and write a schema file that matches it.
- Overwriting existing pages. Read them first; extend.
- Padding with code or file structure. That's already in the code
and
git log. The wiki captures why and what surprised us.
- Forgetting the
log.md entry. Without it, the operation is
invisible to a grep "^## \[" audit.
- Forgetting the index. New pages must be discoverable from the
catalog, not just by file scan.
- Relative dates. "Today" / "yesterday" / "Thursday" rot. Always
write the absolute YYYY-MM-DD.
- Committing but not pushing in
handoff. A handoff that lives only
on your machine is not a handoff.
- Pushing in
snapshot without asking. Snapshot is mid-session; the
user may not want a remote commit yet.
- Single mega-commit. Match the project's split style — one commit
per scope (e.g. one for code, one for
wiki:).
- Skipping the non-derivable gate. The wiki bloats fast if every
session writes a play-by-play. Be ruthless.
Red Flags — Stop and Fix
- About to write without locating the schema → run Schema Discovery first.
- About to bootstrap when
wiki/ already has content → infer the
existing layout instead and write a matching schema.
- About to write
## [today] or ## [yesterday] → use the absolute
YYYY-MM-DD.
- Page has no inbound links from
index.md → orphan; add the index entry.
- Commit message is
update wiki → too vague; name the page or topic.
git push fails for auth → don't --force; ask the user.
- In
snapshot mode but the recommended /compact string is missing →
that bridge is the whole point of snapshot; produce it.
- Bootstrap step about to fetch from a URL → wrong; the seed is bundled
at
seeds/llm-wiki.md.
1---2name: wiki-handoff3description: Capture or checkpoint a Claude session into a project wiki. Use when the user says "handoff", "wrap up", "snapshot", "save and continue", "capture this for next session", "write this to the wiki", or at meaningful checkpoints in a substantive session. Two modes — handoff (end-of-session writeup; commits and pushes if git is on) and snapshot (mid-session checkpoint that writes deltas and bridges to /compact). Discovers schema across wiki/CLAUDE.md, wiki/SCHEMA.md, ./CLAUDE.md, and ./WIKI.md; bootstraps from a bundled seed if none found. Git operations are optional — detected at runtime, skipped on non-repos.4---56# Wiki Handoff78## Overview910Bidirectional ritual for the project wiki:1112- Persist what was learned, decided, built, or deferred so a future session13 can pick up cold.14- Bridge mid-session checkpoints to `/compact` so the active window stays15 healthy without losing facts.1617The wiki schema is project-specific. **Always discover and read the schema18file first** — it overrides every default in this skill.1920## Modes2122| Mode | When | What it does |23|---|---|---|24| `handoff` *(default)* | "handoff", "wrap this up", "capture this", "ingest this session", end of a substantive session | Full session digest: write/extend pages, update index, append log entry, then commit + push if git is on |25| `snapshot` | "snapshot", "save and continue", "checkpoint to wiki" — invoked mid-session | Minimal write of *new* facts since session start, plus a recommended `/compact <instruction>` string that names what's now safely persisted and what to drop from the active window |2627Choose based on what the user said and on whether the session is ending or28continuing.2930## Don't Use When3132- Trivial sessions (one-line bugfix, formatting). The git log is enough.33- Information is already obvious from `git log` / `git blame` / the code34 itself. The wiki is for *non-derivable* knowledge.3536## Pre-flight (always, both modes)3738Run before any writes:39401. **Locate the schema.** See [Schema Discovery](#schema-discovery). If none41 found → [Initialize Wiki](#initialize-wiki-first-time-setup).422. **Detect git.** `git rev-parse --is-inside-work-tree 2>/dev/null`.43 If false, set git=off — the workflow still writes files but skips44 commit / push / status steps. Tell the user once at the end.453. **Read existing pages you plan to touch.** Extend, never overwrite. If46 new info contradicts old, flag it inline.474. **Use the absolute YYYY-MM-DD** from the system context. Never write48 "today" or "yesterday".4950## Schema Discovery5152Search this order; first hit wins:53541. `wiki/CLAUDE.md`552. `wiki/SCHEMA.md`563. `./CLAUDE.md` — *only if* it contains the LLM Wiki pattern (mentions57 `index.md`, `log.md`, raw/wiki/schema layers, or "LLM Wiki")584. `./WIKI.md`5960If the schema specifies a directory layout, frontmatter shape, link61convention, or topic scope, **defer to it** over the defaults in this62skill. In particular:6364- **Link style** — schema picks `[[wikilinks]]` vs `[text](path.md)`. Don't65 override.66- **Subdirectories** — if existing `wiki/` is flat, write flat. Don't67 `mkdir entities/concepts/sources/comparisons/` unless schema says so.68- **Page types** — use the schema's taxonomy; the default table below is69 fallback only.7071## Initialize Wiki (first-time setup)7273Trigger: schema discovery returned nothing **and** `wiki/` is either74absent or contains no markdown files.7576If `wiki/` has files but no schema, **do not** bootstrap a parallel77layout. Instead, infer the existing shape (flat vs categorized, link78style, frontmatter) and write a schema file that matches before79proceeding.8081Steps:82831. **Locate the bundled seed.** It lives at `seeds/llm-wiki.md` next to84 this `SKILL.md`. If you don't know the SKILL.md path, try in order:85 `~/.agents/skills/wiki-handoff/seeds/llm-wiki.md`,86 `~/Developments/wiki-handoff/seeds/llm-wiki.md`. Last resort: `find ~ -path '*wiki-handoff/seeds/llm-wiki.md' 2>/dev/null | head -1`.87 Do **not** fetch from the internet — the seed is bundled to be offline-safe.882. **Copy it** to `wiki/CLAUDE.md`.893. **Ask the user one question** before scaffolding directories:90 > Flat layout (`wiki/<topic>.md`) or categorized91 > (`wiki/{entities,concepts,sources,comparisons}/`)? Default: flat.924. Create empty `wiki/index.md` with `# Index` heading and one section93 per category (matching the chosen layout).945. Create empty `wiki/log.md` with `# Log` heading.956. Create empty `raw/sources/` for source pointers.967. If git is on, commit as a separate scope: `wiki: initialize from llm-wiki seed`.978. Tell the user the wiki was initialized from the seed and point them at98 `wiki/CLAUDE.md` to adjust the schema before the next handoff. Then99 proceed with the requested mode.100101## What to Capture — the Non-derivable Gate102103Before writing each page or paragraph, **answer this**:104105> Could a future session derive this from `git log`, the code,106> `CLAUDE.md`, or an existing wiki page?107108- **Yes** → skip. Write nothing.109- **No** → write it.110111This gate is the wiki's only defense against bloat. Apply it strictly.112113| Capture | Skip |114|---|---|115| Decisions and the *reasons* behind them | Function signatures, file structure |116| Approaches that were tried and failed, and *why* | Code patterns (the code shows them) |117| Platform gotchas and workarounds | Anything in `CLAUDE.md` already |118| Capture-surface rankings, comparison tables | Re-narration of `git log` |119| Relationships between components | Step-by-step what-I-did blow-by-blow |120| Deferred work + the actual blocker | "We decided to use X" without the why |121122## Workflow — `handoff`1231241. Pre-flight.1252. **Inventory the session.** From the conversation, list:126 - New things introduced → entity pages127 - Concepts/techniques that recur → concept pages (non-trivial only)128 - External sources cited → source pages (only if a `raw/` doc exists)129 - Existing pages that need an update130 Apply the **non-derivable gate** to every item before writing.1313. **Write the pages.** Follow the schema's frontmatter and link style.132 Be terse — a 5-line page is fine.1334. **Update the index.** One line per new page in the right category.1345. **Append to the log.** Format: `## [YYYY-MM-DD] <op> | <short title>`135 followed by 1–3 lines.1366. **Git on** → commit per scope (`wiki: <subject>`), push, verify137 `git status` clean.138 **Git off** → tell the user the files are written but not versioned;139 suggest `git init` if they want handoff durability across machines.140141## Workflow — `snapshot`142143The point of `snapshot` is to make `/compact` safe: persist the144load-bearing facts to wiki *before* compacting, so the compactor doesn't145need to recall them.1461471. Pre-flight.1482. **Diff the session.** What's *new* since this conversation started149 that isn't already in the wiki? Apply the non-derivable gate.1503. **Write only the deltas.** Skip the full index overhaul that `handoff`151 does — just write the new/extended pages and append one log line:152 `## [YYYY-MM-DD] snapshot | <subject>`.1534. **Produce the recommended `/compact` string** and show it verbatim:154 ```155 /compact focus on <current task>. The following are now persisted in the wiki — drop from active window:156 - <wiki/page-1.md> — <what it covers>157 - <wiki/page-2.md> — <what it covers>158 Keep in window: <current diff / test failures / in-progress artifact>.159 ```1605. **Don't push** in snapshot mode unless the user asks. Optional commit161 is fine; default is no commit, just files on disk.162163## Frontmatter (default — verify against schema)164165```yaml166---167title: <page title>168type: entity | concept | source | comparison | overview | note169created: YYYY-MM-DD170updated: YYYY-MM-DD171sources: [list of raw/ filenames cited, or []]172tags: [optional]173---174```175176## Page Type Quick Reference (default — verify against schema)177178| Path | Use when | Body shape |179|---|---|---|180| `wiki/entities/<name>.md` | A concrete *thing* exists in the project | What it is, layout, surface area, cross-refs, open follow-ups |181| `wiki/concepts/<name>.md` | A non-trivial idea/technique that recurs | Definition, when to apply, gotchas |182| `wiki/sources/<slug>.md` | Summarizing a `raw/` document | One-paragraph summary + key points + link to raw |183| `wiki/comparisons/<name>.md` | Comparing two or more approaches | Tradeoff table, recommendation |184185If the project uses a flat `wiki/<topic>.md` layout, ignore the path186column and write flat.187188## Pre-push Sanity (git only)189190Before `git push`, in this order:1911921. `git status` — only the files you intended.1932. `git log --oneline -5` — commit messages match project style.1943. `git diff origin/<branch>..HEAD` — review what's about to land.195196If a commit message reads "what I did" instead of "what changed and197why", reword before pushing.198199## Common Mistakes200201- **Skipping schema discovery.** Always run it first; defer to whatever202 it returns over this skill's defaults.203- **Bootstrapping a parallel layout.** If `wiki/` already has files but204 no schema file, *do not* `mkdir` new subdirs — read the existing205 layout and write a schema file that matches it.206- **Overwriting existing pages.** Read them first; extend.207- **Padding with code or file structure.** That's already in the code208 and `git log`. The wiki captures *why* and *what surprised us*.209- **Forgetting the `log.md` entry.** Without it, the operation is210 invisible to a `grep "^## \["` audit.211- **Forgetting the index.** New pages must be discoverable from the212 catalog, not just by file scan.213- **Relative dates.** "Today" / "yesterday" / "Thursday" rot. Always214 write the absolute YYYY-MM-DD.215- **Committing but not pushing in `handoff`.** A handoff that lives only216 on your machine is not a handoff.217- **Pushing in `snapshot` without asking.** Snapshot is mid-session; the218 user may not want a remote commit yet.219- **Single mega-commit.** Match the project's split style — one commit220 per scope (e.g. one for code, one for `wiki:`).221- **Skipping the non-derivable gate.** The wiki bloats fast if every222 session writes a play-by-play. Be ruthless.223224## Red Flags — Stop and Fix225226- About to write without locating the schema → run Schema Discovery first.227- About to bootstrap when `wiki/` already has content → infer the228 existing layout instead and write a matching schema.229- About to write `## [today]` or `## [yesterday]` → use the absolute230 YYYY-MM-DD.231- Page has no inbound links from `index.md` → orphan; add the index entry.232- Commit message is `update wiki` → too vague; name the page or topic.233- `git push` fails for auth → don't `--force`; ask the user.234- In `snapshot` mode but the recommended `/compact` string is missing →235 that bridge is the whole point of snapshot; produce it.236- Bootstrap step about to fetch from a URL → wrong; the seed is bundled237 at `seeds/llm-wiki.md`.