tree-sitter-analyzer: Skill for Claude Code

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

tsa-structure is a skill for Claude Code from aimasteracc/tree-sitter-analyzer. It costs 133 tokens per session (754 once invoked), scanned A, original, MIT.

A file-structure analysis tool that shows a source file's classes, methods, functions, imports, and common patterns without displaying the full file body.

In plain words
What is it for?
Use it to outline files, find syntax-tree patterns such as decorated functions, identify design patterns, or classify a code change as a refactor, feature, bug fix, test, documentation change, or chore.
Why use it?
It lets you understand a file's shape quickly when reviewing unfamiliar code or a change.

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-structure/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-structure

README.md
[![agentmods](https://agentmods.dev/badge/skills/aimasteracc/tree-sitter-analyzer/tsa-structure/github.svg)](https://agentmods.dev/skills/aimasteracc/tree-sitter-analyzer/tsa-structure)
Your own site
<a href="https://agentmods.dev/skills/aimasteracc/tree-sitter-analyzer/tsa-structure"><img src="https://agentmods.dev/badge/skills/aimasteracc/tree-sitter-analyzer/tsa-structure/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tsa-structure

Your own site · 80×15
<a href="https://agentmods.dev/skills/aimasteracc/tree-sitter-analyzer/tsa-structure"><img src="https://agentmods.dev/badge/skills/aimasteracc/tree-sitter-analyzer/tsa-structure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 133 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 754 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00133 $0.00754
Opus 5.5 $0.00053 $0.00302
Sonnet 5.5 $0.00027 $0.00151
Haiku 4.5 $0.00013 $0.00075

Measured 2mo ago against content hash 26ad8362e016, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tsa-structure 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 2mo 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.

.claude/skills/tsa-structure/SKILL.md · 95 lines

How it starts

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

tsa-structure — File shape without the file body

Tool routing

Question Tool
Outline / table of classes + methods structure action=analyze
Run a tree-sitter query (e.g., all def nodes) search action=query
Detect design patterns (singleton, factory, …) health action=patterns
Classify a diff (refactor vs feature vs fix) edit action=classify

Procedure

File outline (most common)

structure action=analyze file_path="tree_sitter_analyzer/health_scorer.py"
# returns: {classes: [...], functions: [...], imports: [...]}

For a markdown-formatted table:

uv run tree-sitter-analyzer <file> --table full

Custom tree-sitter query

When you need something the built-in tools don't surface:

search action=query file_path="..." query_key="class"
# OR
search action=query file_path="..." query_string="(decorated_definition) @decorated"

--list-queries (CLI) shows all built-in queries available per language.

Diff classification

edit action=classify file_path="..." before_hash="abc" after_hash="def"
# returns: {classification: "refactor|feature|bugfix|test|docs|chore", confidence: 0.92}

Useful for PR descriptions and CHANGELOG categorization.

Pattern detection

health action=patterns file_path="..." patterns=["singleton", "factory", "observer"]

CLI equivalents

uv run tree-sitter-analyzer <file> --table full           # outline
uv run tree-sitter-analyzer <file> --query-key class      # built-in query
uv run tree-sitter-analyzer <file> --query-string "(...)" # custom query
uv run tree-sitter-analyzer <file> --code-patterns
uv run tree-sitter-analyzer --semantic-classify           # edit action=classify

Anti-patterns

  • DON'T read the whole file just to find "what classes are in it" — use the structure tool
  • DON'T write a custom tree-sitter query when structure action=analyze covers it
  • DON'T use edit action=classify on huge multi-purpose commits — split them first

Read the full file on GitHub · 95 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. 2mo ago First seen · 95 lines · 133 tokens per session scan A 26ad8362e016

Subscribe to this mod's changes

tsa-structure is a skill published in the GitHub repository aimasteracc/tree-sitter-analyzer (61 stars, last pushed today), licensed MIT. It adds 133 tokens to every session and 754 once invoked, about $0.0005 per session on Opus 5.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

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

memstack-development-code-reviewer

Use this skill when the user says 'review code', 'code review', 'check my code', 'audit this', 'review PR', 'review changes', 'what's wrong with this', or is requesting a structured review of code quality, security, performance, or maintainability. Do NOT use for refactoring plans or test generation.

cwinvestments/memstack · 75 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

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

shard

Use when the user says 'shard this', 'split file', or when working with files over 1000 lines.

cwinvestments/memstack · 28 tokens

pr-review-canvas

Create a OpenBitFun Canvas for reviewing a pull request, branch diff, or change set with Cursor-style diff cards, review maps, risk callouts, and focused reviewer flow. Use when the user asks for a PR review canvas, diff walkthrough, change-set overview, or visual review summary.

GCWing/BitFun · 64 tokens