add-rm

add-rm is a command for coding agents from zach-blumenfeld/knowledge-index. It costs 0 tokens per session (2,030 once invoked), scanned A, original, Apache-2.0.

Two commands for updating a knowledge index, which is a searchable graph made from Markdown files. `ki add` adds or updates one file or folder in the index, while `ki rm` removes its entries without deleting the original files.

In plain words
What is it for?
Use them after creating, editing, renaming, or deleting documents or folders in a Markdown knowledge base.
Why use it?
They keep the index aligned with individual file changes without rebuilding the entire collection. The Markdown files remain the source of truth.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/zach-blumenfeld/knowledge-index/add-rm
Clone the repo
git clone --depth 1 https://github.com/zach-blumenfeld/knowledge-index

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-rm

README.md
[![agentmods](https://agentmods.dev/badge/commands/zach-blumenfeld/knowledge-index/add-rm.svg)](https://agentmods.dev/commands/zach-blumenfeld/knowledge-index/add-rm)
Your own site
<a href="https://agentmods.dev/commands/zach-blumenfeld/knowledge-index/add-rm"><img src="https://agentmods.dev/badge/commands/zach-blumenfeld/knowledge-index/add-rm.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,030 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02030
Opus 5 $0.00000 $0.01015
Sonnet 5 $0.00000 $0.00406
Haiku 4.5 $0.00000 $0.00203

Measured 5d ago against content hash 580eddf854f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

add-rm scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/add-rm.md · 171 lines

How it starts

The opening of the file, as written. The whole thing — 171 lines — stays where its author put it; the contents beside it link to each section on GitHub.

How ki add and ki rm work

ki add and ki rm are the incremental write surface — the way you keep the index in step with one document or folder after you create, edit, rename, or delete it, without rebuilding the whole vault. They are the per-target siblings of the two whole-vault commands: ki index (build/refresh an entire vault) and ki drop (remove an entire vault). For the profile/vault model they share with every other command, see docs/scoping.md.


1. The one idea behind both: the index is a cache over your files

ki keeps a Neo4j graph that mirrors a folder of markdown. That graph is a disposable, rebuildable cache — your markdown files are the source of truth, and ki reflects what's on disk. It never owns your content and never writes to your files.

Two consequences fall straight out of that, and they're the whole reason these commands behave the way they do:

  • ki rm does not delete files. It removes nodes from the index; your markdown stays exactly where it is. If you know git: ki rm is git rm --cached, not plain git rm. The file lives on; only ki's view of it goes away.
  • ki add does not move or create files. It reads files you've already written and (re)indexes them. You edit on disk; ki add syncs the index.

So the write surface is index-only. You change your files with your normal tools (editor, mv, rm, Obsidian, git); then you tell ki what changed so its graph catches up.


2. ki rm — drop a document or folder from the index

ki rm <doc-or-folder>           # remove it (and everything under it) from the index
ki rm <doc-or-folder> --dry-run # show what would be removed; change nothing

ki rm removes one document or folder and its whole subtree — a folder takes its files and subfolders with it; a document takes its sections with it. Your files are untouched.

What you can point it at. A uri (the kind ki search / ki outline hand you) or a path to the file/folder. Either resolves to the same place.

Read the full file on GitHub · 171 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 171 lines · 0 tokens per session scan A 580eddf854f0

Subscribe to this mod's changes

add-rm is a command published in the GitHub repository zach-blumenfeld/knowledge-index (6 stars, last pushed 11d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,030 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.