/historian:historianfrom historian
Embed historian chunks that were stored without a vector. When the local embedder (ollama) is down at SessionEnd, historian still stores each session's chunks but cannot embed them, and retrieval is embedding-only, so those chunks never surface. This walks the store and embeds them in place. Use when the user types `/historian backfill` or `/historian backfill --dry-run`, or asks to re-embed, backfill, or recover historian chunks after an embedder outage.
Ships in historian. 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.
Retrieval only sees chunks that carry an embedding. When the embedder is down
at SessionEnd, historian stores the chunks anyway and leaves the vector off, and
nothing comes back for them later. /historian backfill is that later pass.
backfill --dry-run, or the user asks how much is missing → count onlybackfill → count, report, then embedbackfill --project <key> → limit either of the above to one project keyThe script lives at ${CLAUDE_PLUGIN_ROOT}/scripts/backfill.sh and reads config
from the current directory, the same way the SessionEnd hook reads it from the
session's cwd. Run it from the project directory.
Always dry-run first, so the user sees the size before anything runs:
CLAUDE_SESSION_ID="${CLAUDE_SESSION_ID}" bash "${CLAUDE_PLUGIN_ROOT}/scripts/backfill.sh" --dry-run
Report the line it prints. If the user only asked for a count, stop here.
Then the real run. It only adds vectors to chunks that have none, keeps
every other line byte for byte, and swaps each session file in only once it
is complete, so this does not need a go-ahead the way a destructive step
would. It does need time: each chunk is one local embed plus a few jq
calls, roughly 0.1–0.2s, so thousands of chunks take minutes to tens of
minutes. Past a few hundred, run it in the background rather than against
the tool timeout:
CLAUDE_SESSION_ID="${CLAUDE_SESSION_ID}" bash "${CLAUDE_PLUGIN_ROOT}/scripts/backfill.sh"
Report the final summary line verbatim — embedded, failed (with the most common reason), and sessions skipped because an indexing run held their lock. Do not compute your own totals from the per-session lines.
It exits 1 and changes nothing in each of these cases. Relay the message and the fix, and don't try to work around it.
open -ga Ollama starts it; then
run the backfill again.oversized failures are chunks longer than historian.embedder.max_input_chars.
They fail the same way on every run and do not count toward the stop; mention
the count if the summary reports them.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub onlooker-community/ecosystem --plugin historian