EXAMPLES
CLAUDE.md examples from real projects
The quickest way to see what a good CLAUDE.md looks like is to read real ones. These 10 come from open-source projects, from a vector database to the Rust language server, and each scored at least 67 out of 100 on the same scorecard as the repo grader.
Each is shown whole, at the commit it was read from and under its own license, with what it does well. How they were chosen is at the end.
Create my CLAUDE.md Describe your project or paste its README. Free to start, no account needed.
Updated
The files at a glance
Graded on September 29, 2026 on six ingredients: focus, project facts, rules and limits, file conventions, commands and examples, and a done check. Each file has its own section below.
| Project | Language | Lines | Grade | Worth borrowing |
|---|---|---|---|---|
| milvus-io/milvus | Go | 115 | 90/100 | A verification gate that forbids over-claiming |
| gfx-rs/wgpu | Rust | 75 | 87/100 | Where safety lives, and one source of truth |
| microsoft/playwright-python | Python | 101 | 80/100 | Generated files, one script, no push unasked |
| heygen-com/hyperframes | TypeScript | 121 | 80/100 | A skill router and a keep-in-sync list |
| gpujs/gpu.js | JavaScript | 102 | 77/100 | The reason behind every build choice |
| OpenZeppelin/openzeppelin-contracts | Solidity | 96 | 73/100 | Where AI suggestions go wrong, and what is off limits |
| keybase/client | Go | 39 | 70/100 | Short, strict and specific |
| alshedivat/al-folio | HTML | 48 | 70/100 | Imports AGENTS.md and adds only what is Claude’s |
| rtk-ai/rtk | Rust | 171 | 70/100 | A pre-commit gate and a rabbit-hole limit |
| rust-lang/rust-analyzer | Rust | 60 | 67/100 | An AI policy and a never-panic rule |
milvus-io/milvus: a vector database
Grade 90/100 · Go · 115 lines, inside Anthropic’s 200-line target · Apache License 2.0 · See it on GitHub
In the file: 10 exact commands, a test command, a check to run before finishing and 10 stated limits.
- A reading procedure before any change: the subsystem’s index document, then every sub-document it links for design work, then the code, and a stop to ask when the two disagree.
- A verification gate for changes meant to alter behavior: check the data coming in, trace each failure mode end to end, and claim only what was shown to work. It says plainly that a green happy path is not evidence.
- The specifics an agent would miss: the test flags without which the tests will not compile, the one logging package to use, and a test for deciding whether an error is the user’s input or the system’s.
# Milvus
Vector database. Go + C++ (internal/core/) + Rust (tantivy).
pkg has its own go.mod (module: `github.com/milvus-io/milvus/pkg/v3`). Run `go get` from `pkg/` when adding dependencies there, not from root.
## Architecture
Coordinators manage metadata and scheduling; nodes execute work.
- Coordinators: rootcoord, datacoord, querycoordv2 (note the v2 suffix in directory names)
- Nodes: proxy (user-facing), querynodev2, datanode, streamingnode
- All component interfaces defined in `internal/types/types.go`
## Subsystems & Code Map
Each subsystem has a **top-level doc** (overview with links to sub-documents) and multiple **sub-documents** (detailed design, invariants, interfaces). The top-level doc alone is NOT sufficient — it is an index, not the content.
### Mandatory reading procedure
When your task modifies, explains, depends on, or affects a subsystem below, execute these steps IN ORDER before responding or writing code:
**Step 1 — Read the top-level doc.** Identify all sub-documents it links to.
**Step 2 — Read sub-documents.** The scope depends on task type:
- **Design tasks** (new feature, architecture change, cross-component change): Read **every** sub-document under the subsystem. No exceptions — design requires full-picture understanding. Do NOT judge relevance yourself; read all of them.
- **Targeted tasks** (bug fix, single-component change, code explanation): Read sub-documents that cover the components your task touches. When uncertain whether a sub-document is relevant, read it.
**Step 3 — Read source code** listed in each doc's "Key Packages" section. At minimum read the files directly related to your task.
**Step 4 — Cross-check** documentation against code. If they contradict, STOP and ask the user to resolve before proceeding.
NEVER answer based on documentation alone or code alone. NEVER skip Step 2 — this is the most common failure mode.
### Subsystems Reference
- [**Observability**](docs/agent_guides/observability/README.md): Logging, metrics, tracing, and observability debug workflows.
- [**Streaming System**](docs/agent_guides/streaming-system/streaming-system.md): Write path, WAL, DDL/DCL execution, replication && CDC.
- [**Storage Paths**](docs/agent_guides/storage/path_contract.md): Read before changing storage paths, manifests, local migration, or GC.
## Testing
Go tests MUST use `-tags dynamic,test` and `-gcflags="all=-N -l"` (disable optimizations/inlining) or they won't compile / mockey-based monkey patching will fail:
```bash
go test -tags dynamic,test -gcflags="all=-N -l" -count=1 ./internal/querycoordv2/...
go test -tags dynamic,test -gcflags="all=-N -l" -count=1 ./internal/proxy/... -run TestXxx
```
Per-module shortcuts: `make test-querycoord`, `make test-proxy`, etc.
## Verification gate (MANDATORY before claiming "done" or pushing for review)
The reading procedure above tells you how to *enter* the code. This tells you how to *prove a change works*. A change is NOT verified by "it compiles + unit tests pass + success-path e2e is green." When the goal of a change is a **behavior** (retry / classification / routing / error-code propagation / fallback / cache invalidation / concurrency), execute these IN ORDER. Skipping them is the most expensive failure mode — it ships changes that are self-consistent but miss their purpose.
**G1 — Verify the data, not just your transform.** If your change adds a function/layer that maps or preserves a value X (an error code, a Status, a category, a flag), you only verified *your function*. Now verify its INPUT. Audit **every** place that constructs, throws, or rewrites X across the **whole repo** — not only the lines you edited. grep the escape hatches: `throw`, `.ToString()`/stringify, blanket fallbacks (catch-all → `Invalid` / `IOError` / `UnexpectedError`). A value destroyed or mis-set upstream makes your boundary logic dead code. Audit at the SOURCE of X, never only at the boundary that consumes it.
**G2 — Trace each real failure mode end-to-end.** Success-path e2e — even thousands of cases — does NOT exercise the failure modes a behavioral change exists for (S3 throttle, corrupt file, OOM, cancel, timeout, not-ready). For EACH one: either trace it by hand from origin → consumer, or fault-inject it, and confirm it lands in the intended bucket. "All green" on the happy path is not evidence the change works; it is only evidence you did not break the happy path.
**G3 — Do not over-claim.** Commit messages and PR body may assert ONLY benefits verified end-to-end via G1+G2. A benefit that depends on un-audited upstream or an un-triggered failure mode must be written as "follow-up" or "preserves codes for observability; retry wiring unverified" — never as achieved. A reviewer will verify your claim against the running system; over-claiming wastes their round.
**G4 — Adversarial self-review before human review.** Before pushing, do one pass asking: which failure mode have I NOT traced to its bucket? which upstream construction site of X have I NOT read? what would an adversarial reviewer grep for? Fix the gaps, or list them explicitly in the PR.
## Run Milvus Locally
```bash
scripts/start_standalone.sh # start standalone mode
scripts/start_cluster.sh # start cluster mode
scripts/stop_graceful.sh # stop
scripts/standalone_embed.sh # embedded standalone (no external deps)
```
## Code Conventions
- Error handling: use `merr` package, not fmt.Errorf — see mandatory procedure below
- Logging: use `github.com/milvus-io/milvus/pkg/v3/mlog` only; do not use `pkg/log`, standard `"log"`, direct `zap`, or `fmt.Println`. Every log call must pass a real `ctx` by priority: function parameter ctx > struct ctx > `context.TODO()`. Refer to [logging.md](docs/agent_guides/observability/logging.md).
- Import order: standard → third-party → github.com/milvus-io (enforced by gci)
- Config params: paramtable (`pkg/v2/util/paramtable`), config in `configs/milvus.yaml`
### Error handling (mandatory when originating, wrapping, or classifying errors)
Read [error_handling_guide.md](docs/dev/error_handling_guide.md) (decision tree,
Input-vs-System) and [error_handling_casebook.md](docs/dev/error_handling_casebook.md)
(the 7 mistake patterns) BEFORE writing the change. Non-negotiable rules:
1. Blame test: is the **request content itself** what forces this branch? → Input factory. A Milvus bug, or an internal/transient failure (not-ready, TOCTOU race), → System factory — even when a correct Milvus does reach it on a valid request (transient errors are System, and must stay retriable). "Looks like validation" is not the test.
2. Add context to an existing error with `merr.Wrap/Wrapf` ONLY — `WrapErrXxxErr(err, …)` masks the inner code; cause never goes into a format string.
3. Before marking anything InputError: grep `retry.Do` consumers. Before converting an `errors.New` sentinel to merr: grep `errors.Is` guards.
4. Pick codes from the existing family ranges in `pkg/util/merr/errors.go` (scan first; see the partition table in [error_sentinel_convention.md](docs/dev/error_sentinel_convention.md)); never hand-pick 20xx segcore codes.
5. Touched a wire projection, oldCode mapping, or metric label? Run the merr guard tests AND a full `make test-go` — contract changes break packages you didn't touch.
6. **C++ side (segcore / milvus-storage / cgo boundary) — the rules above are Go/merr; the same discipline applies in C++, and the verification gate (G1) is non-negotiable here.** The final class is decided at the `ThrowInfo` / `AssertInfo` / `SegcoreError` / arrow-`Status` / `LOON_*` **construction sites**, NOT at the cgo boundary translator. A boundary helper (`KnowhereStatusToErrorCode` / `ArrowStatusToErrorCode` / `LoonResultToErrorCode`) is correct ONLY if its inputs carry the right category — so audit upstream, not the helper. When a code must survive to the cgo boundary, grep every construction/throw/rewrite site and confirm none collapse it: `FailureCStatus` needs a real `SegcoreError` (an `ExecOperatorException` or `throw std::runtime_error(status.ToString())` destroys the code), and an upstream `IOError`-rewritten-as-`Invalid` (or catch-all → `IOError`) silently inverts transient vs permanent. Apply the blame test (rule 1) at EVERY such site, not only the ones you edit.
## PR and Commit Conventions
PR title format: `{type}: {description}`. Valid types: `feat:`, `fix:`, `enhance:`, `test:`, `doc:`, `auto:`, `build(deps):`.
PR body must be non-empty. Issue/doc linking rules:
- `fix:` — must link issue (e.g. `issue: #123`)
- `feat:` — must link issue + design doc under `docs/design-docs`
- Every Milvus feature should have a related design doc under `docs/design-docs`; submit the doc in this repository and link it from the Milvus feature PR.
- `enhance:` — must link issue if size L/XL/XXL
- `doc:`, `test:` — no issue required
- 2.x branch PRs must link the corresponding master PR (e.g. `pr: #123`)
DCO check is required. Always use `-s` so the developer's Signed-off-by is appended last:
```
git commit -s -m "commit message
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
```
`-s` auto-appends `Signed-off-by: <developer>` at the end. The developer MUST be the final sign-off, not the AI.
## Generated Files — Do Not Hand-Edit
- Mock files (`internal/mocks/*`, `mock_*.go`): regenerate with `make generate-mockery-{module}`
- Proto files (`pkg/proto/*.pb.go`): regenerate with `make generated-proto-without-cpp`gfx-rs/wgpu: a GPU API written in Rust
Grade 87/100 · Rust · 75 lines, inside Anthropic’s 200-line target · Apache License 2.0 · See it on GitHub
In the file: 11 exact commands, a test command, a check to run before finishing and 13 stated limits.
- Explains where safety lives: which crates handle untrusted input for web browsers, and that validation must stay at the safe boundary because the lowest layer does none.
- Right-sizes testing: targeted GPU tests with a filter while working, the full suite only when GPU behavior changes, and every failure reported rather than assumed unrelated.
- Keeps one source of truth: AGENTS.md is the original and this CLAUDE.md a generated copy, with the command that syncs them and the one that checks they match.
# wgpu Project Structure wgpu is a GPU API written in pure rust. Changes of any significance need to apply across the stack. - `naga` is our shader translator. It is responsible for consuming and translating untrusted shaders to trusted shader code. - `wgpu-types` are the common types used on both Native and WASM. - `naga-types` holds the shader-language types, such as target versions and binding maps, that `naga` and `wgpu-core` both use. - `wgpu-naga-bridge` converts between `naga` and `wgpu-types`. It maps wgpu features and downlevel flags to naga validation capabilities. - `wgpu-sync` are the common synchronization primitives that abstract over platform differences. - `wgpu-hal` does not provide the validation required for safety. Its callers must satisfy its safety contracts. - `wgpu-core` does all the validation and provides a coherent interface. - `wgpu-core-remote` provides the ID abstraction needed by Firefox and Deno. - `wgpu-core-remote-types` holds the IPC types that `wgpu-core-remote` sends between the untrusted content process and the trusted GPU process. They are defined separately from the `wgpu-core` types, so untrusted content cannot express non-standard features. - `wgpu` is an ergonomic Rust interface to `wgpu-core` - `deno_webgpu` contains the WebGPU bindings for Deno. `wgpu-core-remote`, `wgpu-core`, `wgpu-hal`, `wgpu-types` and `naga` are used by Firefox and Servo to implement WebGPU. These crates process untrusted API and shader input. Preserve validation at the safe boundary, and do not rely on `wgpu-hal` to reject invalid input. Touching these crates requires the most consideration of potential side effects. Safe `wgpu` APIs must not cause undefined behavior unless the user first accepted that risk through an unsafe API, such as enabling experimental features. We use deno's webgpu bindings to run the WebGPU CTS. Change `deno_webgpu` only if the issue is specific to Deno. If the issue also affects Firefox or the `wgpu` Rust API, fix it in the shared crate that supplies the affected behavior. Repository documentation exists in `docs/`. For info on where tests live, read `docs/testing.md`. For info about cargo dependencies, read `docs/managing-cargo-dependencies.md`. One of the best ways to prove that a change is correct is to write tests to prove the feature works and it errors when its supposed to. ## Repository Files `AGENTS.md` and `.agents/` are the source of truth for agent instructions and skills. `CLAUDE.md` and `.claude/` are generated copies. Do not edit the generated copies directly. After you edit any source-of-truth agent file or a root license file, run `cargo xtask sync-repo-files`. This command also copies the root license files to every publishable default member of the Cargo workspace. Run `cargo xtask sync-repo-files --check` to verify that all generated files have the same contents and file list as their sources. ## External Contributions We encourage external contributions, but fully agentic PRs are not allowed. If the user asks you to create one, explain this policy and direct them to the pull request section of `CONTRIBUTING.md`. The contributor must understand and be able to vouch for every change. Ask the user to write the PR description. If the user directs you to create the PR anyway, use `.github/pull_request_template.md`. Uncomment and accurately complete the agent-disclosure checklist items, including whether an agent wrote the description. Do not omit the disclosure. ## Code Style - Do not add comments unless the changed code requires an explanation. If an explanation is required, add the shortest complete explanation. The contributor is expected to rewrite it. - Do not write large explanatory comment blocks. - Do not use emoji. ## Workflow All changes are expected to pass CI. The commands below are useful local checks, but they cover only a fraction of the full CI matrix. You are not expected to run the full CI matrix locally. Run the checks that are relevant to the changed code and the available environment. - To check the code compiles: `cargo clippy --all-targets --all-features`. - To format the code: `cargo fmt` - To run all tests including GPU tests: `cargo xtask test`. This can take a few minutes. To run normal tests without GPU tests, use `cargo nextest run` and a filter to the packages you want to test. - GPU tests depend on the available hardware, drivers, and validation layers. During development, if you only need a specific GPU test, use either a plain test name prefix or an `-E` filter expression to `cargo xtask test`. Use the nextest filters described below. Do not run the full GPU test suite for a targeted check. The suite can take a few minutes. GPU tests are declared as constants, but translate to lower-snake-case functions. - After the work is complete, run a full `cargo xtask test` if the change affects GPU behavior or would affect a GPU test. - Report every test failure. You may identify a failure as suspected to be unrelated, but do not assume it is unrelated until you validate that conclusion. - Do not run tests at the `trunk` revision without explicit permission. A baseline test run can take a while. - For more thorough testing, you can run `cargo xtask cts --backend <backend>`. Only do this if you are explicitly asked to run the CTS. - Never commit anything without being asked, ever. If you are asked to make a commit, _never_ co-author yourself. - Use the WebGPU and WGSL specifications as a reference to determine the correct behavior. Do not assume that a behavior is correct just because the CTS expects it. Use the `webgpu-specs` skill if you need to check either spec. ### Nextest filters `cargo xtask test` forwards its extra arguments to cargo-nextest. - A plain positional filter matches test names that contain the filter text. A unique test name prefix is usually sufficient. - `-E 'test(name)'` matches test names that contain `name`. - `-E 'test(=name)'` matches the complete test name. - `-E 'test(/expression/)'` matches test names with a regular expression. - In an `-E` expression, `package(name)` restricts the package and `binary(name)` restricts the test binary. Restricting binaries can make test startup quicker. - Use `&` for intersection, `|` for union, and `!` for exclusion. Use parentheses to group expressions. - For example, `-E 'binary(wgpu-gpu) & test(buffer) & !test(map)'` selects tests in the `wgpu-gpu` binary whose names contain `buffer` but not `map`. - Quote each `-E` expression so the shell does not interpret its operators. ## Changelog We maintain a changelog in CHANGELOG.md. Changes should be noted in the changelog if they are user-visible (changes to documented public APIs, significant bug fixes, or new functionality). We generally do not consider changes to wgpu-core, wgpu-hal, wgpu-core-remote, or wgpu-core-remote-types worthy of changelogs, unless a `wgpu` user is expected to interface with them directly. Changelog descriptions should be concise. If you are not sure whether something should be in the CHANGELOG or you are not sure how to describe the change, ask the user for guidance.
microsoft/playwright-python: Playwright for Python
Grade 80/100 · Python · 101 lines, inside Anthropic’s 200-line target · Apache License 2.0 · See it on GitHub
In the file: 10 exact commands, a test command, a check to run before finishing and 12 stated limits.
- Names the generated files and the one script that regenerates and validates them, and says where to fix a mismatch instead of editing generated code.
- Hands its recurring high-stakes job, moving to a new Playwright release, to a dedicated skill rather than packing the steps into this file.
- Draws hard lines around anything public: no comments on GitHub without approval, and no push without an explicit instruction, even with a pull request open.
# CLAUDE.md Guidance for Claude when working in this repository. ## What this is Python bindings for [Playwright](https://playwright.dev). The Python client talks JSON over a pipe to the Node-based driver bundled in `playwright/driver/`. The pipe protocol is defined upstream in `packages/protocol/src/protocol.yml`. ## Layout - `playwright/_impl/` — hand-written client implementation (one module per object: `_browser.py`, `_page.py`, `_locator.py`, `_network.py`, etc.). Edit these to add or change behavior. - `playwright/async_api/_generated.py`, `playwright/sync_api/_generated.py` — **auto-generated**. Never edit by hand; rerun `./scripts/update_api.sh` after changing `_impl/` or the driver. - `scripts/generate_api.py`, `scripts/generate_async_api.py`, `scripts/generate_sync_api.py`, `scripts/documentation_provider.py` — codegen and validation. They diff the Python implementation against Playwright's `api.json` (provided via the `PW_API_JSON` env var; see `scripts/update_api.sh`) and abort if either side is out of sync. - `scripts/expected_api_mismatch.txt` — explicit allowlist of "documented in JS, not in Python" or "named differently in Python" gaps. Lines that no longer apply must be removed. - `tests/async/`, `tests/sync/` — pytest suites. Most new tests are added to the async file with a sync mirror. - `DRIVER_VERSION` — the single source of truth for which Playwright release the driver is assembled from (one line, the `playwright-core` npm version, e.g. `1.61.0`, no `v` prefix). Read by `setup.py`, `scripts/build_driver.py`, and CI. The wheel build downloads `playwright-core` at this version from npm plus the matching Node.js binary and assembles the per-platform bundles — no source build. The version is baked into the staged bundle filenames (`driver/playwright-<version>-<suffix>.zip`), so it doubles as the build cache key. - `NODE_VERSION` — the Node.js version bundled with the driver (one line, e.g. `24.16.0`). Maintained at roll time by `scripts/update_node_version.py` (latest LTS, mirroring upstream's `utils/build/update-playwright-node.mjs`). - `scripts/build_driver.py` — assembles the per-platform driver bundles into `driver/` by downloading the `playwright-core` npm package (`DRIVER_VERSION`) and the official Node.js binaries (`NODE_VERSION`). Fetches `playwright-core` with `npm pack` (needs Node.js/npm on PATH; honours a root `.npmrc`) and the Node.js binaries over plain HTTP; invoked from `setup.py`'s `bdist_wheel` with the target platform's suffix (no arg builds all six). - `api.json` is **not** shipped in the bundle and is never written into the driver — `scripts/update_api.sh` generates it from a nearby `microsoft/playwright` checkout (`$PW_SRC_DIR`) into a temp file and passes it to codegen via `PW_API_JSON` (read by `scripts/documentation_provider.py`). Needed only when regenerating the API, never at runtime. - `ROLLING.md`, `CONTRIBUTING.md` — human-facing setup and roll docs. ## Setup `CONTRIBUTING.md` has the full sequence. The short version (needs Node.js and npm for the driver build): ```sh python3 -m venv env && source env/bin/activate pip install --upgrade pip pip install -r local-requirements.txt pip install -e . python -m build --wheel # downloads playwright-core @ DRIVER_VERSION + Node.js and assembles the driver pre-commit install ``` If the system lacks `python3-venv`, `uv venv env` is an acceptable substitute (then `uv pip install --python env/bin/python --upgrade pip`). ## Common commands - Regenerate `_generated.py`: `./scripts/update_api.sh` (runs codegen + pre-commit on the generated files). - Lint everything: `pre-commit run --all-files`. - Type-check: `mypy playwright`. - Run tests: `pytest --browser chromium [-k name]`. Browsers are installed via `playwright install chromium` (do **not** use `--with-deps`, which requires sudo). When changing public API, edit `_impl/`, then run `./scripts/update_api.sh`. The script regenerates `_generated.py` and validates against Playwright's `api.json` (which it generates from `$PW_SRC_DIR`). If validation fails, fix the mismatch in `_impl/`, in `expected_api_mismatch.txt`, or in `documentation_provider.py` — not by hand-editing `_generated.py`. ## Rolling Playwright to a new version This is the recurring high-stakes task. Use the dedicated skill: → **[`.claude/skills/playwright-roll/SKILL.md`](.claude/skills/playwright-roll/SKILL.md)** It documents the full process: the upstream commit-range diff over `docs/src/api/`, how to classify each commit (PORT / MISMATCH / N/A), how to handle the `langs:` filter, the recurring failure modes, and the tests/sync-mirroring conventions. ## Working on PRs - Never post comments, replies, or reviews on GitHub PRs/issues under my account without my explicit approval. Draft the proposed text and wait for me to approve before sending. ## House style - Don't hand-edit generated files. - Don't add `# type: ignore` or modify `_generated.py` to silence pyright; fix the source of the mismatch. - New public methods on impl classes need a sync test mirror under `tests/sync/`. - Keep `expected_api_mismatch.txt` minimal — every entry needs a one-line rationale comment above it. - Prefer `locals_to_params(locals())` for forwarding optional kwargs to channel sends, matching the rest of the codebase. ## Commit Convention Before committing, run `mypy playwright` and fix errors. Semantic commit messages: `label(scope): description` Labels: `fix`, `feat`, `chore`, `docs`, `test`, `devops` ```bash git checkout -b fix-12345 # ... make changes ... git add <changed-files> git commit -m "$(cat <<'EOF' fix(asyncio): do not deadlock in atexit handler Fixes: https://github.com/microsoft/playwright-python/issues/12345 EOF )" git push origin fix-12345 gh pr create --repo microsoft/playwright-python --head username:fix-12345 \ --title "fix(asyncio): do not deadlock in atexit handler" \ --body "$(cat <<'EOF' ## Summary - <describe the change very! briefly> Fixes https://github.com/microsoft/playwright-python/issues/12345 EOF )" ``` Never add Co-Authored-By agents in commit message. Never add "Generated with" in commit message. Never add test plan to PR description. Keep PR description short — a few bullet points at most. Branch naming for issue fixes: `fix-<issue-number>` **Never `git push` without an explicit instruction to push.** Applies even when a PR is already open for the branch — additional commits are immediately visible to reviewers. Commit locally, report what was committed, and wait. Only push when the user's message contains "push", "upload", "create PR", "ship it", or equivalent.
heygen-com/hyperframes: video rendering from HTML
Grade 80/100 · TypeScript · 121 lines, inside Anthropic’s 200-line target · Apache License 2.0 · See it on GitHub
In the file: 3 exact commands, a test command, a check to run before finishing and 6 stated limits.
- Routes the agent to the right skill for each kind of request, and says which skills to install by default.
- Lists every place that must change together when a skill is added or renamed, so no copy of its description goes stale.
- Pins the conventions an agent would guess wrong: bun rather than npm or pnpm, deterministic rendering with no clock reads or unseeded random numbers, and two checks that must pass before work is complete.
# Hyperframes
Open-source video rendering framework: write HTML, render video.
## Skills
This repo ships 21 AI agent skills via [vercel-labs/skills](https://github.com/vercel-labs/skills). Install them before writing compositions — they encode framework-specific patterns that generic docs don't cover. **Default to the core set**: the `/hyperframes` router installs each creation workflow on demand; install all 21 only when the user explicitly asks for the full set.
```bash
npx hyperframes skills update # default: installs/refreshes the core set — workflows install on demand
npx hyperframes skills # all 21 published skills at once — only on explicit request
npx skills add heygen-com/hyperframes # interactive picker (terminal only; --all also pulls the 6 repo-internal skills under .claude/skills)
npx skills add heygen-com/hyperframes --skill <name> # just one (bare name, no leading slash)
```
`skills add` resolves the skills.sh registry blob, which can lag `main` by hours, so a freshly added skill may be a little behind. `npx hyperframes skills update` installs from the current `main`; prefer it when freshness matters.
**`/hyperframes` is the entry skill — read it first.** It's the capability map for the domain skills below, the intent layer that confirms every creation brief up front, AND the intent router for the creation workflows. The full README skills section mirrors this list; keep them in sync (see "Skill catalog maintenance" below).
### Creation workflows
- `/product-launch-video` — any **website** URL (or a pre-written script / text brief in no-capture mode) → a product launch / promo video, or a site tour / showcase featuring the site's own captured screens; up to ~3 min (sweet spot ~30-90s).
- `/faceless-explainer` — arbitrary text, **no URL and no website capture** → faceless explainer, up to ~3 min (sweet spot ~30-90s); every visual is LLM-invented (typography / abstract graphics / diagram / data-viz).
- `/pr-to-video` — a GitHub PR (URL / `owner/repo#N` / "this PR") → code-change explainer, up to ~3 min (changelog / feature reveal / fix / refactor). A PR link, not a product website.
- `/embedded-captions` — an existing talking-head video (MP4) → the same footage with captions / subtitles added (verbatim rail + embedded climax, or pure-cinematic embed); the footage itself is untouched (no NLE-style editing).
- `/talking-head-recut` — an existing talking-head / interview / podcast video (MP4) → the same footage packaged with designed **graphic overlays** (kinetic titles, lower-thirds, data callouts, pull-quotes, side panels, PiP) synced to the transcript; the clip plays unchanged underneath, footage untouched. For plain captions/subtitles → `/embedded-captions`.
- `/motion-graphics` — a short (typically under 10s) design-led **motion graphic**, motion-is-the-message, no narration: kinetic type, a stat / number count-up, a chart, a logo sting, a lower-third / overlay, or an animated tweet / headline / captured-page highlight; rendered to MP4 or a transparent overlay. Longer / narrated / custom → `/general-video`.
- `/music-to-video` — a **music track** (audio file, video to pull audio from, or one generated from a mood brief) → beat-synced video (lyric / slideshow / kinetic promo). Music drives pacing; user-supplied images / videos are cut onto the same beat grid.
- `/slideshow` — a **presentation / pitch deck / interactive deck** — discrete slides, fragment reveals, branching, hotspot navigation, presenter mode. Output is a navigable deck, not a rendered video.
- `/general-video` — fallback for any other video creation (title card, longer brand / sizzle reel, multi-scene montage, static loop, custom composition) and the home of **companion mode** — co-create with the full HyperFrames toolbox; the original hyperframes flow — design → plan → layout → build → validate, any length.
- `/remotion-to-hyperframes` — port an existing Remotion (React) composition to HyperFrames HTML. One-way migration, not creation.
### Domain skills (loaded on demand)
Atomic capabilities the creation workflows compose against — pull one when you need that specific layer:
- `/hyperframes-core` — the composition contract: `data-*` timing attributes, `class="clip"`, tracks, sub-compositions, variables, framework-owned media playback, determinism rules. Read before writing composition HTML.
- `/hyperframes-animation` — all animation knowledge: atomic motion rules, scene blueprints, transitions, runtime adapters (GSAP default, plus Lottie / Three.js / Anime.js / CSS / WAAPI / TypeGPU).
- `/hyperframes-keyframes` — seek-safe keyframe authoring across runtimes: GSAP timelines, CSS keyframes, Anime.js, WAAPI, FLIP, paths, masks, SVG morph/draw, text trails, 3D depth; plus `hyperframes keyframes` diagnostics for surfacing and verifying rendered motion.
- `/hyperframes-creative` — non-animation creative direction: `frame.md` / `design.md` handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns.
- `/media-use` — the media OS: resolve any media need (BGM, SFX, image, icon, logo, voice, color grade, LUT) into a frozen local file or paste-ready block + ledger record; generate via TTS / music / image models when the catalog misses; transcribe, caption, remove backgrounds, and reuse assets across projects. One shared `scripts/audio.mjs` engine + manifest tracking; keeps search noise on disk.
- `/hyperframes-audio` — mix the audio already placed in a composition: voiceover carve (dip a music bed only in the bands the voice occupies, static or dynamic, level match included), the effect chain (EQ, compressor, limiter, gate, saturation, delay, reverb, chorus, phaser, bitcrush), automation envelopes on volume or any effect parameter, and submix buses (`<hf-audio-group>`) that carry one chain, fader and automation clock for several tracks at once. Sourcing the audio is `/media-use`; this is what happens to it afterwards.
- `/hyperframes-cli` — CLI dev loop: `init`, `add`, `lint`, `check`, `snapshot`, `preview`, `render`, `publish`, `doctor`, `lambda` (AWS Lambda cloud rendering).
- `/hyperframes-registry` — search, install and wire registry blocks and components into compositions via `hyperframes catalog` / `hyperframes add`. Load it before hand-building any named look, effect, treatment or transition: the search ranks the whole hosted registry with nothing installed. Covers authoring a new block or component to contribute upstream.
- `/figma` — import Figma assets, tokens, components, and storyboard sections → reconstructed motion (frames read as states, not slides) (REST/CLI) plus Motion animations (MCP) and shaders (MCP source / native export) into a composition.
## Skill catalog maintenance
When adding a new skill, or substantially renaming / repurposing an existing one, update all agent-facing discoverability surfaces in lockstep:
1. The skill list above (CLAUDE.md) AND the workflow list in the root `AGENTS.md` (it carries workflows only, no domain-skill section) AND the `## Skills` section in `README.md` AND `docs/guides/skills.mdx` (rendered at [hyperframes.heygen.com/guides/skills](https://hyperframes.heygen.com/guides/skills)) AND the two setup tables that compress the same descriptions — `docs/prompting/overview.mdx` ("One-time setup") and `docs/quickstart.mdx`. Out-of-date entries silently kill discovery. This list is also the sync set for a **changed contract**, not just an added or renamed skill: a reworded `description:` has to be pushed to every surface or the compressed copies start asserting the opposite of the skill.
2. The scaffolded project template `packages/cli/src/templates/_shared/CLAUDE.md` + `AGENTS.md` — written into every `hyperframes init` project, so a stale entry there ships to users. The two template files must stay byte-identical.
3. If the skill changes the routing surface for "make a video" requests, also update the routing table + intent layer in `skills/hyperframes/SKILL.md` AND that workflow's own route file, `skills/hyperframes/references/routes/<workflow>.md`. One file carries both halves: the input/output/trigger contract the router reads before the workflow is installed, and its interview entry (must-haves, conditionals, deferred asks, run-shape). The older `references/workflow-catalog.md` and `references/route-briefs.md` are now "moved" stubs pointing at `routes/` — don't edit them.
4. Mirror the Router / Creation workflows / Domain skills grouping across all surfaces so a skill always lives in the same column.
5. Skill count appears in the README and CLAUDE.md intro lines ("20 AI agent skills…") — update on add/remove. The `docs/guides/skills.mdx` page and the CLI templates deliberately omit a count to avoid drift; keep them count-free.
The skill's own `SKILL.md` frontmatter `description:` is the source of truth for the one-line "use when" blurb; copy from there into the catalog rather than paraphrasing.
## Build & Test
```bash
bun install # Install dependencies (NOT pnpm — do not create pnpm-lock.yaml)
bun run build # Build all packages
bun run test # Run all tests
```
### Linting & Formatting
Uses **oxlint** and **oxfmt** (not eslint, not prettier, not biome).
```bash
bunx oxlint <files> # Lint
bunx oxfmt <files> # Format
bunx oxfmt --check <files> # Check formatting (CI / pre-commit)
```
Always lint and format changed files before committing. Lefthook pre-commit hooks enforce this automatically.
### Composition Validation
After creating or editing any `.html` composition:
```bash
npx hyperframes lint # Static HTML structure check
npx hyperframes check # Browser gate (headless Chrome — runtime errors, layout, motion, WCAG contrast)
```
Both must pass before previewing or considering work complete.
## Project Structure
```
packages/
cli/ → hyperframes CLI (create, preview, lint, render)
core/ → Types, parsers, generators, linter, runtime, frame adapters
engine/ → Seekable page-to-video capture engine (Puppeteer + FFmpeg)
player/ → Embeddable <hyperframes-player> web component
producer/ → Full rendering pipeline (capture + encode + audio mix)
shader-transitions/ → WebGL shader transitions for compositions
studio/ → Browser-based composition editor UI (read packages/studio/AGENTS.md first)
registry/
blocks/ → Installable sub-composition scenes (50+)
components/ → Installable effects and snippets
examples/ → Starter project templates
docs/ → Mintlify documentation site (hyperframes.heygen.com)
skills/ → AI agent skill definitions
```
## Key Conventions
- **Package manager**: bun (not pnpm, not npm for workspace operations)
- **Commit format**: Conventional commits (`feat:`, `fix:`, `docs:`, `refactor:`, `test:`)
- **TypeScript**: Avoid `any` and `as T` assertions. Prefer type guards and narrowing.
- **Compositions**: HTML files with `data-*` attributes. Clips need `class="clip"`. Register one paused GSAP root timeline per composition on `window.__timelines`. Scene timelines manually added to that root must not be paused, or they will not advance when the root is seeked.
- **Frame Adapters**: Animation runtimes plug in via the seek-by-frame adapter pattern. GSAP is the primary adapter.
- **Deterministic rendering**: No `Date.now()`, no unseeded `Math.random()`, no render-time network fetches.
## Documentation
- Docs: https://hyperframes.heygen.com/introduction
- Catalog (50+ blocks): https://hyperframes.heygen.com/catalog/blocks/data-chartgpujs/gpu.js: GPU computing in JavaScript
Grade 77/100 · JavaScript · 102 lines, inside Anthropic’s 200-line target · MIT License · See it on GitHub
In the file: 8 exact commands, a test command, a check to run before finishing and 2 stated limits.
- Gives the reason behind each build choice, such as why the Node version is pinned and why two modules are aliased rather than left external, so an agent does not undo them.
- Says which test failures are expected on which platforms, so an agent does not chase noise, and asks for proof that a regression test fails without the fix.
- Walks through a release, names the step people skip, and explains two errors that look alarming but are not.
# Working on gpu.js ## Build environment Node 22. Node 23 breaks headless-gl, and early 22.x hits a vinyl-fs bug, so pin something recent within 22. `npm run make` runs build → beautify → minify → build-tests, from plain Node scripts in `scripts/`. It rewrites `dist/` and regenerates `test/all.html`, so run it before anything that loads the browser bundle, and commit `dist/` with the change. Individual steps are available as `npm run build`, `minify`, `beautify`, `build-tests`; `npm run dev` serves the repo for test/all.html. Bundling is rolldown, minifying is terser. Two things there are load-bearing: - `gl` and (for the core build) `acorn` are aliased to `scripts/empty-module.js`. That is browserify's old `.ignore()`. They must be aliased, not `external` — external leaves a live `require()` that throws in a browser. - both the bundle and the minified bundle are run through terser with `ascii_only`. acorn ships its unicode tables already escaped, but rolldown decodes string literals and prints the characters, which puts ~68k raw UTF-8 bytes in the bundle. Serving that without a matching charset is #743/#744. The banner interpolates `new Date()`, so two builds are never byte-identical — compare `dist/` with the `@date` lines normalized. All four bundles of one run share a timestamp: the minify step passes the banner through (terser keeps it via `output.comments`, since it carries `@license`) rather than prepending its own. Prepending is what used to put the banner in the minified files twice, seconds apart. Note `beautify` reformats `src/`, so `npm run make` can produce unrelated whitespace churn in files you did not touch. That is expected. ## Tests `npm test` runs qunit over `test/issues test/internal test/features`. The suite has platform-dependent failures that are **not** regressions: - **Linux/Mesa**: a set of failures baselined in `.github/known-test-failures.txt`. CI compares against it with `.github/compare-test-failures.js` and fails only on *new* failures, so the raw exit code is not the signal. - `test/internal/math.random.js` "unique every time" is flaky (seed collisions, related to #850). A single failure there is not meaningful. Confirm any new regression test actually catches the bug by reverting the fix and watching it fail — a test that passes both ways is worse than none. ## Real devices Bugs that only reproduce on real GPU drivers are a recurring theme here; three were found this way in 2.19.8 alone, none of which any CI runner could have caught. See the Testing section of README.md for how to run it. ```bash npm run make # devices load dist/, so build first npm run test:browserstack # real iOS/Android node test/browserstack/run.js --dry-run --browsers=desktop # inspect caps, no session ``` Credentials live in gitignored `test/browserstack/.credentials.json`, and as `BROWSERSTACK_USERNAME` / `BROWSERSTACK_ACCESS_KEY` repo secrets for CI. BrowserStack groups runs into one build by `buildName`, distinguishing them by `buildIdentifier`. Keep `buildName` stable — a name that varies per run creates a separate build every time and there is no single `gpu.js` entry to find in the dashboard. ## Releasing Every step below is required; skipping the npm publish is the usual mistake — 2.19.5 and 2.19.7 have tags and GitHub releases but were never published, so their release notes tell people to install a version that does not exist. ```bash npm version <version> --no-git-tag-version # package.json only npm run make # dist/ carries the version header npm test # expect the known baseline git add -A && git commit -m "chore: Release <version>" git tag <version> git push origin develop && git push origin <version> gh release create <version> --title "<version>" --notes-file <notes> ``` ### Publishing `npm publish` requires 2FA and prompts for a one-time code. Two things that otherwise waste time: - `npm view gpu.js version` lags a publish by up to a minute. `curl -s https://registry.npmjs.org/gpu.js` is authoritative. - `E404 PUT ... not found` on publish means the npm token expired, not that anything is wrong with the package. Run `npm login`. ### Pushing workflow files Changes under `.github/workflows/` are rejected unless the credential pushing them carries the `workflow` scope. Push with one that does, or add the file through the GitHub API.
OpenZeppelin/openzeppelin-contracts: a smart contract library
Grade 73/100 · Solidity · 96 lines, inside Anthropic’s 200-line target · MIT License · See it on GitHub
In the file: 15 exact commands, a test command, a check to run before finishing and 13 stated limits.
- Opens with why the rules exist: this code is a base that others inherit, so functions stay overridable and the public API stays stable.
- Lists what the linter already enforces so the agent spends no words on it, then the conventions no tool checks.
- Names the areas where AI suggestions are often plausible but wrong, such as cryptography and storage layout, and the work that is out of scope for AI altogether.
# openzeppelin-contracts — Claude project guide
This repository is a **Solidity smart contract library**: reusable `abstract contract` and `library` implementations meant to be inherited and extended by downstream projects. It is not a deployed product. Most conventions exist because code here is a base for others: functions must be overridable, argument types must not constrain inheritors, and the public API must not force a particular call context on child contracts.
Read [`GUIDELINES.md`](./GUIDELINES.md) first — it is the human contributor spec and authoritative. This file is for what is specific to Claude-assisted work, plus the conventions not fully documented elsewhere.
Before preparing a contribution, also read [`CONTRIBUTING.md`](./CONTRIBUTING.md) thoroughly. Non-trivial changes must be discussed in an issue before a PR is opened.
## Repo map
| Path | Purpose |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `contracts/` | Library source. Subdirectory layout (`token/ERC20/`, `access/`, `utils/`, …) mirrors the public API. |
| `contracts/mocks/` | Mocks used by tests. Mirrors `contracts/`. Manual mocks only — see the `testing` skill. |
| `contracts/interfaces/` | ERC interfaces in their pristine spec form. |
| `test/` | Hardhat + Chai tests (`.test.js`), shared behaviors (`.behavior.js`), and Foundry tests (`.t.sol`). |
| `contracts-exposed/` | Auto-generated `$ContractName` wrappers from `hardhat-exposed`. Gitignored. Do not edit. |
| `fv/` | Certora specs (`fv/specs/*.{conf,spec}`), harnesses, and `make`-applied patches. |
| `scripts/generate/` | Procedurally generated `.sol` files (Arrays variants, Checkpoints, EnumerableSet, …). Source of truth is the template, not the generated file. |
| `scripts/checks/` | CI checks: `inheritance-ordering.js`, `pragma-validity.js`, generation diff, storage layout. |
| `docs/` | AsciiDoc sources used by the OZ documentation site. Per-module `README.adoc` files in `contracts/**/` are also rendered. |
| `.changeset/` | Per-PR changelog entries consumed by the release workflow. |
| `audits/` | Historical third-party audit reports, one per release. Reference only. |
| `.claude/skills/` | Skills specific to working in this repository, loaded by AI assistants per task. See `CONTRIBUTING.md`. |
## Commands
| Task | Command |
| ---------------------------------------- | ----------------------------------------------------------------------- |
| Compile | `npm run compile` |
| Tests (JS + Solidity) | `npm test` |
| Foundry tests only (forge defaults) | `forge test -vvv` |
| Halmos symbolic tests | `halmos --match-test '^symbolic\|^testSymbolic' -vv` |
| Lint (JS + Sol) | `npm run lint` / `npm run lint:fix` |
| Coverage | `npm run coverage` |
| Inheritance order check | `npm run test:inheritance` |
| Pragma validity check | `npm run test:pragma` |
| Generated-file freshness check | `npm run test:generation` |
| Regenerate procedural contracts | `npm run generate` |
| Add a changelog entry | `npx changeset add` |
| Run a single Certora spec | `node fv/run.js <SpecName>` (apply harnesses first: `make -C fv apply`) |
## What linting via solhint already enforces (don't re-state in code review)
`solhint-plugin-openzeppelin` + `scripts/solhint-custom/index.js` enforce, on `contracts/**/*.sol` (mocks and tests are exempt):
- **State variables are `private`** (`constant`/`immutable` are the only exceptions).
- **Underscore prefix matches visibility**: `private`/`internal` state vars and functions get `_`; `public`/`external` do not. Library internal functions do NOT get `_`.
- **No `external virtual`** (except fallback). The `public` default makes this redundant; flagged by `no-external-virtual`.
- **Libraries expose only `internal`/`private`**.
- **Interfaces start with `I`**, contracts use CapWords, events use CapWords, modifiers/params mixedCase.
If a lint rule already catches it, don't waste tokens explaining it — fix and move on.
## Always-on conventions
These apply to every change and are not lint-enforced:
- **File header version line**: don't add or edit the `// OpenZeppelin Contracts (last updated vX.Y.Z) (path)` line — release tooling (`scripts/release/update-comment.js`) maintains it automatically based on `git diff` between the previous tag and `HEAD`. The SPDX line is your only responsibility.
- **Pragma**: don't pick the floor by hand. Run `npm run pragma` and let `scripts/minimize-pragma.js` walk the dependency graph, compile against every candidate `solc`, and write back the lowest version that works for each file (`>=` prefix for interfaces, `^` for implementations and libraries). Bumping the floor casually can introduce opcodes (`mcopy` in 0.8.24, etc.) not supported on all target chains — the script's output is the safe answer.
- **Imports**: 100% named, curly-brace, relative paths within `contracts/`. No wildcards.
- **Inheritance order is globally consistent**: if you change an `is A, B, C` list, run `npm run compile && npm run test:inheritance` before pushing.
- **Changesets**: every PR that changes contract behavior needs one. Skip for NatSpec-only, internal refactors with no user-visible effect, or pure repo plumbing.
- **Procedurally generated files**: never hand-edit a file whose header says "procedurally generated from `<template>`". Edit the template under `scripts/generate/templates/` and run `npm run generate`. CI runs `test:generation` to enforce.
- **Backward compatibility**: released contracts are inherited downstream and transpiled into the `-upgradeable` package. Don't change existing `public`/`external` signatures, event or error shapes, or the storage layout of existing contracts. Changes are additive; deprecate rather than delete. Breaking changes are a maintainer decision tied to a major release.
- **Dependencies**: this library has no third-party dependencies that translate to the user, and nothing that could change behavior out from under it. Don't add an npm or Solidity dependency or a new external import without maintainer sign-off; reuse existing `contracts/utils/` helpers first. Code that needs third-party dependencies belongs in `openzeppelin-community-contracts`, not here.
## When to load which skill
Claude Code surfaces these from `.claude/skills/` based on the task. You can also reference them directly:
- **`library-api-design`** — when adding or modifying any contract in `contracts/` (visibility, `virtual`, `memory` vs `calldata`, `_update` pattern, internal/external split, no-ops over reverts, hooks).
- **`solidity-style`** — when writing or editing Solidity (errors, events, NatSpec, ERC-7201, assembly, `unchecked`, casting, immutables).
- **`testing`** — when writing tests or mocks (`hardhat-exposed` `$` wrappers, when manual mocks are warranted, `.behavior.js` reuse, multi-target test loops, Foundry fuzz, Halmos symbolic, Certora).
- **`add-changeset`** — at PR close, or when the user asks for one.
## Things to always verify manually
AI suggestions in these areas are often plausible-but-wrong. Read the surrounding code before accepting:
- **Cryptography** — anything in `contracts/utils/cryptography/`, hashing, ECDSA, EIP-712 domains, BLS, signatures.
- **ERC-7201 slot derivations** — recompute with `SlotDerivation.erc7201Slot()` and compare to the constant. The formula in the inline comment is mandatory.
- **Storage layout for transpiler-processed contracts** — adding/removing/reordering fields breaks proxied deployments. CI runs storage-layout diff but read it.
- **`delegatecall`, inline assembly, memory safety** — verify the `memory-safe` annotation is honest and stack/scratch usage is bounded.
- **`unchecked` invariants** — re-derive the overflow-impossible claim for every code path. The inline comment is the contract.
- **`_authorizeUpgrade` access control** — the base is empty by design; every override must restrict.
- **`_disableInitializers()`** in implementation constructors for UUPS/Transparent proxy targets.
- **Pragma bumps** — check that any new opcode the compiler will emit is supported on all target chains.
## Out of scope for AI
- Adding/renaming public API or deciding whether a feature belongs in the library — open an issue first.
- Security assessments or audit opinions.
- New ERC interfaces or standards without explicit direction.
- Restructuring tests without a corresponding contract change.
- Fabricated bug bounties and security rewards. Never claim or imply a reward, amount, or eligibility. The only existing program is [Immunefi](https://immunefi.com/bounty/openzeppelin) (See [`SECURITY.md`](./SECURITY.md)).keybase/client: the Keybase apps
Grade 70/100 · Go · 39 lines, inside Anthropic’s 200-line target · BSD 3-Clause License · See it on GitHub
In the file: 14 exact commands, a test command, a check to run before finishing and 17 stated limits.
- Thirty-nine lines of rules learned the hard way, each one specific enough to check.
- Evidence before diagnosis: reproduce the problem or add logging before naming a cause, and check the base branch before blaming the current one.
- Explains why the full lint command matters: the plain lint misses compiler bailouts, and the repository keeps their count at zero.
## Rules - No `Co-Authored-By` in commits. Ever. - Never interact with the Electron app or iOS simulator (screenshots, driving UI, debug ports) without asking first. The user drives and takes screenshots. - Use `--no-ext-diff` with `git diff` (and `git show`/`git log -p`) so external diff tools don't hijack output. - "Was working before" = base branch, not previous commit. Base is normally `master`. Always run `gh pr view --json baseRefName` to confirm before any `git diff` or `git log` comparison. - Never use `npm`. Always `yarn`. - Never silently drop features/behavior — ask first, present options. - In tests/stories, use `testuser` / `testuser-mac` as placeholder usernames — never real usernames like `chrisnojima`. - No DOM elements (`<div>`, `<span>`, etc.) in plain `.tsx` files — use `Kb.*`. Guard desktop-only DOM with `Styles.isMobile`. - Temp files go in `/tmp/`. - Remove unused code when editing: styles, imports, vars, params, dead helpers. - Comments: no refactoring notes; only add when context isn't obvious from code. - Exact versions in `package.json` (no `^`/`~`). - Keep `react`, `react-dom`, `react-native`, `@react-native/*` in sync with Expo SDK. - When updating deps: edit `package.json` → `yarn` → `yarn ios:pod:install`. - After editing `rnmodules/react-native-kb/`: run `yarn sync:kb-modules` before building. `shared/node_modules/react-native-kb` is a copy, not a symlink, and Xcode compiles the copy — skipping this builds stale sources and reports errors against code you already fixed. `rnmodules/kb-common/` needs no sync (the Podfile references it by path). - After editing `protocol/avdl/` or `protocol/bin/enabled-calls.json`: from `protocol/`, run `node ./bin/generate-ts.ts && cp ./js/rpc*.tsx ../shared/constants/rpc` and commit the regenerated `shared/constants/rpc/rpc-gen.tsx`. - Never hand-edit generated code (rpc-gen, protocol output, mocks, codegen'd files of any kind). Edit the source it's generated from and rerun the generator. CI regenerates and fails on any diff. - When updating `electron`: run `shared/desktop/extract-electron-shasums.sh <version>`. - Keep an open PR's description in step with its branch. Whenever new commits change what the PR does or how (a new fix, a changed approach, a removed piece, new tests or evidence), rewrite the affected sections with `gh pr edit --body-file`, and the title if the scope moved. It should read as a description of the current diff, not a changelog. Skip it for commits that don't change the story (lint, renames, test placeholders). - Never patch `react-native` itself (patch-package or node_modules edits): we use prebuilt RN core and don't compile its source, so native-side patches never take effect. Work around RN core bugs in app code. ## Debugging - Evidence before diagnosis: when the user reports seeing something, never answer "that can't happen" from reading code. Reproduce it or add logging first, and only then name a cause. - For a user-reported runtime bug, check whether it reproduces on the base branch before blaming the current branch. (Lint, tsc and test failures after our changes are still ours.) - Before calling code dead, search the whole repo (desktop, native, Go callers, string-built names), not one directory. - Prefer fixes that keep underlying state truthful (e.g. a UI-level hold) over changing state semantics, unless asked. ## Working Directory Repo root is `client/`. TS source lives in `shared/`. Always use absolute paths for file ops. For Bash: always `cd shared/` first. ## Superpowers - Plans created by superpowers skills go into `plans/` at the repo root. - Never commit plan/spec/design docs. They're scratch for the current effort — leave them untracked and delete them when the work lands. ## Validation After TS changes (from `shared/`): `yarn lint:all` (= `yarn lint` && `yarn lint:bailouts` && `yarn tsc`). Plain `yarn lint` is eslint only and does NOT catch react-compiler bailouts — no compiler rule is wired into `eslint.config.mjs`, so bailouts only surface via `lint:bailouts`. `lint:bailouts` also flags components the compiler cannot name (an `isMobile ? arrow : arrow` ternary is never compiled at all, so nothing in it is memoized — name both branches instead), and memo scopes keyed on the whole props object (a `props.x` read inside a callback, or a destructure below one, makes the compiler key on `props` itself, so the cache never hits — read every prop through one destructure at the top, above every callback). Repo baseline is 0 bailouts and 0 whole-props deps; keep it there. When debugging visually, skip until fix is confirmed. Never delete the ESLint cache. Before reporting any TS change complete: run `yarn lint:all` and get it clean. Do NOT run `/code-review` while iterating, building, testing, or debugging — only once the change is about to be pushed (commit for a PR, push, or open a PR). At that point, first get both `yarn lint:all` and `yarn test:unit` passing — never review, push, or open a PR with either failing. Then, if the diff has real logic in it, run `/code-review high` against the diff and fix what it finds; if a finding is wrong, say why instead of applying it. Skip the review for trivial diffs (a config/JSON line, a codegen resync, a typo) and say you skipped it.
alshedivat/al-folio: a Jekyll theme for academic sites
Grade 70/100 · HTML · 48 lines, inside Anthropic’s 200-line target · MIT License · See it on GitHub
In the file: 12 exact commands, a test command, a check to run before finishing and 1 stated limit.
- Imports AGENTS.md with one line, then adds only what is specific to Claude or too long for the shared file.
- Explains a setup choice that looks odd: the Docker build writes inside the container, because writing back across the mounted folder caused deadlocks.
- Warns against trusting version numbers quoted in prose, its own included, and says where to read the real ones.
# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. @AGENTS.md `AGENTS.md` (imported above) is the **authoritative** agent entry point: change routing, the stop sign for gem-owned paths, the three silent failure modes, and the validated command set. Keep it short and ecosystem-neutral. Cross-repo architecture — the wrapper/tag/gem delegation table, feature gating, the v1 config contract, local overrides — lives in [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md); area-to-gem ownership lives in [`docs/BOUNDARIES.md`](docs/BOUNDARIES.md). **Read those three before editing anything.** Everything below is Claude-specific or longer-form operational detail that does not belong in the short entry point. Do not restate facts from those files here — link to them. ## Daily dev loop ```bash bundle install # ruby gems bundle exec jekyll serve # dev server → http://localhost:4000/al-folio/ (NOTE baseurl) bundle exec jekyll build --baseurl /al-folio # production-style build to _site/ bash test/integration_distill.sh # run ONE integration test (any of the seven in test/) npm run test:visual:update # refresh playwright snapshots after intentional UI change bundle exec al-folio upgrade apply --safe # deterministic codemods (font-weight-* → font-*, remote→local URLs) bundle exec al-folio upgrade overrides diff <path> # then `overrides accept <path>` to acknowledge an override ``` ## Optional toolchains - **Jupyter posts.** `bin/setup-python-deps` installs _only_ `jupyter` and `nbconvert` (via `pip --user --break-system-packages`) for `jekyll-jupyter-notebook`. It does **not** read `requirements.txt`. Missing `jupyter-nbconvert` is warn-and-continue; notebook rendering is skipped. - **Everything else Python.** [`requirements.txt`](requirements.txt) is the fuller list and must be installed separately (`python3 -m pip install -r requirements.txt`): `rendercv[full]` for CV rendering, `scholarly` for `bin/update_scholar_citations.py`, plus `nbconvert` and `pyyaml`. - **Responsive images.** `imagemagick.enabled: true` needs ImageMagick `convert` on `PATH`. - **Manual deploy.** `bin/deploy` is the manual `gh-pages` build + purgecss + force-push path; CI normally deploys. `purgecss` is not a devDependency — install it with `npm install -g purgecss`. ## Docker serving model (v1-specific) `docker compose up -d` bind-mounts the repo to `/srv/jekyll` and runs `bin/entry_point.sh`, which serves with `--force_polling --destination /tmp/_site`. The build output deliberately goes to **container-local `/tmp/_site`, not the bind-mounted `_site`** — writing `_site` back across the host bind mount caused write deadlocks. The container also `inotifywait`s `_config.yml` and restarts Jekyll on change (config edits aren't hot-reloaded by `--watch`). Verify with the `/al-folio` baseurl: `curl -fsS http://127.0.0.1:8080/al-folio/`. `docker-compose-slim.yml` pulls a prebuilt `:slim` image instead of building locally. ## CI gates and the style contract `npm run lint:style-contract` (`test/style_contract.js`) is the automated enforcement of the thin-starter boundary and will fail CI if you cross it. Beyond the forbidden paths listed in `AGENTS.md`, it also asserts that `_config.yml` keeps `theme: al_folio_core` and the required plugins, that the `third_party_libraries` SRI pins are present, and that the `al_math` Gemfile pin stays on a released version rather than a git branch. Other gates: - `unit-tests.yml` — style contract plus all seven `test/integration_*.sh` scripts (`comments`, `plugin_toggles`, `distill`, `bootstrap_compat`, `upgrade_cli`, `css_minify`, `new_plugins`). - `visual-regression.yml` — Playwright on chromium + webkit, diffing the candidate build against a `v0.16.3` baseline worktree served on `:4100` via `BASELINE_URL`. - `upgrade-check.yml` — `bundle exec al-folio upgrade audit`. - `prettier.yml` — Prettier with `@shopify/prettier-plugin-liquid` and `printWidth: 150`. Run `npm run lint:prettier` before pushing; `npx prettier . --write` fixes. - `update-tocs.yml` — regenerates `<!--ts-->…<!--te-->` blocks in changed root and `docs/` Markdown files. If you add or rename a heading, expect a follow-up auto-commit on `main`. ## Gem version pins `Gemfile` pins every `al-*` gem to an exact released version in `group :al_folio_plugins`, and `_config.yml` lists the same gems under `plugins:`. Read the current pins from the `Gemfile` rather than trusting any version quoted in prose — including here. To test a gem fix against this site, repoint the `Gemfile` at a sibling checkout (`path:`, `git:`, or `branch:`) and `bundle install`; see [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md#working-on-a-gem-alongside-the-starter). Revert the pin before committing.
rtk-ai/rtk: a filter that shrinks command output for AI tools
Grade 70/100 · Rust · 171 lines, inside Anthropic’s 200-line target · Apache License 2.0 · See it on GitHub
In the file: a test command, a check to run before finishing and 9 stated limits.
- A one-line gate that must pass after any change to the Rust code: format, lint and test.
- A limit on rabbit holes: when checking something would take more than three or four exploratory commands, stop and ask.
- A protocol for numbered plans: work in order, commit after each step, and report a blocked step instead of skipping it.
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
**rtk (Rust Token Killer)** is a high-performance CLI proxy that minimizes LLM token consumption by filtering and compressing command outputs. It reduces bash output by 60-90% on common development operations through smart filtering, grouping, truncation, and deduplication. All percentages in this repo measure bash output, not your bill. RTK ships no tokenizer (`src/core/tracking.rs` estimates tokens as `bytes / 4`), so the ratios are reliable but the absolute token counts are approximate.
This is a fork with critical fixes for git argument parsing and modern JavaScript stack support (pnpm, vitest, Next.js, TypeScript, Playwright, Prisma).
### Name Collision Warning
**Two different "rtk" projects exist:**
- This project: Rust Token Killer (rtk-ai/rtk)
- reachingforthejack/rtk: Rust Type Kit (DIFFERENT - generates Rust types)
**Verify correct installation:**
```bash
rtk --version # Should show "rtk 0.28.2" (or newer)
rtk gain # Should show token savings stats (NOT "command not found")
```
If `rtk gain` fails, you have the wrong package installed.
## Development Commands
> **Note**: If rtk is installed, prefer `rtk <cmd>` over raw commands for token-optimized output.
> All commands work with passthrough support even for subcommands rtk doesn't specifically handle.
### Build & Run
```bash
cargo build # raw
rtk cargo build # preferred (token-optimized)
cargo build --release # release build (optimized)
cargo run -- <command> # run directly
cargo install --path . # install locally
```
### Testing
```bash
cargo test # all tests
rtk cargo test # preferred (token-optimized)
cargo test <test_name> # specific test
cargo test <module_name>:: # module tests
cargo test -- --nocapture # with stdout
bash scripts/test-all.sh # smoke tests (installed binary required)
```
### Linting & Quality
```bash
cargo check # check without building
cargo fmt # format code
cargo clippy --all-targets # all clippy lints
rtk cargo clippy --all-targets # preferred
```
### Pre-commit Gate
```bash
cargo fmt --all && cargo clippy --all-targets && cargo test --all
```
### Package Building
```bash
cargo deb # DEB package (needs cargo-deb)
cargo generate-rpm # RPM package (needs cargo-generate-rpm, after release build)
```
## Architecture
rtk uses a **command proxy architecture**: `main.rs` routes CLI commands via a Clap `Commands` enum to specialized filter modules in `src/cmds/*/`, each of which executes the underlying command and compresses its output. Token savings are tracked in SQLite via `src/core/tracking.rs`.
For the full architecture, component details, and module development patterns, see:
- [ARCHITECTURE.md](docs/contributing/ARCHITECTURE.md) — System design, module organization, filtering strategies, error handling
- [docs/contributing/TECHNICAL.md](docs/contributing/TECHNICAL.md) — End-to-end flow, folder map, hook system, filter pipeline
Module responsibilities are documented in each folder's `README.md` and each file's `//!` doc header. Browse `src/cmds/*/` to discover available filters.
Supported ecosystems: git/gh/gt, cargo, go/golangci-lint, npm/pnpm/npx, ruff/pytest/pip/mypy, rspec/rubocop/rake, dotnet, playwright/vitest/jest, docker/kubectl/aws, gradlew/mvn, php/artisan/phpunit/phpstan/pest.
### Proxy Mode
**Purpose**: Execute commands without filtering but track usage for metrics.
**Usage**: `rtk proxy <command> [args...]`
**Benefits**:
- **Bypass RTK filtering**: Workaround bugs or get full unfiltered output
- **Track usage metrics**: Measure which commands Claude uses most (visible in `rtk gain --history`)
- **Guaranteed compatibility**: Always works even if RTK doesn't implement the command
**Examples**:
```bash
rtk proxy git log --oneline -20 # Full git log output (no truncation)
rtk proxy npm install express # Raw npm output (no filtering)
rtk proxy curl https://api.example.com/data # Any command works
```
All proxy commands appear in `rtk gain --history` with 0% bash output reduction (input = output).
## Coding Rules
Rust patterns, error handling, and anti-patterns are defined in `.claude/rules/rust-patterns.md` (auto-loaded into context). Key points:
- **anyhow::Result** everywhere, always `.context("description")?`
- **No unwrap()** in production code
- **`LazyLock` statics** for all regex (never compile on every function call)
- **Fallback pattern**: if filter fails, execute raw command unchanged
- **No async**: single-threaded by design (startup <10ms)
- **Exit code propagation**: `std::process::exit(code)` on child failure
Testing strategy and performance targets are defined in `.claude/rules/cli-testing.md` (auto-loaded). Key targets: <10ms startup, <5MB memory, 60-90% reduction in bash output bytes.
For contribution workflow and design philosophy, see [CONTRIBUTING.md](CONTRIBUTING.md). For the step-by-step filter implementation checklist, see [src/cmds/README.md](src/cmds/README.md#adding-a-new-command-filter).
## Build Verification (Mandatory)
**CRITICAL**: After ANY Rust file edits, ALWAYS run the full quality check pipeline before committing:
```bash
cargo fmt --all && cargo clippy --all-targets && cargo test --all
```
**Rules**:
- Never commit code that hasn't passed all 3 checks
- Fix ALL clippy warnings before moving on (zero tolerance)
- If build fails, fix it immediately before continuing to next task
**Performance verification** (for filter changes):
```bash
hyperfine 'rtk git log -10' --warmup 3 # before
cargo build --release
hyperfine 'target/release/rtk git log -10' --warmup 3 # after (should be <10ms)
```
## Working Directory Confirmation
**ALWAYS confirm working directory before starting any work**:
```bash
pwd # Verify you're in the rtk project root
git branch # Verify correct branch (main, feature/*, etc.)
```
**Never assume** which project to work in. Always verify before file operations.
## Avoiding Rabbit Holes
**Stay focused on the task**. Do not make excessive operations to verify external APIs, documentation, or edge cases unless explicitly asked.
**Rule**: If verification requires more than 3-4 exploratory commands, STOP and ask the user whether to continue or trust available info.
**Examples of rabbit holes to avoid**:
- Excessive regex pattern testing (trust snapshot tests, don't manually verify 20 edge cases)
- Deep diving into external command documentation (use fixtures, don't research git/cargo internals)
- Over-testing cross-platform behavior (test macOS + Linux, trust CI for Windows)
- Verifying API signatures across multiple crate versions (use docs.rs if needed, don't clone repos)
**When to stop and ask**:
- "Should I research X external API behavior?" → ASK if it requires >3 commands
- "Should I test Y edge case?" → ASK if not mentioned in requirements
- "Should I verify Z across N platforms?" → ASK if N > 2
## Plan Execution Protocol
When user provides a numbered plan (QW1-QW4, Phase 1-5, sprint tasks, etc.):
1. **Execute sequentially**: Follow plan order unless explicitly told otherwise
2. **Commit after each logical step**: One commit per completed phase/task
3. **Never skip or reorder**: If a step is blocked, report it and ask before proceeding
4. **Track progress**: Use task list (TaskCreate/TaskUpdate) for plans with 3+ steps
5. **Validate assumptions**: Before starting, verify all referenced file paths exist and working directory is correctrust-lang/rust-analyzer: the Rust language server
Grade 67/100 · Rust · 60 lines, inside Anthropic’s 200-line target · Apache License 2.0 · See it on GitHub
In the file: 8 exact commands, a test command and 6 stated limits.
- States the project’s AI policy first, including the work a contributor must not use AI for.
- Names the rule that matters most: malformed code and broken builds must never make ordinary editor features crash.
- Validation from narrow to broad: one crate’s tests first, wider checks when a change crosses crates, and snapshot diffs read rather than accepted blindly.
## AI Policy Follow `AI_POLICY.md`. In particular: - Do not use AI to author issue/PR comments or replies to maintainers. - Do not autonomously open issues or pull requests. - Do not author code for issues labeled both `E-easy` and `E-has-instructions`. - The human contributor must understand the changes and disclose AI use as required by the policy. ## Repository Guides - Architecture and crate ownership: `docs/book/src/contributing/architecture.md` - Rust style: `docs/book/src/contributing/style.md` - Testing conventions and fixture syntax: `docs/book/src/contributing/testing.md` - Contributor workflows: `docs/book/src/contributing/README.md` - AI restrictions: `AI_POLICY.md` Read the relevant sections before making architectural, generated-code, protocol, or test-harness changes. ## Change Workflow - Find the nearest existing implementation and its tests before adding new code. - Extend existing helpers and test harnesses instead of creating parallel abstractions. - Keep changes focused and prefer the smallest change that fits the existing design. - When fixing a bug, add the smallest fixture that reproduces it and test the behavior through the existing interface. ## Scope and Dependencies - Treat new `pub` items, public re-exports, and Cargo dependencies as architectural changes, not routine implementation details. - Prefer keeping functionality inside the crate that owns the relevant data. - Be conservative with crates.io dependencies. Reuse existing dependencies or `stdx`; do not add small helper crates without strong justification. ## Key Invariants - User-provided Rust code, malformed syntax, broken builds, and proc-macro failures must not cause ordinary IDE features to panic. - Assert invariants liberally. For impossible conditions from which the server can recover, prefer `stdx::never!` or `stdx::always!` and return a safe fallback instead of panicking. ## Testing - Many feature tests use Rust-code fixtures and `expect-test` snapshots. Follow the nearest existing test helper and fixture convention rather than introducing a new test harness. - Before planning or writing fixture-based tests, review `docs/book/src/contributing/testing.md` for fixture annotations, `minicore`, and multi-file/multi-crate syntax. - Keep Rust fixtures minimal; remove syntax unrelated to the behavior under test. - Use unindented multiline raw strings, matching nearby tests. - For regressions, first reproduce the failure with a focused test, then implement the fix. ## Generated Code - Generated files are committed. Edit the generator rather than generated output. - Run `cargo xtask codegen` after changing grammar, generated AST definitions, configuration schemas, or other codegen inputs. - After adding parser inline tests (`// test name`), run `cargo test -p xtask`, update the relevant expectations, and inspect the generated diff. ## Validation - Start with the narrowest relevant test: `cargo test -p <crate> <test-name>` or `cargo test -p <crate>`. - After Rust changes, run the affected crate's tests and `cargo clippy -p <crate> --all-targets -- --cap-lints warn`; broaden validation when the change crosses crates. - Use `cargo lint` to run Clippy on all workspace targets. - Run `cargo xtask tidy` for repository-wide structural or generated-code changes. - When updating snapshots with `UPDATE_EXPECT=1`, inspect the expectation diff rather than accepting it blindly. - Use `RUN_SLOW_TESTS=1 cargo test` when the affected area has slow tests.
What the best files have in common
- They say what not to do, and why: public actions wait for a person’s go-ahead, tests stay away from real accounts and resources, and conventions no tool enforces are written down.
- They give exact commands, from the narrow check to the full one, and say which must pass before work is called done.
- They record reasons, such as why a version is pinned or why a build step works the way it does, so an agent does not undo a decision it cannot see.
- They point instead of copying: to a skill, a guide or a shared AGENTS.md for anything long, occasional or shared with other tools.
- When they describe the layout, it is usually to say something an agent needs, such as which files are generated and must not be edited.
Make or grade your own
To write yours, choose CLAUDE.md under For on the home page, describe your project or paste its README or a public GitHub link, and create. You get a complete file built only from what you supplied, with anything it does not know left as a [placeholder]. The CLAUDE.md guide covers where the file goes and how long to make it.
Already have one? Grade my file scores a pasted CLAUDE.md on the same six ingredients and writes an improved version, and the repo grader reads one from a public GitHub repository and gives you a badge for your README.
How these files were chosen
We searched GitHub on September 29, 2026 for public repositories pushed since mid-August under the MIT, Apache, BSD or ISC licenses, and took the most-starred of each license, up to 1,000 apiece, all with more than 1,500 stars: 2,707 repositories. 553 had a CLAUDE.md at the root, and 325 of those were under 400 characters or simply pointed to an AGENTS.md.
We kept files in English, within Anthropic’s 200-line target and the grader’s 12,000 characters, and from software projects rather than lists, templates or tutorials. That left 144. The 26 with the most of four signs (a test command, a check to run before finishing, stated limits and exact commands) were graded, with at most four per language, one project per owner across this page and the AGENTS.md guide, and no Apache-licensed project that ships a NOTICE file.
Each was graded once, on September 29, 2026, exactly as a guest’s grade runs on this site. The 10 shown scored highest, with at most three per language. Files that scored lower are not named.
A grade measures how well a file follows the evidence and its tool’s own guidance, not whether it makes an agent succeed. A 2026 study found that context files did not generally raise coding agents’ success rates and added more than 20% to the cost, while agents did follow the instructions in them (Gloaguen et al.). The files here earn their place by recording what an agent could not work out for itself.
Grades from a language model can move a few points between runs, so each is dated and tied to the commit it was read at. Maintain one of these projects and want your file taken down? Email hello@looptypes.com and we will remove it.
Licenses
Each file on this page is shown whole under its project’s open-source license, and its copyright stays with its authors. The link on each name opens the project at the commit shown, where its full license is.
- milvus-io/milvus: CLAUDE.md, Apache License 2.0.
- gfx-rs/wgpu: CLAUDE.md, Apache License 2.0.
- microsoft/playwright-python: CLAUDE.md, Apache License 2.0.
- heygen-com/hyperframes: CLAUDE.md, Apache License 2.0.
- gpujs/gpu.js: CLAUDE.md, MIT License. Copyright (c) 2019 gpu.js Team.
- OpenZeppelin/openzeppelin-contracts: CLAUDE.md, MIT License. Copyright (c) 2016-2026 Zeppelin Group Ltd.
- keybase/client: CLAUDE.md, BSD 3-Clause License. Copyright (c) 2015, Keybase.
- alshedivat/al-folio: CLAUDE.md, MIT License. Copyright (c) 2025 Maruan Al-Shedivat.
- rtk-ai/rtk: CLAUDE.md, Apache License 2.0.
- rust-lang/rust-analyzer: CLAUDE.md, Apache License 2.0.
Apache License 2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
BSD 3-Clause License
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Questions
Can I copy these files?
Each is shared under its project’s open-source license, listed under Licenses. Copy the patterns rather than the facts: a CLAUDE.md helps only when every line is true for your own codebase.
Does a better CLAUDE.md make Claude write better code?
Not by itself. Research so far finds that agents follow these files, but that a file does not generally raise their success rate. The best files stay short and record only what an agent could not work out alone: commands, limits and the reasons behind decisions.
Why is my project not here?
We read only the most-starred public repositories under a permissive license, and show only the highest grades. You can grade yours with the repo grader.
How current is this page?
The files were read and graded on September 29, 2026, at the commits linked. Projects change their files, so follow a link for the latest version.