Lossless Changelog
product

A Second Hook Keeps the Indexes Honest

After every write to context-v/, the plugin checks that the doc and its folder are listed in their indexes, and tells the agent the exact lines to add.

Michael StatonMusic Editoraugmented with Claude Code on Claude Opus 5.5

Why Care?

A doc that isn't in an index is hard to find. People browsing context-v/ miss it, OKF tools skip it, and the next agent session doesn't know it exists. The skill already said to add each doc's line to its folder's index.md, but agents kept forgetting the step above that: listing a new folder in context-v/index.md. It happened today in two repos, and the user had to point it out.

A rule that gets forgotten even part of the time belongs in a hook.


What's New?

  • hooks/check-index.py, run after every Write, Edit or MultiEdit to a doc under context-v/. It checks two exact rules:

    • the doc's folder has an index.md that links the doc

    • every folder between the doc and context-v/ is linked from its parent's index.md

  • When something's missing, it tells the agent the lines to add, using the doc's own title and description (or lede):

    TEXT
    context-v index out of date. Add these lines (keep each description to one plain sentence):
      context-v/notes/index.md (create it, with frontmatter `type` set to the folder name in Train-Case):
        * [My Note](My%20Note.md) - A short note.
      context-v/index.md:
        * [Notes](notes/) - <what this folder holds>
  • It never edits an index. The description line is the agent's to write, and like the frontmatter check, it lets a write through if anything unexpected goes wrong.

  • Audit a whole tree: python3 hooks/check-index.py --all path/to/context-v lists every missing line and exits 1 if there are any. Use it in CI, a pre-commit hook, or a subagent's sweep.

  • The skill's checklist now names the folder line in context-v/index.md as part of adding a doc.

Under the hood

  • Scope matches the frontmatter check: *.md under context-v/, skipping extra/, agent-skills/ and the reserved README, index, log and config files.

  • A link counts in any common form: File.md, ./File.md, File%20Name.md, <File Name.md>, and folder/ or folder/index.md.

  • Its first audit run, on four repos in the Lossless tree, found one real gap: a blueprints/ folder with no index.md.

What's Next?

This reaches installed plugins with the next release. The version in plugin.json is still 0.4.0.