From vault
Use when vault hooks (SessionStart, Stop, PreCompact, PostToolUse) emit "invoke the vault skill in <mode> mode", or when vault slash commands (/vault-update, /vault-enroll) are run, or when no subgraph matched at session start and knowledge work is starting. Manages the single-entry-point knowledge graph at ~/Vaults/. Three modes: init (passive), actualize (capture sweep), enroll (register a new subgraph).
How this skill is triggered — by the user, by Claude, or both
Slash command
/vault:vaultThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The vault is a single global knowledge graph at `~/Vaults/`. Each repo gets its own subgraph, matched at session start by this skill's `scripts/match.sh` against `~/Vaults/_registry.yaml`. Hooks enforce loading and capture; this skill is the algorithm those hooks invoke.
retrieval/vault_mcp.pyretrieval/vault_search.pyscripts/common.shscripts/inject-context.shscripts/match.shscripts/prompt-actualize.shscripts/tick-and-maybe-prompt.shscripts/vault_lint.pytemplates/node-api.mdtemplates/node-architecture.mdtemplates/node-bug.mdtemplates/node-component.mdtemplates/node-dependency.mdtemplates/node-domain.mdtemplates/node-pattern.mdtemplates/subgraph-index.mdtests/fixtures/sample-registry.yamltests/fixtures/sample-subgraph-index.mdtests/run.shtests/test_helper.shThe vault is a single global knowledge graph at ~/Vaults/. Each repo gets its own subgraph, matched at session start by this skill's scripts/match.sh against ~/Vaults/_registry.yaml. Hooks enforce loading and capture; this skill is the algorithm those hooks invoke.
Triggered implicitly by the SessionStart hook. The hook script has already done identity matching and printed a context block listing the matched subgraph and its entry nodes. You don't need to re-run matching.
Behavior:
[[orders/orders]], follow that link rather than re-discovering it.Triggered by Stop hook, PreCompact hook, the PostToolUse counter, or /vault-update. Sweeps everything Claude has learned this session into the matched subgraph as new or updated nodes.
Re-match identity: cwd may have changed mid-session. Run this skill's scripts/match.sh "$PWD" and use the result. If MISS, switch to enroll mode and ask the user where this work belongs.
Locate the subgraph root: read ~/Vaults/_registry.yaml, find the entry whose id matches, take its path. The subgraph root is ~/Vaults/<path>/.
Scan session deltas. Apply the following capture rules to everything that happened this session — files read, edits made, conversation insights, errors fixed.
SALIENCE GATE (apply to every candidate first — when in doubt, DON'T write): capture only durable, non-obvious knowledge that a competent dev could NOT trivially re-derive from a single source. Before creating any node, ask: "Could I reconstruct this in <2 min by opening one file — a controller, router, props interface, Swagger doc, or component?" If yes, SKIP IT. This kills the dominant failure mode (route tables, prop lists, "this page lives at /X and shows Y", controller-method enumerations) — those are 1:1 projections of a single artifact that the source documents better and keeps in sync. Capture the why, the gotcha, the incident scar, the cross-repo synthesis, the unguessable env fact — never the what that's already in code. A good node answers a question that cost real time to answer the first time.
<subgraph>/bugs/. Include symptoms, root cause, fix, ticket id (if any), [[wiki-links]] to affected components/endpoints.<subgraph>/components/ with purpose, key props, gotchas.<subgraph>/api/ with method, path, request/response shape.<subgraph>/architecture/.<subgraph>/patterns/.<subgraph>/domain/.<subgraph>/dependencies/.Cross-subgraph rule: if a candidate node would apply to >=2 sibling subgraphs in the same namespace (e.g. several <namespace>/* subgraphs), write it to <namespace>/shared/ instead.
For each surviving candidate — dedup BEFORE writing: query the vault_search MCP tool (and/or grep) for an existing node on the same topic, across all subgraphs (a near-duplicate may live in shared/ or a sibling).
updated:, don't create a sibling). Never produce a second insurance.md / scrollbar.md for a concept that already has one.~/Vaults/_templates/.Linking: every new node MUST contain at least one [[wiki-link]] to an existing node in the same subgraph. No orphans. If the new node is high-traffic enough to be an entry node, also add it to the subgraph's _index.md "Entry nodes" list.
Frontmatter: every node has frontmatter:
---
type: <bug|component|api|architecture|pattern|domain|dependency>
project: <subgraph-id>
created: <YYYY-MM-DD>
updated: <YYYY-MM-DD>
tags: []
---
Type-specific fields (already in templates):
ticket: <ID>path: <file-path>method: GET|POST|..., path: /api/...version: <semver>Naming: kebab-case filenames, short and greppable. No prefixes, no numbering. Folder provides context.
Write the actualize timestamp. The hook message includes the exact touch command to run. Copy it from the hook's stderr output (e.g. touch /tmp/vault-<session-id>/last-actualize) and execute it. This tells the Stop hook "at least one actualize happened" so it won't block again this session.
Report to the user: list the created and updated node paths so they can review.
If after scanning you have no candidates (e.g. trivial typo session), still touch the timestamp file and print "no knowledge delta — nothing to capture this turn" so the Stop hook lets the session exit cleanly. Do not create empty nodes.
Triggered when init reported MISS and the user wants to do knowledge work, or when /vault-enroll is run.
Detect identity of the current repo:
git -C "$PWD" remote get-url origin (may be empty)git -C "$PWD" rev-parse --show-toplevel then basename (or basename of $PWD if not a git repo)$PWD (resolved to absolute path)Ask the user where this subgraph should live. Present these options:
~/Vaults/<repo>/~/Vaults/<namespace>/<repo>/) — list the existing top-level directories under ~/Vaults/ so they can pickCreate the folder and scaffold the entry index from ~/Vaults/_templates/subgraph-index.md. Substitute the subgraph name, namespace (if any), today's date.
Append to the registry: edit ~/Vaults/_registry.yaml and add an entry like:
- id: <repo>
path: <relative-path-from-vault-root>
entry: <relative-path>/_index.md
match:
git_remote: <if available>
repo_name: <basename>
path_prefix: <absolute-path>
If the user picked option (c), don't append a new entry — instead add the new identity fields to the existing subgraph's match section as alternates (use a list if there are multiple).
Confirm: "Enrolled <repo> as subgraph <id>. Future sessions in this repo will auto-load it."
Optionally run actualize immediately to capture what's already known about the repo from this session.
The skill (and the hook scripts that invoke it) use these per-session state files under /tmp/vault-${SESSION_ID}/:
| File | Owner | Purpose |
|---|---|---|
tick | tick-and-maybe-prompt.sh | Counter of mutating tool calls since last actualize |
last-actualize | this skill (actualize mode) | Timestamp of most recent actualize sweep |
paused | /vault-pause slash command | When present, all hooks no-op |
| Command | Mode |
|---|---|
/vault-update | actualize |
/vault-enroll | enroll |
/vault-pause | (writes paused flag, no skill mode) |
/vault-resume | (clears paused flag, no skill mode) |
npx claudepluginhub deniskhay/claude-vault --plugin vaultCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.