clusters

A command for grouping indexed documents into automatic communities or user-defined topics. A shard is a named, independent subset of the collection.

In plain words
What is it for?
Use it to inspect document groups, create or edit topics with descriptions and seed phrases, remove topics, and find unassigned documents.
Why use it?
It helps you see related documents together and keep topic assignments separate for different subsets of a project.

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/clusters
Clone the repo
git clone --depth 1 https://github.com/geckse/markdown-vdb
Per session 11 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,877 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.00011 $0.01877
Opus 5 $0.00005 $0.00938
Sonnet 5 $0.00002 $0.00375
Haiku 4.5 $0.00001 $0.00188

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

Security

Grade A, and why

clusters 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 2d 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/clusters.md · 227 lines

How it starts

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

mdvdb clusters

Inspect automatic document communities or manage user-defined Topics. Without a Shard, results use the Collection analysis stored in the shared index. With --shard, automatic communities and Topic assignments belong only to that named recursive sub-collection.

Usage

mdvdb clusters [--shard <ID>]
mdvdb clusters [--shard <ID>] --custom
mdvdb clusters [--shard <ID>] list
mdvdb clusters [--shard <ID>] add <NAME> [OPTIONS]
mdvdb clusters [--shard <ID>] update <NAME> [OPTIONS]
mdvdb clusters [--shard <ID>] remove <NAME>
mdvdb clusters [--shard <ID>] unassigned

Options

Flag Description
--shard <ID> Use the Shard's independent automatic clusters and Topics
--custom Show computed Topic summaries instead of automatic clusters

Topic definition options:

Flag Applies to Description
--description <TEXT> add, update Natural-language Topic description
--seeds <A,B,...> add, update Comma-separated seed phrases
--threshold <VALUE> add, update Per-Topic similarity threshold in 0.0..1.0; on update, a negative value clears the override
--rename <NAME> update Rename the Topic within its owner

A Topic must have a non-empty description, at least one seed, or both. Names are unique case-sensitively within their owner. The Collection and every Shard are separate owners, so two scopes may intentionally use the same name with different definitions and assignments.

Automatic clusters

# Communities across the complete Collection
mdvdb clusters

# Finer communities derived only from indexed documents in Research
mdvdb clusters --shard research

Collection automatic clusters are built by ingest and updated incrementally by watch when a compatible state exists. Shard automatic clusters are computed lazily from the existing document vectors already stored in the shared index. They use the Collection's clustering algorithm and settings but only the Shard corpus. For Leiden analysis, clustering.knn remains the configured upper bound; a Shard caps its effective neighborhood at max(2, ceil(sqrt(document_count))). This prevents a small Shard from becoming a complete similarity graph and collapsing otherwise useful local communities. Collection clustering is unchanged.

Read the full file on GitHub · 227 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. 2d ago First seen · 227 lines · 11 tokens per session scan A dbd81c13b453

Subscribe to this mod's changes

clusters is a command published in the GitHub repository geckse/markdown-vdb (23 stars, last pushed 18d ago), licensed MIT. It adds 11 tokens to every session and 1,877 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.

Related

Other commands, from other repositories