tree-sitter-analyzer: Skill for Claude Code

.claude/skills/tsa-index/SKILL.md

tsa-index is a skill for Claude Code from aimasteracc/tree-sitter-analyzer. It costs 145 tokens per session (987 once invoked), scanned C, original, MIT.

An operations tool for maintaining a cached map of a codebase's abstract syntax tree, the structured representation of source code used for code queries.

In plain words
What is it for?
Use it to inspect cache status, refresh or rebuild the index, watch for changes, compare one file across commits, and check parser support.
Why use it?
It helps correct stale or incomplete code indexes, which can cause questions about callers or callees to return unknown results.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is aimasteracc/tree-sitter-analyzer's own configuration. It tells Claude Code how to work on tree-sitter-analyzer itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tree-sitter-analyzer configures →

Reuse

Borrowing it

Nothing to install: this file belongs to aimasteracc/tree-sitter-analyzer. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/aimasteracc/tree-sitter-analyzer/main/.claude/skills/tsa-index/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/aimasteracc/tree-sitter-analyzer

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tsa-index

README.md
[![agentmods](https://agentmods.dev/badge/skills/aimasteracc/tree-sitter-analyzer/tsa-index.svg)](https://agentmods.dev/skills/aimasteracc/tree-sitter-analyzer/tsa-index)
Your own site
<a href="https://agentmods.dev/skills/aimasteracc/tree-sitter-analyzer/tsa-index"><img src="https://agentmods.dev/badge/skills/aimasteracc/tree-sitter-analyzer/tsa-index.svg" alt="Measured on agentmods" height="20"></a>
Per session 145 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 987 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00145 $0.00987
Opus 5 $0.00072 $0.00494
Sonnet 5 $0.00029 $0.00197
Haiku 4.5 $0.00015 $0.00099

Measured 7d ago against content hash 3c219320bd01, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade C, and why

tsa-index scanned grade C with 1 finding 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 7d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

Replaces: manual `rm -rf .ast-cache && reindex` + reading plugin docs.
.claude/skills/tsa-index/SKILL.md · 100 lines

How it starts

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

tsa-index — Cache / index ops

Not a daily skill. Most agents never need it. Pull when index is stale or a language plugin behaves oddly.

Tool routing

Goal Tool
Status / stats of the AST cache index action=cache (mode=status)
Force rebuild index action=full
Incremental refresh index action=cache (mode=index)
Watch a directory and auto-refresh index action=cache (mode=watch_start)
AST-level diff of one file across commits edit action=ast_diff
First-time index for a freshly-cloned repo index action=auto
Full bulk reindex (large monorepo) index action=full
"Is the python plugin / swift plugin ready" project action=parser

Procedure

When to force rebuild

The auto-cache is usually correct. Force rebuild only when:

  • --callees / --callers returns callee_resolution: unknown consistently AND the symbols clearly exist (means imports not indexed)
  • Schema migration happened (e.g., new column added — pre-existing rows have defaults)
  • Files were renamed/moved en masse (mtime-based invalidation may miss this)
uv run tree-sitter-analyzer --ast-cache --ast-cache-mode index --ast-cache-force
# OR safer (preserves what works):
uv run tree-sitter-analyzer --ast-cache --ast-cache-mode index

AST diff

For structural change detection (not text):

edit action=ast_diff file_path="..." base_ref="HEAD~5" head_ref="HEAD"
# returns: {nodes_added: n, nodes_removed: n, nodes_modified: n,
#           classification_hints: [...]}

Useful for distinguishing pure formatting from real change.

Parser readiness

project action=parser language="swift"
# returns: {status: "stable|beta|stub", supported_queries: [...], limitations: [...]}

Read the full file on GitHub · 100 lines

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. 7d ago First seen · 100 lines · 145 tokens per session scan C 3c219320bd01

Subscribe to this mod's changes

tsa-index is a skill published in the GitHub repository aimasteracc/tree-sitter-analyzer (49 stars, last pushed yesterday), licensed MIT. It adds 145 tokens to every session and 987 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). 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

context7-docs

Fetch up-to-date documentation and code examples for any library, framework, SDK, CLI tool, or cloud service. Use whenever the user asks about a specific library — even well-known ones like React, Next.js, Prisma, Express, Tailwind, Django, or Spring Boot — because training data may not reflect recent API changes or…

upstash/context7 · 157 tokens

plan-eng-review

Eng manager-mode plan review. Lock in the execution plan — architecture, data flow, diagrams, edge cases, test coverage, performance. Walks through issues interactively with opinionated recommendations. Use when asked to "review the architecture", "engineering review", or "lock in the plan". Proactively suggest when…

GCWing/BitFun · 116 tokens

autoplan

Auto-review pipeline — reads the full CEO, design, eng, and DX review skills from disk and runs them sequentially with auto-decisions using 6 decision principles. Surfaces taste decisions (close approaches, borderline scope, codex disagreements) at a final approval gate. One command, fully reviewed plan out. Use when…

GCWing/BitFun · 152 tokens

design-review

Designer's eye QA: finds visual inconsistency, spacing issues, hierarchy problems, AI slop patterns, and slow interactions — then fixes them. Iteratively fixes issues in source code, committing each fix atomically and re-verifying with before/after screenshots. For plan-mode design review (before implementation), use…

GCWing/BitFun · 125 tokens

pre-landing-review

Pre-landing PR review. Analyzes diff against the base branch for SQL safety, LLM trust boundary violations, conditional side effects, and other structural issues. Use when explicitly asked for the specialized pre-landing workflow. Product /review requests are handled by OpenBitFun's unified Review mechanism instead.…

GCWing/BitFun · 75 tokens

miniapp-dev

A development guide for BitFun MiniApps, which are small applications that run inside BitFun. It covers creating new MiniApps as well as maintaining the MiniApp framework.

GCWing/BitFun · 145 tokens