Semantic folder index for codebase navigation. Commands: /toondex (create), /redex (update). IMPORTANT: If you see "PROPOSE_REINDEX" in your context (injected by SessionStart hook), when the user sends their next message, briefly ask if they want you to run /redex first or if you should continue answering their question. "Oh, I see you've discovered my meticulously organized archive."
76
Does it follow best practices?
If you maintain this skill, you can automatically optimize it using the tessl CLI to improve its score:
npx tessl skill review --optimize ./path/to/skillValidation for skill structure
"Oh, I see you've discovered my meticulously organized archive."
Create and maintain semantic folder indexes for efficient LLM codebase navigation.
| Command | Purpose |
|---|---|
/toondex | Create initial index.toon (interactive) |
/redex | Update index.toon with changes |
/toondex --stats | Show debug mode usage statistics |
Display ToonDex usage statistics (requires TOONDEX_DEBUG=1).
Implementation: Run the statistics script:
${CLAUDE_PLUGIN_ROOT}/scripts/show-stats.shOr directly from project root:
./plugins/toondex/scripts/show-stats.shThe script will:
TOONDEX_DEBUG=1 is not setSee docs/INDEX_SPEC.md for full spec. Summary:
# {folder-name}
{child-folder},{summary}
{child-folder},{summary}index.toon is created in each scanned folder, not just the rootindex.toon only lists its direct child folders (relative names, not full paths)index.toon, then drill into child index.toon filesWHEN THIS SKILL IS INVOKED, IMMEDIATELY START WITH STEP 1. EXECUTE THE STEPS - DO NOT JUST DESCRIBE THEM.
On success, respond with: "Best. Index. Ever."
Ask the user how deep to traverse:
How many levels deep should I scan? (default: 2)Common choices:
Use the Bash tool to scan directories. Detect the platform and use the appropriate command with the user's chosen depth ($DEPTH):
macOS / Linux (use /usr/bin/find to bypass shell aliases):
/usr/bin/find . -maxdepth $DEPTH -type d \
-not -path '*/node_modules/*' \
-not -path '*/.git/*' \
-not -path '*/dist/*' \
-not -path '*/.next/*' \
-not -path '*/build/*' \
-not -path '*/coverage/*' \
-not -path '*/vendor/*' \
-not -path '*/tmp/*' \
-not -name '.*' \
| sortWindows (PowerShell):
Get-ChildItem -Directory -Recurse -Depth $DEPTH |
Where-Object { $_.FullName -notmatch 'node_modules|\.git|dist|\.next|build|coverage|vendor|tmp' } |
Where-Object { -not $_.Name.StartsWith('.') } |
Sort-Object FullNamePlatform detection: Check the environment info (darwin = macOS, linux = Linux, otherwise assume Windows).
BEFORE analyzing, remove ALL of the following from the scan results. Do NOT analyze or index these:
.) — e.g. .git/, .cache/, .hive-mind/, .specify/node_modules/, vendor/dist/, build/, .next/, coverage/, tmp/If unsure whether a folder is generated, check for a .gitignore entry or absence from version control.
For each folder, create a summary with confidence score. See references/scoring-rubric.md for scoring details.
Analysis process:
Group results by parent folder. Each parent will get its own index.toon listing only its direct children:
Root level:
src,Application source code. [0.8]
docs,Documentation and specs. [0.9]
scripts,Build and deploy scripts. [0.7]
Inside src/:
app,Next.js App Router. Page routes layouts and API handlers. [0.9]
components,UI component library. Shadcn-based. [0.8]
legacy,Old code, purpose unclear. [0.2]For messy/unclear folders, you may comment: "Worst. Folder structure. Ever."
Rank children within each parent folder by importance:
Write an index.toon in every scanned folder that has children, starting from the root. Do this NOW — before reviewing low-confidence items. This ensures files exist even if the review is interrupted.
Each index.toon lists only its direct child folders (relative names). Strip confidence scores:
# project-root/index.toon
# {project-name}
src,Application source code.
docs,Documentation and specs.
scripts,Build and deploy scripts.# src/index.toon
# src
app,Next.js App Router. Page routes layouts and API handlers.
components,UI component library. Shadcn-based.
legacy,Old code, purpose unclear.For /redex, only rewrite the index.toon files in folders that changed.
Batch all items with confidence < 0.5 and present to user:
These summaries need review (low confidence):
| # | Path | Summary | Confidence |
|---|------|---------|------------|
| 1 | src/legacy | Old code, purpose unclear | 0.2 |
| 2 | src/utils/internal | Helper functions | 0.3 |
| 3 | lib/compat | Compatibility layer | 0.4 |
Edit summaries or confirm? Provide corrections as: "1: Correct summary here"If there are NO low-confidence items, skip the review.
If the user edited any summaries during review, update the affected index.toon files with the corrected entries.
Confirm to the user: "Best. Index. Ever." and list how many index.toon files were created.
After creating index.toon, ensure it's referenced so agents know to use it.
Check for existing file (in order of preference):
AGENTS.mdCLAUDE.md.claude/AGENTS.mdIf file exists: Add the index reference section if not already present:
## Folder Index
`index.toon` files contain semantic folder summaries (child,summary format, ordered by importance).
Start at the root `index.toon` and drill into subfolders as needed.If no file exists: Create AGENTS.md with minimal content:
# {project-name}
## Folder Index
`index.toon` files contain semantic folder summaries (child,summary format, ordered by importance).
Start at the root `index.toon` and drill into subfolders as needed.Important: Only add the reference once. Check for existing "index.toon" mention before adding.
Run the detection script or manually check:
./scripts/detect-changes.shOr compute manually:
LAST_REF=$(git log -1 --format="%H" -- index.toon)
git diff --name-only $LAST_REF..HEAD | cut -d'/' -f1-2 | sort -uFor each changed folder:
index.toon changes:
MODIFIED:
src/auth:
old: "JWT-based authentication."
new: "Clerk-based authentication. Role middleware." [0.8]
NEW:
src/analytics: "PostHog integration for user tracking." [0.7]
DELETED:
src/legacy (folder no longer exists)
Apply changes? [Y/n]Preserve order for unchanged entries. Insert new entries at appropriate priority position or append to end.
Configure hook to run scripts/detect-changes.sh on session start:
Claude Code (~/.claude/settings.json):
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/skills/toondex/scripts/detect-changes.sh"
}
]
}
]
}
}When you see PROPOSE_REINDEX in your context (injected at SessionStart):
Before I answer - your index.toon may be outdated (X files changed, Y days ago). Want me to run /redex first, or should I continue with your question?.toondex-state.json with proposal timestamp:{"last_proposal":"2025-02-04T15:30:00Z"}.toondex-state.json (gitignore this file)Combined evidence + self-assessment. See references/scoring-rubric.md for full rubric.
Quick reference:
| Score | Evidence | Self-Assessment |
|---|---|---|
| +2 | README exists | — |
| +2 | Read 3+ files | — |
| +1 | Recognized pattern | — |
| +1 | Single responsibility | — |
| +4 | — | High certainty |
| +2 | — | Moderate certainty |
| +0 | — | Low certainty |
Final: (evidence + self) / 10
| Range | Action |
|---|---|
| ≥ 0.7 | No review needed |
| 0.4-0.7 | Optional review |
| < 0.4 | User review required |
Do:
Don't:
First = most important for understanding codebase. Typically:
See Step 3 (Filter Results) — this is enforced during scanning, not optional.
ToonDex can track index.toon usage statistics to help verify that agents are actually using the navigation context provided by hooks.
Enable debug mode:
export TOONDEX_DEBUG=1View statistics:
/toondex --statsDebug mode tracks:
Hook Execution Counts (lifetime)
Index File Reads (actual usage)
Effectiveness Metrics
ToonDex Usage Statistics (Debug Mode)
=====================================
Session: 553805ff-7154-4292-8bf4-85920171b6ee
Started: 24m ago
Context Injections (Lifetime):
SessionStart: 42 fires (last: 2h ago)
PreToolUse (Grep): 18 fires (last: 5m ago)
SubagentStart: 7 fires (last: 5m ago)
PostToolUse: 156 fires
Index Files Read: 28 total reads (18 main agent, 10 subagents)
./index.toon: 15 reads (10 main, 5 subagent) - last: 2m ago
./.claude/skills/index.toon: 8 reads (5 main, 3 subagent) - last: 2m ago
./docs/index.toon: 5 reads (3 main, 2 subagent) - last: 10m ago
Effectiveness:
Context injected: 25 times
Files actually read: 28 times
Read/injection ratio: 1.12
📈 Good - context is being used!Debug mode has zero overhead when disabled (default):
TOONDEX_DEBUG=1 and exit early if not setWhen enabled, overhead is minimal:
jq mergingDebug data is stored in .toondex-state.json file (same file used for cooldowns):
{
"last_proposal": "2025-02-07T13:09:15Z",
"suggest_count": 5,
"last_suggest": "2025-02-07T18:30:22Z",
"debug": {
"enabled": true,
"session_id": "553805ff-7154-4292-8bf4-85920171b6ee",
"session_start": "2025-02-10T13:12:42Z",
"in_subagent": false,
"hooks": {
"session_start_fires": 42,
"pretooluse_fires": 18,
"subagent_start_fires": 7,
"posttooluse_fires": 156,
"last_session_start": "2025-02-10T13:12:42Z",
"last_pretooluse": "2025-02-10T13:14:28Z",
"last_subagent_start": "2025-02-10T13:14:29Z"
},
"index_reads": {
"total": 28,
"main_agent_reads": 18,
"subagent_reads": 10,
"files": {
"./index.toon": {
"reads": 15,
"main_agent": 10,
"subagent": 5,
"first_read": "2025-02-01T09:00:00Z",
"last_read": "2025-02-10T13:15:30Z"
}
}
},
"effectiveness": {
"context_injections": 25,
"actual_reads": 28,
"read_per_injection_ratio": 1.12
}
}
}Important: Add .toondex-state.json to .gitignore to avoid committing debug data.
b1698b3
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.