smith-index

A project index builder that scans source files and creates structured records showing what the codebase contains and which systems files belong to. A project index is a searchable map of the code, not a restriction on which files tools may inspect.

In plain words
What is it for?
Use it to rebuild, check, or update the .smith/index/ manifest. It supports full, partial, and Git-change-based indexing, and can migrate selected templates without changing source files.
Why use it?
It reduces reliance on informal descriptions when coding agents need project context. It also helps detect stale file information and misclassified system files.

Skill for Claude CodeCodex

Part of the smith plugin — 32 skills, 7 agents shipped together

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 skills/attckdigital/smith/smith-index
Any agent
npx skills add ATTCKDigital/smith --skill smith-index
Clone the repo
git clone --depth 1 https://github.com/ATTCKDigital/smith

Made for: Claude Code, Codex.

Or install smith, the plugin that ships this one along with the rest of its 32 skills, 7 agents.

Per session 109 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,095 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.00109 $0.05095
Opus 5 $0.00055 $0.02547
Sonnet 5 $0.00022 $0.01019
Haiku 4.5 $0.00011 $0.00509

Measured 3d ago against content hash bad16b886284, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

smith-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 3d 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.

skills/smith-index/SKILL.md · 482 lines

How it starts

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

Smith Index

Generate the deterministic project manifest at .smith/index/. The manifest replaces soft natural-language guidance with structured, indexed context — every Smith skill (/smith-new, /smith-bugfix, /smith-debug, /smith-explore, …) consults it through the same retrieval path (/smith-navigate + context-loader.sh).

Arguments: $ARGUMENTS

Manifest is a map, not a fence

.smith/index/ is a navigation aid, not a hard boundary. Skills like /smith-explore still grep the whole codebase when initial signals suggest broader impact. A stale or imprecise manifest must never block the calling session — it should degrade gracefully to vault-only context plus a soft warning.

Behavior

This skill is imperative — running it modifies .smith/index/ and (with --migrate-templates) constitution.md / CLAUDE.md. It does NOT modify any source file in the project. All generated state is confined to .smith/index/ plus optional .bak.<timestamp> files on template migration.

The actual work runs in ~/.smith/scripts/smith-index/run.py (called via ~/.smith/scripts/smith-index/run.sh), installed by scripts/install.sh from this repo. In the smith-repo dev tree these same files live at scripts/smith-index/run.py / run.sh — invoking either works. The skill markdown is the entry point that parses $ARGUMENTS, decides the mode, and shells out.

Modes (flags)

/smith-index — full rebuild (default)

  1. Walk the project from the current directory.
  2. Honor .gitignore (uses git ls-files when available; falls back to a manual exclusion list of node_modules/, .git/, .venv/, etc.).
  3. For each source file (.py, .js, .jsx, .ts, .tsx, .css, .html, .sh):
    • Resolve the parser via parser-lib.sh resolve_parser <ext> (prefers .smith/scripts/ over ~/.smith/scripts/ over the in-repo fallback).
    • Run the parser; capture JSON.
    • Compute SHA-256 of the first 4KB of source content (Q6 — hash field in .meta).
    • Render the .meta file at .smith/index/files/<mirrored>/<file>.meta.
    • Resolve the file's system via path-resolver.py (longest-prefix system-paths.json override → heuristic per spec Requirement 14).
  4. Per system: rewrite systems/<sys>.md once with all files bucketed in that system (sorted by lines desc; truncated at 60 entries with …and N more files per data-model.md section 3). Cap ≤80 lines.
  5. Rewrite top-level manifest.md (systems table + Stats). Cap ≤50 lines.
  6. Write checkpoint state to .smith/index/.smith-index-checkpoint.json every 25 files; delete on clean exit.
  7. Append one JSONL log line per stage per file to ~/.smith/logs/smith-index-<ISO8601>.jsonl per Rule 4.
  8. Write the schema-version marker at .smith/index/.schema-version containing the current schema version (read from ~/.smith/scripts/meta_schema_version.txt, falls back to scripts/parsers/meta_schema_version.txt in the smith-repo dev tree if the global install is missing). This file lets /smith-update detect projects whose manifest was generated against an older .meta schema and offer to regenerate. The marker is overwritten on every full rebuild (and on --incremental runs that write a fresh manifest); silently skipped if neither source file is found.
  9. Print a summary line: /smith-index: N files indexed (N succeeded, N failed, N skipped) in T.Ts.

Read the full file on GitHub · 482 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 482 lines · 109 tokens per session scan A bad16b886284

Subscribe to this mod's changes

smith-index is a skill published in the GitHub repository ATTCKDigital/smith (52 stars, last pushed 1mo ago), licensed MIT. It adds 109 tokens to every session and 5,095 once invoked, about $0.0005 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 skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens