watch

watch is a command for coding agents from geckse/markdown-vdb. It costs 13 tokens per session (1,502 once invoked), scanned A, original, MIT.

A long-running file watcher that keeps a Markdown index updated as source files change.

In plain words
What is it for?
Use it to monitor configured folders, update search and graph data incrementally, process metadata-only changes efficiently, and emit machine-readable event records.
Why use it?
It removes the need to rebuild the index manually after files are created, edited, renamed, or deleted. It can also react to changes in definitions for calculated fields and relationships.

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/geckse/markdown-vdb/watch
Clone the repo
git clone --depth 1 https://github.com/geckse/markdown-vdb

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 watch

README.md
[![agentmods](https://agentmods.dev/badge/commands/geckse/markdown-vdb/watch.svg)](https://agentmods.dev/commands/geckse/markdown-vdb/watch)
Your own site
<a href="https://agentmods.dev/commands/geckse/markdown-vdb/watch"><img src="https://agentmods.dev/badge/commands/geckse/markdown-vdb/watch.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,502 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.00013 $0.01502
Opus 5 $0.00006 $0.00751
Sonnet 5 $0.00003 $0.00300
Haiku 4.5 $0.00001 $0.00150

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

Security

Grade A, and why

watch 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/cli/commands/watch.md · 186 lines

How it starts

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

mdvdb watch

Watch configured source folders and apply incremental updates when Markdown files are created, modified, renamed, or deleted. The watcher also observes the project-root .markdownvdb.schema.yml so Formula, Lookup, Rollup, and Relation definitions can react without a manual restart.

Usage

mdvdb watch [GLOBAL OPTIONS]

There are no command-specific flags. Common forms are:

mdvdb watch
mdvdb watch --root /path/to/project
mdvdb watch --json
mdvdb watch -vv --no-color

--json is a long-lived NDJSON stream: one startup object followed by one object per processed event.

Incremental behavior

Every event is serialized through the project module lock so raw index changes, computed-field evaluation, Markdown writeback, and the final save remain one coherent operation.

Change Work performed
Duplicate/no-op filesystem event Skip when both source and embedding-body hashes still match
Frontmatter-only edit Refresh metadata, Relations, schemas, and computed modules without embedding, FTS, or cluster work
Body create/change Parse, chunk, adaptively embed, update vector/FTS data, links/Relations, schemas, collection clusters/Topics, then Formula and Lookup/Rollup
Delete Remove vector/FTS/link and collection analysis state, refresh schemas, and run dependent modules
Rename Remove the old identity, index the new identity, and report both paths
Schema overlay edit Refresh global/scoped schemas and relation classification, then run modules with schema_changed; no embedding call

Formula runs before Lookup/Rollup. Successful computed values are atomically materialized into declared frontmatter keys; bodies and unrelated YAML are preserved. The filesystem echo caused by that writeback is recognized as a no-op, preventing a watch loop.

Automatic collection clusters and compatible collection Topic assignments are updated incrementally. New or changed Topic definitions, and Shard-local Topic state, can still require a collection-wide mdvdb ingest.

Read the full file on GitHub · 186 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 · 186 lines · 13 tokens per session scan A 0fed5a2c06af

Subscribe to this mod's changes

watch is a command published in the GitHub repository geckse/markdown-vdb (24 stars, last pushed 21d ago), licensed MIT. It adds 13 tokens to every session and 1,502 once invoked, about $0.0001 per session on Opus 5. 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-30.