index-project

index-project is a command for Claude Code from Redtropig/harness-anchor. It costs 27 tokens per session (552 once invoked), scanned A, original, MIT.

A command that builds PROJECT-TOC.md, a one-line index of every tracked source file in a Git repository. It also records the commit used to create the index and preserves a human-edited decisions section.

In plain words
What is it for?
Use it to regenerate a repository file index, summarize directories and source files, and review which files were added, removed, or changed.
Why use it?
It gives coding agents a compact map of a large project without opening every file. The commit marker helps show whether the index is out of date.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the harness-anchor plugin — 14 skills, 9 commands, 5 agents, 5 hooks shipped together

Good fit Use it to regenerate a repository file index, summarize directories and source files, and review which files were added, removed, or changed.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Redtropig/harness-anchor
Claude Code
/plugin install harness-anchor

Made for: Claude Code.

Or install harness-anchor, the plugin that ships this one along with the rest of its 14 skills, 9 commands, 5 agents, 5 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-project

README.md
[![agentmods](https://agentmods.dev/badge/commands/redtropig/harness-anchor/index-project/github.svg)](https://agentmods.dev/commands/redtropig/harness-anchor/index-project)
Your own site
<a href="https://agentmods.dev/commands/redtropig/harness-anchor/index-project"><img src="https://agentmods.dev/badge/commands/redtropig/harness-anchor/index-project/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 index-project

Your own site · 80×15
<a href="https://agentmods.dev/commands/redtropig/harness-anchor/index-project"><img src="https://agentmods.dev/badge/commands/redtropig/harness-anchor/index-project.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 552 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.00027 $0.00552
Opus 5 $0.00014 $0.00276
Sonnet 5 $0.00005 $0.00110
Haiku 4.5 $0.00003 $0.00055

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

Security

Grade A, and why

index-project 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 10d 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.

commands/index-project.md · 45 lines

What it actually says

/index-project

Rebuild the project's PROJECT-TOC.md index by scanning git-tracked files and extracting a one-line summary per file.

Steps

  1. Verify git repo. If not in a git working tree, error out: "PROJECT-TOC.md requires a git repository. Run git init first."

  2. Run index-builder.

    node ${CLAUDE_PLUGIN_ROOT}/scripts/index-builder.mjs --target "$(pwd)"
    

    The script:

    • Reads git ls-files for tracked text files
    • Skips binaries (magic-byte heuristic) and files >100KB
    • Skips PROJECT-TOC.md itself, .harness-anchor/, common build dirs
    • Extracts a one-line summary per file (first non-empty comment/docstring/first line of content, truncated to 80 chars)
    • Emits a ## Directory map (one line per directory — direct-file + subdir counts) above ## Files: the "forest" view the SessionStart hook injects for large repos
    • Preserves the existing ## Decisions section (human-edited)
    • Writes header <!-- generated-at-commit: <current HEAD SHA> -->
  3. Report diff. Run git diff PROJECT-TOC.md and summarize: N files added / M removed / K summaries updated.

  4. Suggest commit. Tell the user: "Run git add PROJECT-TOC.md && git commit -m 'chore: refresh project index' when ready." Do not auto-commit.

When PROJECT-TOC.md doesn't exist yet

If the file is missing, the script bootstraps it from templates/PROJECT-TOC.md.tpl. The user can run /anchor first for a cleaner scaffold; /index-project will work either way.

Performance

For a 10k-file repo, expect ~2-3 seconds. If it exceeds 10 seconds, the script will warn — likely indicating bloat (auto-generated files committed) that should be .gitignored.

When NOT to run

  • Mid-feature, when you've only changed 1-2 files (the SessionStart hook will surface the stale-TOC warning; you can ignore it for short sessions and regenerate at /session-end).
  • In CI (use a dedicated CI workflow if needed).
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. 10d ago First seen · 45 lines · 27 tokens per session scan A 9a785062ac35

Subscribe to this mod's changes

index-project is a command published in the GitHub repository Redtropig/harness-anchor (13 stars, last pushed 1mo ago), licensed MIT. It adds 27 tokens to every session and 552 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

create-pr

Creates GitHub pull requests with pre-flight validation, conventional title formatting, and structured summary generation. Runs parallel checks (tests, lint, type-check, security) before opening. Supports feature, bugfix, refactor, and hotfix PR types with milestone assignment via gh CLI. Invoke only if the operator…

yonatangross/orchestkit · 89 tokens

fix-issue

Fixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to…

yonatangross/orchestkit · 82 tokens

swarm-migrate

Cross-repo migration swarm — one coordinator + N parallel subagents (one per target repo) that apply the same transformation, open PRs, wait for CI, and report back to a shared JSON ledger. Coordinator handles topology, conflict auto-rebase, and stop-on-novel-failure. Use when bumping a shared dependency, rolling out…

yonatangross/orchestkit · 103 tokens

commit

Run when user calls /commit or asks to generate a commit message. Analyzes staged changes and writes a structured commit message.

guanyang/open-agent-hub · 28 tokens

commit

Creates commits with Conventional Commits format (feat/fix/docs/refactor/test/chore), automatic scope detection, co-author attribution, and pre-commit hook compliance. Validates staged changes, generates descriptive messages focusing on the 'why', and prevents secrets or generated-only files from being committed.…

yonatangross/orchestkit · 91 tokens

design-ship

One-shot pipeline turning a claude.ai/design link into a pull request: scaffold via /ork:design-import, stories and specs via /ork:cover, browser verification via /ork:expect, then open the PR. Use when a design link should come back as a PR with no intermediate steps; if all you need is the components written to…

yonatangross/orchestkit · 84 tokens