js2: Instructions file for Claude Code

CLAUDE.md

js2 CLAUDE.md is an instructions file for Claude Code from loopdive/js2. It costs 24,237 tokens per session, scanned B, original, Apache-2.0.

Project instructions for js2wasm, a TypeScript-to-WebAssembly compiler. WebAssembly is a compact format that lets code run in browsers and other runtimes.

In plain words
What is it for?
Use them when answering questions about the js2wasm codebase, changing its compiler, running tests, or working in separate Git worktrees.
Why use it?
They keep answers concise and explain project-specific terms, testing practices, development scratch work, and worktree rules consistently.

Instructions file for Claude Code

Written for Claude Code: SessionStart hook event. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

This is loopdive/js2's own configuration. It tells Claude Code how to work on js2 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 js2 configures →

Reuse

Borrowing it

Nothing to install: this file belongs to loopdive/js2. 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/loopdive/js2/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/loopdive/js2

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 js2 CLAUDE.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/loopdive/js2/claude-md"><img src="https://agentmods.dev/badge/instructions/loopdive/js2/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24,237 This file is loaded in full into every session.
When invoked 24,237 The same file — it is already loaded in full.
Security scan B 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.24237 $0.24237
Opus 5.5 $0.09695 $0.09695
Sonnet 5.5 $0.04847 $0.04847
Haiku 4.5 $0.02424 $0.02424

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

Security

Grade B, and why

js2 CLAUDE.md scanned grade B 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 today.

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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- **Pull-time budget/parallelism awareness (#2751)**: before claiming, run `node scripts/budget-status.mjs --pick`. It reports the **remaining token budget**, the current **parallelism** (active agents), the **per-agent
CLAUDE.md · 936 lines

How it starts

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

js2wasm

TypeScript-to-WebAssembly compiler using WasmGC.

⚠ Direction: standalone only — the JS-host lane is being sunset (project-lead decision, 2026-10-10)

Applies to every session and agent. All new work targets the two no-host targets only:

  • --target standalone: pure WasmGC, no JS host.
  • The Linear/WASI native backend: src/codegen-linear/ and the IR Linear backend.

Consequences:

  • No new JS-host work. Do not add JS-host IR paths, new host imports, or host-only fast paths. Do not prioritise test262 host-lane (gc) results over standalone.
  • Existing JS-host code stays until it is retired. Do not delete it opportunistically: removing it needs its own reviewed change. Until then, keep gc output byte-identical when you change shared code.
  • The "One native semantic core" principle below replaces the older "Dual-mode: JS host optional" one (#6708).

⚠ IR path: code quality comes first (project-lead rule, 2026-10-22)

Applies to every change under src/ir/ and to the codegen seams the IR calls. Quality outranks coverage: never take a claim faster at the cost of messier code, because the IR is meant to replace the legacy hacks, not reproduce them.

What "clean" means here:

  • Modular. One concern per module, following the IR layering (core, dialects, selection, lowering, backend). A new arm goes next to its siblings, in the same shape: same file layout, same naming, same helper pattern.
  • No duplication. Before adding a predicate, wrapper, lowering arm or helper, look for an existing one and extend it. Two arms that differ by a name or a flag become one parameterised arm. Copy-paste is a defect, not a shortcut.
  • No AI slop. That means:
    • no long files or functions (split by concern instead of growing them);
    • no inconsistent structure between sibling arms;
    • no defensive branches for cases that cannot occur;
    • no speculative abstractions with one user;
    • no dead parameters;
    • no comments that narrate the code instead of explaining why.
  • Size budgets are a ceiling, not a target. A func-budget-allow: or loc-budget-allow: grant is the exception, and the review must agree that the growth cannot reasonably be split.

Read the full file on GitHub · 936 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. today Changed · +1 lines · +155 tokens per session d90f799b7bb9
  2. 10d ago Changed · +1 lines · +40 tokens per session 19c00c912caf
  3. 14d ago Changed · +46 lines · +546 tokens per session 3c6afda8f501
  4. 19d ago Changed · +19 tokens per session 34f09fd63810
  5. 24d ago Changed 66657d0dceb7
  6. 27d ago Changed · +20 lines · +241 tokens per session 0a1a552282b5
  7. 1mo ago Changed 1d8970356896
  8. 1mo ago Changed 3a7f47beb53d
  9. 1mo ago Changed · +18 lines · +484 tokens per session 5086b4acebac
  10. 1mo ago First seen · 850 lines · 22,752 tokens per session scan B 82b70fa3a385

Subscribe to this mod's changes

js2 CLAUDE.md is an instructions file published in the GitHub repository loopdive/js2 (67 stars, last pushed today), licensed Apache-2.0. It adds 24,237 tokens to every session, about $0.0969 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

js2 CLAUDE.md compared with instructions from other repositories

js2 CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
js2 CLAUDE.mdloopdive/js2Instructions file67todayApache-2.0B24,237Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode