reindex

reindex is a command for Claude Code from ArtemioPadilla/agent-triforce. It costs 0 tokens per session (303 once invoked), scanned A, original, MIT.

A command that rebuilds a lightweight index of a codebase. The index records files, functions, classes, dependencies, circular dependencies, and known hotspots for agents to share.

In plain words
What is it for?
Use it after code changes, or incrementally for changed files, to update docs/codebase-index.json and report codebase statistics.
Why use it?
It helps agents understand the project's structure and detect when their shared view has become outdated after many changes.

Command 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 python3 tools/codebase-indexer.py --output docs/codebase-index.json.

Part of the agent-triforce plugin — 15 commands, 2 hooks shipped together

Good fit Use it after code changes, or incrementally for changed files, to update docs/codebase-index.json and report codebase statistics.

Compare 6 commands 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/ArtemioPadilla/agent-triforce
agentmods
npx agentmods add commands/artemiopadilla/agent-triforce/reindex

Made for: Claude Code.

Or install agent-triforce, the plugin that ships this one along with the rest of its 15 commands, 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 reindex

README.md
[![agentmods](https://agentmods.dev/badge/commands/artemiopadilla/agent-triforce/reindex/github.svg)](https://agentmods.dev/commands/artemiopadilla/agent-triforce/reindex)
Your own site
<a href="https://agentmods.dev/commands/artemiopadilla/agent-triforce/reindex"><img src="https://agentmods.dev/badge/commands/artemiopadilla/agent-triforce/reindex/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for reindex

Your own site · 80×15
<a href="https://agentmods.dev/commands/artemiopadilla/agent-triforce/reindex"><img src="https://agentmods.dev/badge/commands/artemiopadilla/agent-triforce/reindex.svg" alt="Reviewed on agentmods" width="80" 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 303 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00000 $0.00303
Opus 5 $0.00000 $0.00151
Sonnet 5 $0.00000 $0.00061
Haiku 4.5 $0.00000 $0.00030

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

Security

Grade A, and why

reindex 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 11d 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.

agent-triforce/commands/reindex.md · 34 lines

What it actually says

Rebuild the codebase knowledge index for the project.

The index is a lightweight map of the codebase shared across all three agents: module structure, public function signatures, inter-module dependencies, and known hotspots.

Steps

  1. Run the codebase indexer:

    python3 tools/codebase-indexer.py --output docs/codebase-index.json
    

    For incremental updates (only re-index changed files):

    python3 tools/codebase-indexer.py --output docs/codebase-index.json --incremental
    
  2. Display the summary output to the user

  3. If --src-dir is specified, pass it through:

    python3 tools/codebase-indexer.py --src-dir {dir} --output docs/codebase-index.json
    
  4. Report the index location and key stats:

    • File count, line count, function count, class count
    • Dependency edges and circular dependencies (if any)
    • Hotspot count (files flagged in TECH_DEBT.md or security reviews)

Notes

  • The index is stored at docs/codebase-index.json and should be committed to version control
  • Index build should complete in under 60 seconds for codebases up to 500 files
  • If the index is stale (>24h old or >50 file changes), agents will warn on spawn
  • Zero external dependencies — uses Python 3.9+ standard library only
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. 11d ago First seen · 34 lines · 0 tokens per session scan A f62dd5a3c9d5

Subscribe to this mod's changes

reindex is a command published in the GitHub repository ArtemioPadilla/agent-triforce (3 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 303 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.