index

A project-indexing command that scans a codebase and creates a PROJECT_MAP.md file describing its structure, technologies, important files, and development patterns. It can also connect this map to CLAUDE.md so later sessions can use it.

In plain words
What is it for?
Use it to document a project from scratch, update the map after changes, regenerate it completely, or analyze one specific area.
Why use it?
It prevents coding sessions from starting without knowledge of the project and reduces repeated explanations of where things are and how the code is organized.

Command

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 commands/stefan-jansen/claude-code-toolkit/index
Clone the repo
git clone --depth 1 https://github.com/stefan-jansen/claude-code-toolkit
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 388 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 $0.00008 $0.00388
Opus 5 $0.00004 $0.00194
Sonnet 5 $0.00002 $0.00078
Haiku 4.5 $0.00001 $0.00039

Measured yesterday against content hash 1031a6b719a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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/memory/commands/index.md · 64 lines

What it actually says

Index Project

Create persistent project understanding that survives sessions.

Input: $ARGUMENTS

Modes

  • (no args): Full project scan
  • --update: Incremental changes only
  • --refresh: Complete regeneration
  • "focus area": Targeted analysis

Process

  1. Analyze Structure

    • Detect language (Python/JS/TS/Go)
    • Identify frameworks (Django, React, FastAPI, etc.)
    • Map directories: src/, lib/, tests/, docs/
    • Find entry points: main.py, index.js, app.py
  2. Generate PROJECT_MAP.md

    # Project Map: [Name]
    
    ## Quick Overview
    - Type: [web app/library/service]
    - Language: [primary]
    - Frameworks: [detected]
    
    ## Directory Structure
    - `src/` - Main application
    - `tests/` - Test files
    
    ## Key Files
    - `main.py` - Entry point
    - `config.yaml` - Configuration
    
    ## Patterns
    - Architecture: [pattern]
    - Testing: [approach]
    
  3. Auto-import to CLAUDE.md

    • Add @.claude/PROJECT_MAP.md import
    • Create CLAUDE.md if doesn't exist

Output

  • .claude/PROJECT_MAP.md - Project understanding
  • CLAUDE.md updated with import

Benefits

  • /analyze has persistent context
  • /explore starts with project knowledge
  • New sessions understand codebase immediately
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. yesterday First seen · 64 lines · 8 tokens per session scan A 1031a6b719a3

Subscribe to this mod's changes

index is a command published in the GitHub repository stefan-jansen/claude-code-toolkit (85 stars, last pushed 1mo ago), licensed MIT. It adds 8 tokens to every session and 388 once invoked, about $0.0000 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.