Borrowing it
Nothing to install: this file belongs to SShadowS/tree-sitter-al. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/SShadowS/tree-sitter-al/main/CLAUDE.mdgit clone --depth 1 https://github.com/SShadowS/tree-sitter-alWrote 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.
[](https://agentmods.dev/instructions/sshadows/tree-sitter-al/claude-md)<a href="https://agentmods.dev/instructions/sshadows/tree-sitter-al/claude-md"><img src="https://agentmods.dev/badge/instructions/sshadows/tree-sitter-al/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.
<a href="https://agentmods.dev/instructions/sshadows/tree-sitter-al/claude-md"><img src="https://agentmods.dev/badge/instructions/sshadows/tree-sitter-al/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.05291 | $0.05291 |
| Opus 5.5 | $0.02116 | $0.02116 |
| Sonnet 5.5 | $0.01058 | $0.01058 |
| Haiku 4.5 | $0.00529 | $0.00529 |
Grade A, and why
tree-sitter-al 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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 298 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
GOAL: A parser which parses AL code CORRECT, not just without errors. That is the first and foremost goal.
Guidance for Claude Code when working on this tree-sitter parser for AL (Microsoft Dynamics 365
Business Central). The .claude/rules/*.md files are loaded with this one; they own scanner,
keyword, attribute, debugging and test-failure detail and are not repeated here. One home per
fact: a rule lives here or in a rules file with its one-line why; its history and measurements
live in docs/ or in the comment at the rule in grammar.js / src/scanner.c.
Current numbers (tests, states, parser.c size, success rate) are NOT in this file. They drift
every branch. Measure them: ./tools/metrics.sh and ./parse-al-parallel.sh ./BC.History/ ..
Three different test counts circulated during 4.0.0 and two were arithmetic from a stale copy.
Git Commit Guidelines
Always include the error count in commit messages so a regression is visible in the log:
Fix XYZ pattern
[BC.History: 7 errors, 99.95% success]
Run the full parse before committing: ./parse-al-parallel.sh ./BC.History/ .
Commit all generated files together: tree-sitter generate writes src/parser.c,
src/grammar.json and src/node-types.json, all tracked. Stage them as a set or grammar.json
silently drifts.
Subagent briefs link docs/agent-brief-rules.md (blocked commands, process, environment, editing rules).
Quick Reference
# Validation (run before completing any task)
./validate-grammar.sh # generation, tests, orphan/duplicate detection, field invariants, oracle quick tier, censuses
./validate-grammar.sh --full # plus production AL parsing and the has_error sweep over it
# Zero-behavior-change gate for refactors (byte-identical parse trees). Take a FRESH baseline,
# named for the change: a stale snapshot reports a huge delta that has nothing to do with your edit.
./tools/tree-harness.sh snapshot ./BC.History .snapshots/baseline-<change> # ~16s
./tools/tree-harness.sh verify ./BC.History .snapshots/baseline-<change> # ~11s
# Query-coverage harness: the CST is lossless and values are queryable
python -m tools.query_coverage.qc run # regression gate, exits 1 on a new cluster
python -m tools.query_coverage.qc run --all # full picture
python -m tools.query_coverage.qc accept # freeze the current state as the baseline
# has_error gate: the ONLY thing that sees a MISSING node for a HIDDEN token (see below)
python tools/has_error_sweep.py --root ./BC.History/ # exit 0 clean, 1 errors, 2 cannot run
python tools/has_error_sweep.py --corpus-fixtures # every corpus case
# Config oracle (validate-grammar.sh Step 5e, CI job `config-oracle`): exit 0 clean, 1 finding, 2 cannot run
python -m tools.config_oracle run --tier quick # ~2-3 s
./tools/ts-lock.sh python -m tools.config_oracle run --tier full|resolve --root ./BC.History --root ./DC ... # full ~22 min
python -m tools.config_oracle replay # historical-defect replays
# Exit-code gates, root labelling, the two classification tsvs, lowering modules: tools/config_oracle/README.md
# Traversal helper (roadmap F0, docs/traversal.md); Step 5f is the census
python tools/traversal_census.py
./tools/ts-lock.sh python -m pytest tests/traversal -q
python tests/traversal/regen_expected.py # a -u: review every hunk of the diff
# Separator/continuation audit (B7a, docs/b7-separator-continuation-matrix.md); Step 5g is the census
python -m tools.b7_audit census --check
./tools/ts-lock.sh python -m tools.b7_audit run [--only X] [--check] # full ~3 h cold; NOT in validate
python -m tools.b7_audit report # must be byte-identical to the committed matrix
./tools/ts-lock.sh python -m tools.b7_audit assert --refresh
./tools/ts-lock.sh python -m pytest tools/b7_audit/tests -q # Step 5h
# After ANY change to src/parser.c, src/scanner.c or tools/config_oracle: `assert --refresh` per fix; a full `run`,
# then `report`, once per batch before merging (docs/agent-brief-rules.md, "Gate tiers").
# Perf (docs/performance-baselines.md). Speed DECISIONS come from `ab`, same session, ABBA; baselines are context.
python -m tools.perf ab --lib-a OLD --lib-b NEW --corpus dc
python -m tools.perf delta # structural production delta (B7b-3), tools/perf/delta-reviewed.tsv
# Workflow tools: use these, not ad-hoc versions
python tools/snip.py 'x := a + 1;' # cursor tree with fields, has_error, ERROR/MISSING/hidden; --sexp
python tools/snip.py --census --root ./BC.History # two-shape detector for node types; exit 1 if any flagged
./tools/metrics.sh [--vs REV] [--tests] # STATE/LARGE_STATE/SYMBOL_COUNT, parser.c size, grammar.js lines, tests
python tools/nodetypes.py show|who-has TYPE # node-types.json questions; `diff REV`
./tools/corpus-grep.sh [-E|-P] [-i] [-l|-c] PAT # sites over the four corpora (*.al only)
./tools/session-cleanup.sh --procs [--yes] # leftover processes older than 30 min
# Development cycle. Always through the lock: `./tools/ts-lock.sh tree-sitter ...`
tree-sitter generate
tree-sitter generate --report-states-for-rule - # rank rules by parser-state cost
tree-sitter test [-i PAT] [-e PAT] [--file-name F] [-d]
tree-sitter test -u # see the traps below
tree-sitter parse file.al -d > debug.log 2>&1 # .claude/rules/debugging.md
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.
- 4d ago Changed · +1 lines · +23 tokens per session 20d89a1f785e
- 7d ago Changed · -268 lines · -8,274 tokens per session 0f8aa822393e
- 9d ago Changed · +3 lines · +922 tokens per session 24e91329bfb5
- 22d ago Changed · +20 lines · +1,243 tokens per session 55581b24dad9
- 23d ago Changed · +2 lines · +648 tokens per session 35e897d36e8f
- 24d ago Changed · +4 lines · +510 tokens per session 4991fdccdeb4
- 25d ago Changed · +105 lines · +2,633 tokens per session c8278f674c0f
- 1mo ago Changed · +3 lines · +251 tokens per session 3064d33ea641
- 1mo ago Changed · +18 lines · +534 tokens per session bb66bfdeb653
- 2mo ago First seen · 410 lines · 6,801 tokens per session scan A 91f39753e323
tree-sitter-al CLAUDE.md is an instructions file published in the GitHub repository SShadowS/tree-sitter-al (24 stars, last pushed 4d ago), licensed MIT. It adds 5,291 tokens to every session, about $0.0212 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.
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).
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.
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).
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.
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).
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.