tree-sitter-analyzer: Instructions file for Claude Code

CLAUDE.md

tree-sitter-analyzer CLAUDE.md is an instructions file for Claude Code from aimasteracc/tree-sitter-analyzer. It costs 9,473 tokens per session, scanned A, original, MIT.

Repository instructions for tree-sitter-analyzer, including coding rules and requirements for maintaining its tests. They restrict unnecessary files and require strong test checks.

In plain words
What is it for?
Guiding edits in the repository, enforcing file and security practices, adding tests to existing plugin test files, and applying rules during pre-commit and continuous integration checks.
Why use it?
They give coding agents clear boundaries and prevent duplicated test files or tests that pass without properly checking behavior.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

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.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 tree-sitter-analyzer CLAUDE.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/aimasteracc/tree-sitter-analyzer/claude-md"><img src="https://agentmods.dev/badge/instructions/aimasteracc/tree-sitter-analyzer/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9,473 This file is loaded in full into every session.
When invoked 9,473 The same file — it is already loaded in full.
Security scan A 0 findings. 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.09473 $0.09473
Opus 5.5 $0.03789 $0.03789
Sonnet 5.5 $0.01895 $0.01895
Haiku 4.5 $0.00947 $0.00947

Measured yesterday against content hash a2e300bb7bf3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tree-sitter-analyzer CLAUDE.md 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 yesterday.

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.md · 599 lines

How it starts

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

Ruflo — Claude Code Configuration

Rules

  • Do what has been asked; nothing more, nothing less
  • NEVER create files unless absolutely necessary — prefer editing existing files
  • NEVER create documentation files unless explicitly requested
  • NEVER save working files or tests to root — use /src, /tests, /docs, /config, /scripts
  • ALWAYS read a file before editing it
  • NEVER commit secrets, credentials, or .env files
  • Keep files under 500 lines
  • Validate input at system boundaries

Test Quality Rules — LOCKED (2026-06-28)

These rules exist because the test suite grew to 1,093 files / 21,000 tests with systematic duplication, coverage-chasing files, and weak assertions that let real bugs through (ref: 2026-06-08 TOON incident, §11). All 5 rules are enforced at pre-commit and CI. Violations block merge.

T-1: No new test files for existing plugins (BLOCKER)

🔒 LOCKED: When adding tests for an existing language plugin or MCP tool, ADD to the existing test_{plugin}.py file. Do NOT create new files.

Banned name patterns — pre-commit will reject any new file matching:

  • *_comprehensive*.py
  • *_edge_cases*.py
  • *_coverage_boost*.py
  • *_coverage*.py (unless it is a coverage measurement tool, not a test)
  • *_extended*.py
  • *_optimized*.py

Why: java grew to 38 test files for 498 lines of code. The root cause was "not sure if I covered it → add another file" without a deletion culture.

Legitimate exception: A new file is allowed ONLY when it tests a genuinely new subsystem (a new subpackage, a new MCP tool, a new CLI command) that has no existing test file. The file name must match the module it tests exactly.

Controlled pure-migration exception (user-approved; tracked: #1376): An oversized existing suite may be split into bounded behavior modules only when all of the following conditions hold:

  • A tracking issue explicitly authorizes the migration.
  • No original test cases are added, removed, duplicated, or weakened; preserve names, parameters, fixture scopes, markers, and helper dependencies.
  • Preserve exact before/after collected nodeid mappings, including class methods and parameter IDs, plus AST comparisons and negative mutation probes.
  • AST normalization may cover imports, source positions, real docstring translation, and separately declared UTF-8 corrections, never assertion or test-input data. Existing explicit encoding values must not change.
  • Every migrated target and new Python module must be at most 500 lines.
  • Shared helpers must be non-test modules, without duplicated production logic or star-imported test re-exports. Update live references and verification-family mappings so the old entry file cannot silently become a partial gate.

Read the full file on GitHub · 599 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. yesterday Changed · +2 lines · +145 tokens per session a2e300bb7bf3
  2. 1mo ago Changed · +39 lines · +407 tokens per session b820f19740fc
  3. 2mo ago First seen · 558 lines · 8,921 tokens per session scan A d4837fae98f3

Subscribe to this mod's changes

tree-sitter-analyzer CLAUDE.md is an instructions file published in the GitHub repository aimasteracc/tree-sitter-analyzer (61 stars, last pushed today), licensed MIT. It adds 9,473 tokens to every session, about $0.0379 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 instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,461 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,750 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens