archlang CLAUDE.md

archlang CLAUDE.md is an instructions file for coding agents from ChanMeng666/archlang. It costs 3,136 tokens per session, scanned A, original, MIT.

Repository instructions for ArchLang, a language that turns floor-plan files into SVG drawings and other document formats. They explain the project's structure, commands, and rules.

In plain words
What is it for?
Use them when building, testing, or modifying ArchLang, including its TypeScript code, command-line tools, browser support, and shared project files.
Why use it?
They give an agent the current project context and prevent changes that would break required design or engineering rules.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/chanmeng666/archlang/claude-md
Clone the repo
git clone --depth 1 https://github.com/ChanMeng666/archlang

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/chanmeng666/archlang/claude-md.svg)](https://agentmods.dev/instructions/chanmeng666/archlang/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/chanmeng666/archlang/claude-md"><img src="https://agentmods.dev/badge/instructions/chanmeng666/archlang/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,136 This file is loaded in full into every session.
When invoked 3,136 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.03136 $0.03136
Opus 5 $0.01568 $0.01568
Sonnet 5 $0.00627 $0.00627
Haiku 4.5 $0.00314 $0.00314

Measured 4d ago against content hash 0d2ae126b7c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

archlang 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.

CLAUDE.md · 146 lines

How it starts

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

CLAUDE.md

Guidance for Claude Code (and any AI agent) working in this repository.

The canonical, always-current project status, architecture, commands, and conventions live in AGENTS.md — read it first. It is imported below so it loads with this file; for the exact shipped state and versions, defer to AGENTS.md → "Project status" and CHANGELOG.md rather than memory.

@AGENTS.md

Orientation (the rest is in AGENTS.md)

  • What this is: ArchLang — a small declarative language that compiles .arch floor-plan source to professional SVG (also DXF/PDF/PNG). Pure TypeScript, zero runtime dependencies, isomorphic (runs in Node and the browser). A published, deployed monorepo, not a WIP.
  • Build & run: npm run build · npm test (vitest) · npm run cli -- compile examples/studio.arch -o out.svg. A single root npm install bootstraps every workspace.
  • Brand: the logo is an "A" drawn as an A-frame house floor plan. brand/archlang-logo-master.svg is the byte-sacred source — every variant is a fill-swap only (never re-trace/simplify/re-fit path data, no small-size tier). The two public sites run the shared "The Compile Boundary" design system — a cool source surface and a warm sheet surface split by a compile seam, both LIGHT: there is no dark mode and no dark surface on either site. Its token block is duplicated byte-identically in docs-site/.vitepress/theme/style.css and playground/src/styles/tokens.css (change one, change the other). See ADR 0014 — which supersedes ADR 0010 §1/§2/§6/§7, so read 0010's carbon/mylar prose as history — and brand/README.md first.

Non-negotiable invariants (break these and CI fails)

  • compile() is pure, synchronous, deterministic. No I/O, no Date.now(), no Math.random() in src/ core; output is byte-for-byte stable and snapshot/golden-tested. Node APIs and real time are allowed only in src/cli.ts + src/cli/; everything else gets its environment via the World seam. Route number formatting through fmt() so floats don't drift. The parse-stage memo's PlanNode is shared and must never be mutated downstream — clone before mutating (a repair() in-place edit made output history-dependent; fixed in 51a47ee).
  • Don't hand-edit generated files. dist/, editors/*.tmLanguage.json, playground/src/arch-language.js, docs-site/.vitepress/theme/arch-highlight.js, docs/error-codes.md, docs/cli-reference.md, spec.llm.md, llms-full.txt, schemas/plan.schema.json, schemas/intent.schema.json, grammars/archlang.gbnf, and the twenty committed examples/*.svg the README embeds (the README_SVGS list in scripts/gen-example-svgs.ts) are generated — edit the source (src/grammar/tokens.ts, src/error-catalog.ts, src/manifest.ts, PLAN_JSON_SCHEMA, INTENT_JSON_SCHEMA, examples/, SKILL.md) and run the matching npm run gen:grammars / gen:errors / gen:cli / gen:spec / gen:llms / gen:plan-schema / gen:intent-schema / gen:gbnf / gen:example-svgs. CI fails on drift. The SVGs joined this list late and are the clearest case for it: hand-committed and never re-rendered, three of them showed the README a building compiled before four separate rendering fixes, and nothing was watching.
  • A generator's TEMPLATE can go stale even when check:drift is green. The gate compares generator output to the committed file — it proves reproducibility, not correctness. A generator that hardcodes a language fact reproduces the same wrong text forever: gen-llm-spec.ts shipped a v1.12 CLI + no strip for three releases, and gen-grammars.ts hardcoded a number regex without the unit suffixes. Derive from the source of truth (KEYWORDS/RULES/buildManifest()), never retype it, and give each generator a guard that fails when a source-of-truth entry has no rendering (as gen-llm-spec.ts now does for every KEYWORDS.control entry, not just element).
  • A derived POSITION comes from the shape, never from its bounding box or centroid. Six silent bugs shipped this way and were fixed in v1.25.0 — a label drawn off its own floor, a walk reported at half its true length, witness lines hanging metres off a sloped facade, a door swung into a wall its room does not touch, a fixture backed onto a wall outside its room, and every courtyard-wall window facing backwards. arch lint reported none of them. The grep that finds the next one is room.size/r.size.w with no nearby r.poly branch. Fix locally and in closed form — probe one wall thickness off each face and ask which side has floor — and never reach for the wall boolean union to answer a describe() question. Inventory: docs/research/2026-08-06-competitor-borrowing-roadmap.md §9.1.
  • Every new language form ships with a byte-identity law, pinned by test: a plan that does not use it renders, describes and lints exactly as before. site, the door kinds, zone, paper, polygon, arc, roof and void all have one. Prove it with a SHA-256 sweep over the shipped examples, not by eyeballing — and if a golden moves, that is a finding to explain before it is a diff to bless. Take the baseline with the same digest body the test will run, not a lookalike in a throwaway script: test/roof-void-byte-identity.test.ts's first attempt used a scratch script whose payload separator differed by one character and produced four "failures" over artifacts that were in fact byte-identical. And the sweep's payload is the whole agent-facing surface — SVG, describe() and lint() — because a form that quietly appends an empty key to every summary leaves the drawing untouched and is still a behaviour change for every arch describe --json consumer.
  • A drawn fixture symbol ignores its label, and fixture categories are DATA, not keywords. The 129 catalogued words across 83 families live in one FIXTURE_FAMILIES table (src/elements/fixtures-glyphs.ts) with their semantics in src/fixtures-catalog.ts; an uncatalogued word falls back to the labelled rectangle on purpose. Adding a family is a table row and a catalog entry — never a new element, never a switch arm. Keep the three catalog flags distinct: requiresWall means services only, directional means the symbol has a back worth turning to a wall, and underlay (a piece that lies flat and is stood on) is read only through the shared solidFurniture() predicate, so the overlap rule, the clearance rule, the nav grid and the per-room flood fill cannot disagree about what a rug is.
  • Errors are returned, never thrown for user-source problems: push a Diagnostic with a byte span and a catalogued E_*/W_* code (src/error-catalog.ts — a test enforces every raised code has an entry and vice-versa).
  • Adding an element = one module in src/elements/ exporting an ElementDef, registered in src/elements/defs.ts. Dispatch goes through the registry, not a switch.

Read the full file on GitHub · 146 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. 4d ago First seen · 146 lines · 3,136 tokens per session scan A 0d2ae126b7c2

Subscribe to this mod's changes

archlang CLAUDE.md is an instructions file published in the GitHub repository ChanMeng666/archlang (8 stars, last pushed today), licensed MIT. It adds 3,136 tokens to every session, about $0.0157 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-31.