index

index is a command for Claude Code from tzachbon/smart-ralph. It costs 0 tokens per session (2,045 once invoked), scanned A, original, MIT.

A command that scans a codebase and external resources, then creates searchable component specifications in a specs index. Components are reusable parts such as services, models, controllers, or helpers.

In plain words
What is it for?
Use it to index selected code areas or changed files, fetch external resources such as URLs and skills, generate component summaries, and preview changes with a dry run.
Why use it?
It turns scattered code and referenced resources into organized project information that can be searched during later specification work.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions .claude-plugin; names the AskUserQuestion tool.

Part of the ralph-specum plugin — 3 skills, 11 commands, 7 agents shipped together

Good fit Use it to index selected code areas or changed files, fetch external resources such as URLs and skills, generate component summaries, and preview changes with a dry run.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/tzachbon/smart-ralph/index
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.

Clone the repo
git clone --depth 1 https://github.com/tzachbon/smart-ralph

Made for: Claude Code.

Or install ralph-specum, the plugin that ships this one along with the rest of its 3 skills, 11 commands, 7 agents.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/tzachbon/smart-ralph/index"><img src="https://agentmods.dev/badge/commands/tzachbon/smart-ralph/index.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 2,045 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.02045
Opus 5.5 $0.00000 $0.00818
Sonnet 5.5 $0.00000 $0.00409
Haiku 4.5 $0.00000 $0.00204

Measured 1mo ago against content hash 297995c5a630, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

index 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 1mo 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.

plugins/ralph-specum/commands/index.md · 201 lines

How it starts

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

Index Command

You are running the codebase indexing command. This scans the repository to generate component specs in specs/.index/.

Checklist

Use TaskCreate to track these steps:

  • Parse arguments and validate
  • Pre-scan interview (skip if --quick)
  • Scan codebase components
  • Fetch external resources (URLs, MCP, skills)
  • Generate component and external specs
  • Build index summary
  • Post-scan review (skip if --quick)

Step 1: Parse Arguments

Parse from $ARGUMENTS:

Option Format Default Description
--path --path=<dir> Project root Limit scan to directory
--type --type=<types> All Comma-separated: controllers,services,models,helpers,migrations
--exclude --exclude=<patterns> See below Comma-separated exclude patterns
--dry-run Flag false Preview without writing
--force Flag false Regenerate all (ignore existing)
--changed Flag false Only git-changed files
--quick Flag false Skip interviews, batch only

Default excludes: node_modules, vendor, dist, build, .git, __pycache__, *.test.*, *.spec.*, *_test.*, test/, tests/, spec/, specs/

Validation: --force + --changed together is an error. --path must exist. --type values must be valid. --changed requires git (git rev-parse --git-dir).

Step 2: Pre-Scan Interview

Ask via AskUserQuestion:

# Question Key
1 External documentation URLs to index? externalUrls
2 MCP servers or skills to document? externalTools
3 Specific directories to focus on? focusAreas
4 Code areas lacking comments needing extra attention? sparseAreas

Store responses in ./specs/.index/.index-state.json under interviewResponses.

Step 3: Component Scanner

Detection Patterns

Category Glob Pattern File Pattern
Controllers **/controllers/**/*.{ts,js,py,go} *controller*, *Controller*
Services **/services/**/*.{ts,js,py,go} *service*, *Service*
Models **/models/**/*.{ts,js,py,go} *model*, *Model*
Helpers **/helpers/**/*.{ts,js,py,go} *helper*, *Helper*, *util*
Migrations **/migrations/**/*.{ts,js,sql} *migration*

Read the full file on GitHub · 201 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. 1mo ago First seen · 201 lines · 0 tokens per session scan A 297995c5a630

Subscribe to this mod's changes

index is a command published in the GitHub repository tzachbon/smart-ralph (559 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,045 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-09-03.