/harness-anchor:project-indexingfrom 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.
Ships in harness-anchor. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole 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.
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 TOCWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
project-indexing, file-location, code-navigation, toc, git-anchor
npx claudepluginhub redtropig/harness-anchor --plugin harness-anchor14 skills in this plugin
/anti-hallucination-gatesUse before claiming done/fixed/passing — or before asserting something is absent: not installed, not available, no such function, couldn't find it. Default-FAIL runs both ways — every claim needs an evidence path. A negative claim must carry its search scope and observation date; state calibrated uncertainty when evidence is missing./capturing-golden-rulesUse when the same mistake or bad pattern recurs, when a code-review comment is really a convention worth enforcing, or when you catch AI-generated drift/slop and want it to never happen again. Encodes the lesson as a durable rule in golden-rules.md — the feedback-flywheel / harness-layer-learning ratchet — instead of a one-off fix. Generic (language-agnostic)./context-budget-disciplineUse when sessions run long, adding subagents, fetching large files, or planning context-heavy work. SELECT/WRITE/COMPRESS/ISOLATE discipline./cpp-build-systemsUse in C/C++ projects for build configure/errors, compile_commands.json generation, or selecting CMake/Meson/Make/Bazel commands./cpp-formattingUse in C/C++ projects for clang-format. Changed-lines-only; never reformat unchanged code mid-feature. .clang-format from root or LLVM baseline./cpp-sanitizersUse in C/C++ projects for crashes, hangs, UB, data races, memory errors. ASan/UBSan/TSan runtime checks. Build sanitizer config separately.Other plugins' skills for the same job