From harness-anchor
Locates files and understands project structure using PROJECT-TOC.md, a machine-friendly index with one-line summaries per file. Checks staleness via git commit anchor.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-anchor:project-indexingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
`PROJECT-TOC.md` is the project's **machine-friendly index** — one line per file, ≤80 chars summary. Reading it is dramatically cheaper than `Glob`-ing the whole tree.
PROJECT-TOC.md is the project's machine-friendly index — one line per file, ≤80 chars summary. Reading it is dramatically cheaper than Glob-ing the whole tree.
Glob '**/*.ext' against more than a small directoryCheck PROJECT-TOC.md exists. If missing, the project is un-indexed. Suggest /index-project and fall back to Glob for the current question.
Check freshness. The TOC header contains:
<!-- generated-at-commit: <SHA> -->
Stale if either (both counts exclude PROJECT-TOC.md itself, so committing a
regenerated TOC does not re-stale it):
git diff --name-only <SHA> HEAD returns filesgit status --porcelain shows working-tree changes (untracked files count — the TOC doesn't cover them)Note: the SessionStart hook already computes toc_stale: true/false and injects it. If stale, prefer /index-project before deep navigation; for one-off questions, fall back to Glob.
Forest before trees. Read the ## Directory map first (one line per directory, with file + subdir counts) to find the right subtree, then grep/scan the ## Files entries under that path. On a large repo the SessionStart hook injects only the directory map (or just its top levels), so the per-file leaves are read on demand.
Open the file. Only after locating via TOC.
When you make significant structural changes (new directories, renames, large refactors):
node ${CLAUDE_PLUGIN_ROOT}/scripts/index-builder.mjs --target .
Or simply tell the user to run /index-project. Don't try to maintain the TOC by hand-editing — it's auto-generated.
<!-- generated-at-commit: abc123 -->
<!-- DO NOT EDIT BY HAND — run /index-project or scripts/index-builder.mjs -->
# PROJECT TOC
## Directory map
- `.` (root) — 2 files, 3 subdirs
- `src/` — 1 file, 1 subdir
- `src/util/` — 4 files
## Files
- `src/main.cpp` — entry point, parses CLI args, initializes Engine
- `src/util/log.h` — fmt-based logger
- ...
## Decisions
- 2026-05-15: switched from X to Y (see docs/decisions/0001.md)
The ## Decisions section is human-edited (long-lived architectural notes). The ## Files section is mechanical.
PROJECT-TOC.md typically fits within a few thousand tokens even for medium projects. The SessionStart hook adaptively injects the ## Directory map (or, for a small repo, the full ## Files) within the Tier 1 budget — and on a very large repo, only the top-level directories; the rest is read on demand. Don't ask the user to load the full TOC unless the budget allows.
Hard read rule: if PROJECT-TOC.md exceeds ~400 lines, do not read it whole — read the
## Directory map, then Grep the ## Files section for the subtree you need. A
full-file Read of a large TOC can spend tens of thousands of tokens on one lookup.
For deeper context-engineering / progressive-disclosure indexing approaches not covered here — invoke the docs-lookup skill. The current TOC algorithm is intentionally minimal; refinements (semantic chunks, embeddings) belong in a separate skill.
Typical entry query: progressive disclosure llm agent or agent harness indexing 2026.
using-harness-anchor — overall navigation, points here when files are soughtfeature-state-keeper — manages state files alongside the TOCnpx claudepluginhub redtropig/harness-anchor --plugin harness-anchorNavigate codebases via an MCP server: symbol search, reference/caller lookups, commit history, blame, diffs, and document RAG over 90+ formats without reading source files.
Navigates codebases using .codemap/ structural indexes to find symbol definitions (classes, functions, methods), explore file structures, and locate code by name. Enables targeted line-range reads to reduce token consumption.
Indexes the current project for optimized search with QMD semantic search and fast file suggestions. Run when entering a new codebase or after significant changes. Saves 60-80% tokens on exploration tasks.