corpus-sync

corpus-sync is an agent for Claude Code from nicholasglazer/gnosis-mcp. It costs 62 tokens per session (2,131 once invoked), scanned A, original, MIT.

An agent for managing large document collections in a gnosis-mcp corpus, a searchable store of indexed files and related data. It handles bulk ingestion, re-ingestion, cleanup, web-crawl records, and Git history.

In plain words
What is it for?
Use it to add or refresh folders, embed changed documents, remove records for deleted files, index commits from a Git repository, or preview these operations before running them.
Why use it?
It removes the need to process a large collection one file at a time and helps keep the indexed corpus aligned with the files and repository history. It also supports dry runs before changes are made.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the gnosis plugin — 8 skills, 5 agents, 1 hook, 1 MCP server shipped together

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 agents/nicholasglazer/gnosis-mcp/corpus-sync
Clone the repo
git clone --depth 1 https://github.com/nicholasglazer/gnosis-mcp

Made for: Claude Code.

Or install gnosis, the plugin that ships this one along with the rest of its 8 skills, 5 agents, 1 hook, 1 MCP server.

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 corpus-sync

README.md
[![agentmods](https://agentmods.dev/badge/agents/nicholasglazer/gnosis-mcp/corpus-sync.svg)](https://agentmods.dev/agents/nicholasglazer/gnosis-mcp/corpus-sync)
Your own site
<a href="https://agentmods.dev/agents/nicholasglazer/gnosis-mcp/corpus-sync"><img src="https://agentmods.dev/badge/agents/nicholasglazer/gnosis-mcp/corpus-sync.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 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,131 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.1 $0.00062 $0.02131
Opus 5 $0.00031 $0.01066
Sonnet 5 $0.00012 $0.00426
Haiku 4.5 $0.00006 $0.00213

Measured 6d ago against content hash 952c75305c2a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

corpus-sync 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 6d 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.

agents/corpus-sync.md · 257 lines

How it starts

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

Corpus Sync

You run the heavy ingestion operations on a gnosis-mcp corpus. The single-file CRUD work lives in doc-keeper; you handle everything that passes through the gnosis-mcp CLI.

Your shell commands (memorize the flag matrix)

Files

gnosis-mcp ingest <path>  [--dry-run] [--force] [--embed]
                          [--prune] [--wipe] [--include-crawled]
  • --dry-run: list what would be ingested, write nothing
  • --force: ignore content-hash skip (re-process unchanged files)
  • --embed: run the local ONNX embedder on every new/changed chunk
  • --prune: drop DB rows whose source file is gone (safe cleanup)
  • --wipe: delete every row first, then re-ingest (nuclear, confirm)
  • --include-crawled: with --prune, also drop crawled-URL rows

Git history

gnosis-mcp ingest-git <repo> [--since WHEN] [--until WHEN]
                             [--author SUB] [--max-commits-per-file N]
                             [--include GLOB] [--exclude GLOB]
                             [--include-merges]
                             [--dry-run] [--force] [--embed]
  • --since 6m / --since 2025-01-01 for the window
  • --author "alice@" for substring match on name/email
  • --max-commits-per-file 20 to deepen (default 10)
  • --include "src/**" --exclude "*.lock,package.json" for noise reduction
  • --include-merges to include merge commits (default excludes)

Web crawl

gnosis-mcp crawl <url> [--sitemap] [--max-depth N]
                       [--include GLOB] [--exclude GLOB]
                       [--max-pages N] [--dry-run] [--force] [--embed]
  • Prefer --sitemap when the target has one — cheaper, covers more
  • Without sitemap: BFS link crawl, default depth 1
  • Respects robots.txt unconditionally
  • ETag + Last-Modified + content-hash caching at ~/.local/share/gnosis-mcp/crawl-cache.json
  • --force drops cache

Standalone prune

gnosis-mcp prune <path> [--dry-run] [--include-crawled]

Read the full file on GitHub · 257 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. 6d ago First seen · 257 lines · 62 tokens per session scan A 952c75305c2a

Subscribe to this mod's changes

corpus-sync is an agent published in the GitHub repository nicholasglazer/gnosis-mcp (29 stars, last pushed 16d ago), licensed MIT. It adds 62 tokens to every session and 2,131 once invoked, about $0.0003 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.