index-manager

index-manager is a skill for Claude Code from Raw1mage/patentmcp. It costs 20 tokens per session (1,095 once invoked), scanned C, a copy of index-manager, MIT.

A utility for managing the search index used for U.S. patent-law documents. An index is a prepared data structure that makes document searches faster.

In plain words
What is it for?
Use it when the MPEP index is missing, damaged, outdated, or slow, including downloading documents, extracting them, creating search data, verifying files, and optimizing the indexes.
Why use it?
It provides a process for downloading source PDFs, building or repairing the index, checking its files, and maintaining it over time.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is # Or: python mcp_server/server.py --rebuild-index.

Part of the claude-patent-creator-standalone plugin — 17 skills, 16 commands, 13 agents, 2 hooks shipped together

Good fit Use it when the MPEP index is missing, damaged, outdated, or slow, including downloading documents, extracting them, creating search data, verifying files, and optimizing the indexes.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Raw1mage/patentmcp
agentmods
npx agentmods add skills/raw1mage/patentmcp/index-manager

Made for: Claude Code.

Or install claude-patent-creator-standalone, the plugin that ships this one along with the rest of its 17 skills, 16 commands, 13 agents, 2 hooks.

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 index-manager

README.md
[![agentmods](https://agentmods.dev/badge/skills/raw1mage/patentmcp/index-manager.svg)](https://agentmods.dev/skills/raw1mage/patentmcp/index-manager)
Your own site
<a href="https://agentmods.dev/skills/raw1mage/patentmcp/index-manager"><img src="https://agentmods.dev/badge/skills/raw1mage/patentmcp/index-manager.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,095 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.00020 $0.01095
Opus 5 $0.00010 $0.00548
Sonnet 5 $0.00004 $0.00219
Haiku 4.5 $0.00002 $0.00110

Measured 8d ago against content hash 7df015cd06c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

index-manager scanned grade C with 2 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 8d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf mcp_server/index_backup_*

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

wget https://www.uspto.gov/web/offices/pac/mpep/mpep-2900.pdf -O pdfs/mpep-2900.pdf
Origin

This is a copy

100% identical to index-manager — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

refs/Claude-Patent-Creator/skills/index-manager/SKILL.md · 174 lines

How it starts

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

Index Manager Skill

Expert system for managing MPEP search index lifecycle: PDF downloads, index building, maintenance, updates, optimization.

FOR CLAUDE: All dependencies installed, system operational.

  • Go directly to appropriate phase
  • Scripts/tools in mcp_server/
  • Use patent-creator CLI when available
  • Only run diagnostics if operations fail

When to Use

Building/rebuilding MPEP index, corruption/missing files, optimization, adding content, troubleshooting.

Index Lifecycle

PDFs Not Present -> Download (2-5 min, 500MB)
  -> Extract & Parse (500MB data)
  -> Generate Embeddings (5-10 min GPU, 35-65 min CPU)
  -> Build FAISS + BM25 Indexes
  -> Index Ready (mcp_server/index/)
  -> Maintenance (Verify -> Optimize -> Update)

Phase 1: PDF Management

Check Status:

ls pdfs/  # Should show mpep-*.pdf, consolidated_laws.pdf, consolidated_rules.pdf

Download PDFs:

patent-creator download-mpep
# Or: python install.py (Select "Download MPEP PDFs")

Verify Integrity:

python -c "
import fitz
from pathlib import Path
for pdf in Path('pdfs').glob('*.pdf'):
    try:
        doc = fitz.open(pdf)
        print(f'[OK] {pdf.name}: {len(doc)} pages')
        doc.close()
    except Exception as e:
        print(f'[X] {pdf.name}: ERROR - {e}')
"

Phase 2: Index Building

patent-creator rebuild-index
# Or: python mcp_server/server.py --rebuild-index

Timeline:

  • Load PDFs: 30s
  • Extract text: 1-2 min
  • Chunk text (500 tokens): 30s
  • Generate embeddings: 5-10 min (GPU) or 35-65 min (CPU)
  • Build FAISS/BM25: 1 min
  • Save to disk: 10s

Total: 5-15 min (GPU) or 35-65 min (CPU)

Custom Build:

from mcp_server.mpep_search import MPEPIndex
index = MPEPIndex(use_hyde=False)
index.build_index(
    chunk_size=500,
    overlap=50,
    batch_size=32  # Reduce to 16/8 if OOM
)

Phase 3: Verification

# Check files
ls -lh mcp_server/index/
# Expected: mpep_index.faiss (~150MB), mpep_metadata.json (~80MB), mpep_bm25.pkl (~60MB)

# Verify health
patent-creator health
# Should show: [OK] MPEP Index: Ready (12,543 chunks)

# Manual test
python -c "
from mcp_server.mpep_search import MPEPIndex
index = MPEPIndex()
print(f'Chunks: {len(index.chunks)}')
results = index.search('claim definiteness', top_k=3)
print(f'Search results: {len(results)}')
"

Read the full file on GitHub · 174 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. 8d ago First seen · 174 lines · 20 tokens per session scan C 7df015cd06c3

Subscribe to this mod's changes

index-manager is a skill published in the GitHub repository Raw1mage/patentmcp (2 stars, last pushed 1mo ago), licensed MIT. It adds 20 tokens to every session and 1,095 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). It is 100% identical to index-manager, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

specification-writing

A workflow for writing complete patent specifications from patent claims and an invention disclosure. It adapts the document to a chosen jurisdiction, such as the US, Europe, or China.

wanshuiyin/Auto-claude-code-research-in-sleep · 49 tokens

regulatory-research-fallback

Fallback workflow for regulatory research when web extraction tools fail on government PDFs.

HKUDS/OpenSpace · 20 tokens

x-scorecard

OpenSSF Scorecard for assessing open source project security. Check security best practices and compliance. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 57 tokens

gesellschaftsrechtliche-satzungen-agb

Für Gesellschaftsrechtliche Satzungen AGB Abgrenzung: ordnet Norm, Beweislast und Gegenargument; Ergebnis: Prüfprodukt mit Risiko und nächstem Schritt. Fachgebiet: AGB-Recht-Prüfer. Route: gesellschaftsrechtliche-satzungen-agb.

Klotzkette/claude-fuer-deutsches-recht · 69 tokens

memstack-business-gdpr

Use this skill when the user says 'GDPR', 'data protection', 'privacy compliance', 'DPA', 'DSAR', 'data subject request', 'cookie consent', 'privacy audit', 'CCPA', or asks 'do I need GDPR for this repo'. Scans the repository to detect what personal data is collected, classifies sensitivity, determines whether GDPR…

cwinvestments/memstack · 121 tokens

nda-review

Use when the user uploads or pastes a non-disclosure agreement and asks for review, redline, risk assessment, or a recommendation on whether to sign. Identifies missing standard protections, one-sided or unusual provisions, and operational issues; produces a structured report with severity ratings and citations to…

LegalQuants/lq-ai · 79 tokens