tree-sitter-analyzer: Skill for Claude Code

.claude/skills/tsa-edit-safety/SKILL.md

tsa-edit-safety is a skill for Claude Code from aimasteracc/tree-sitter-analyzer. It costs 160 tokens per session (1,067 once invoked), scanned A, original, MIT.

A pre-edit check that examines a code file and returns a risk verdict—SAFE, REVIEW, CAUTION, or UNSAFE—before you change it.

In plain words
What is it for?
Use it before refactoring, adding a feature, fixing a bug, or renaming code, especially when several files may be affected.
Why use it?
It helps reveal dependencies, constraints, affected code, and missing tests before a larger edit. This can reduce manual searching through files, history, and differences.

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-edit-safety/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-edit-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/aimasteracc/tree-sitter-analyzer/tsa-edit-safety/github.svg)](https://agentmods.dev/skills/aimasteracc/tree-sitter-analyzer/tsa-edit-safety)
Your own site
<a href="https://agentmods.dev/skills/aimasteracc/tree-sitter-analyzer/tsa-edit-safety"><img src="https://agentmods.dev/badge/skills/aimasteracc/tree-sitter-analyzer/tsa-edit-safety/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-edit-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/aimasteracc/tree-sitter-analyzer/tsa-edit-safety"><img src="https://agentmods.dev/badge/skills/aimasteracc/tree-sitter-analyzer/tsa-edit-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 160 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,067 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.00160 $0.01067
Opus 5 $0.00080 $0.00534
Sonnet 5 $0.00032 $0.00213
Haiku 4.5 $0.00016 $0.00107

Measured 9d ago against content hash 4986fb1a0fb0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

tsa-edit-safety 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 9d 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-edit-safety/SKILL.md · 108 lines

How it starts

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

tsa-edit-safety — Decide before you edit

Replaces grep/read/git-diff/blame exploration with 2-3 MCP calls returning verdict + exact command to verify. 80% token reduction vs. manual recon.

When to use

  • Pre-edit gate for any non-trivial change (more than 5 lines or crossing files)
  • User asks any of: "is X safe to change", "what depends on Y", "what tests cover Z"
  • Right after git diff shows pending changes you want to evaluate

Don't use when:

  • One-line typo fix in a doc / comment
  • File you're literally creating from scratch (no callers)

Procedure

Step 1 — Single fan-out (parallel)

Call these 3 tools in ONE message:

  1. edit action=safe with file_path: "<the file>" and edit_type: "<refactor|add_feature|fix_bug|rename>"
  2. edit action=impact with mode: "staged" (or "branch" if pre-stage), scope to the file
  3. health action=file with file_path: "<the file>"

Step 2 — Read the verdict cascade

Verdict precedence (worst wins):

  • UNSAFE (from constraints or impact) → STOP, explain why, do not edit
  • CAUTION (high impact / dependencies / hot zone) → narrow scope, write tests first
  • REVIEW (moderate, often "no tests nearby") → write tests before edit
  • SAFE → proceed; still run the returned verification_command

Step 3 — Always quote the exact verification_command

The tools return a verification_command and stop_condition. Surface them verbatim to the user before editing. Example:

verdict: REVIEW verification_command: uv run pytest tests/unit/test_health_scorer.py -q stop_condition: tests exit successfully next_step: write a failing test for the new behaviour first

Common shapes

No tests nearby → escalate to REVIEW + recommend tdd workflow __init__.py edit → REVIEW automatically (re-exports) mod_count_30d >= 5 → CAUTION (hot zone — extra review attention) Constraint violation → UNSAFE (architectural rule — forbidden edge)

CLI equivalents (if MCP unavailable)

Read the full file on GitHub · 108 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. 9d ago First seen · 108 lines · 160 tokens per session scan A 4986fb1a0fb0

Subscribe to this mod's changes

tsa-edit-safety is a skill published in the GitHub repository aimasteracc/tree-sitter-analyzer (49 stars, last pushed yesterday), licensed MIT. It adds 160 tokens to every session and 1,067 once invoked, about $0.0008 per session on Opus 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

investigate

Systematic debugging with root cause investigation. Four phases: investigate, analyze, hypothesize, implement. Iron Law: no fixes without root cause. Use when asked to "debug this", "fix this bug", "why is this broken", "investigate this error", or "root cause analysis". Proactively invoke this skill (do NOT debug…

GCWing/BitFun · 112 tokens

memstack-development-performance-audit

Use this skill when the user says 'performance audit', 'why is it slow', 'optimize performance', 'page speed', 'Core Web Vitals', 'lighthouse', 'load time', or needs to diagnose and fix frontend or backend performance issues. Do NOT use for code reviews or security audits.

cwinvestments/memstack · 69 tokens

debug

Use this skill to locate a runtime bug. Add targeted instrumentation, collect reproduction evidence, and confirm the root cause before changing code.

GCWing/BitFun · 28 tokens

memorix-troubleshooting

Use when Memorix MCP, setup, project binding, HTTP control plane, hooks, skills, or agent integration is missing, stale, or failing.

AVIDS2/memorix · 36 tokens

qa

Systematically QA test a web application and fix bugs found. Runs QA testing, then iteratively fixes bugs in source code, committing each fix atomically and re-verifying. Use when asked to "qa", "QA", "test this site", "find bugs", "test and fix", or "fix what's broken". Proactively suggest when the user says a…

GCWing/BitFun · 160 tokens

assess-impact

Analyze blast radius before changing specific files. Use before refactoring core components, making breaking API changes, or modifying shared code to identify affected files and stakeholders.

panbanda/omen · 35 tokens