Borrowing it
Nothing to install: this file belongs to aospbooks/aosp-internal-book. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/aospbooks/aosp-internal-book/main/CLAUDE.mdgit clone --depth 1 https://github.com/aospbooks/aosp-internal-bookWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/aospbooks/aosp-internal-book/claude-md)<a href="https://agentmods.dev/instructions/aospbooks/aosp-internal-book/claude-md"><img src="https://agentmods.dev/badge/instructions/aospbooks/aosp-internal-book/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/aospbooks/aosp-internal-book/claude-md"><img src="https://agentmods.dev/badge/instructions/aospbooks/aosp-internal-book/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01324 | $0.01324 |
| Opus 5 | $0.00662 | $0.00662 |
| Sonnet 5 | $0.00265 | $0.00265 |
| Haiku 4.5 | $0.00132 | $0.00132 |
Grade A, and why
aosp-internal-book 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 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 43 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AOSP Internals Book
65 chapters + 3 appendices, ~227,000 lines, ~1,500 Mermaid diagrams.
Quick Start
docker compose build
docker compose up -d serve # http://localhost:8000
Writing Rules
- Chapters:
NN-slug.md, titles:# Chapter N: Title— colon only, never--or— - Section numbers: manual
## N.1,### N.1.2matching filename - No duplicate section numbers within a chapter (watch for this when inserting new sections)
- Mermaid: quote labels with
(),<br/>,|; no<br/>inparticipantlines; no parens instateDiagram-v2transition labels (State1 --> State2 : foo()breaks parsing — drop the parens) - Descriptive heading before each mermaid block
- Source refs: real AOSP paths with line numbers
- The body of every chapter ends with "Try It" then "Summary" — nothing else comes after Summary, except an optional final "Key Source Files Reference" (or similarly-titled key-file-paths) table, which may sit after Summary as a final reference. Appendices, extras, deep dives, etc. still must move above Try It / fold into a numbered section.
- Do not add epigraph blockquotes at the top of chapters. No
> *"quote"*/> -- Authorblocks between the# Chapter N: Titleline and the first## N.1section. The chapter goes straight into its introductory paragraph after the title. (We removed all of these in a cleanup pass; do not re-introduce them when editing or writing new chapters.) - Verify mermaid format parses after every edit. Run
./serve.sh png NN-slug.mdon every chapter whose Mermaid blocks you touched and confirm the output reportserrors=0. The CIproperdocs builddoes NOT validate Mermaid (the live site renders it client-side in the browser), so a parse error reaches readers as a "No diagram type detected" / "Syntax error" banner with no build-time signal. Treaterrors=0as a hard precondition — do not declare the edit done, commit, or move to visual review until the format check is clean. Iferrors>0, fix the offending block (the script names which file/index failed) and re-run until clean. - Visually verify mermaid diagrams after writing or editing them. Parse-clean is not enough — diagrams can render with text overflowing rectangles, overlapping nodes, or unreadable arrows, and they can also be parse-clean but factually wrong about the architecture. After rule 9 passes, inspect each PNG under
.mermaid-png/<slug>/. Check: (a) every label fits inside its shape with no overflow; (b) no nodes or edge labels overlap; (c) the boxes, arrows, and grouping match the architecture the prose describes (right components, right direction of arrows, no missing or invented relationships). Re-render after every mermaid edit. - Keep
llms.txtin sync with chapter content.llms.txt(root of repo, symlinked intodocs/) is the llmstxt.org-style index that AI tools fetch to learn what's in this book and where to find each subsystem. Update it when chapters are added, removed, renamed, or significantly retitled, and when a chapter's scope changes enough that its one-line description no longer fits. Each chapter entry has the form- [Chapter N: Title](https://aospbooks.github.io/aosp-internal-book/<slug>/): one-line description of what the chapter covers and the key components it walks through. Do not updatellms.txtfor routine edits inside a chapter (typo fixes, mermaid tweaks, prose rewrites that don't change the chapter's scope). When editing, also confirm every URL still resolves to a real<slug>.mdin the repo root. - Re-run
python3 agents/build.pyafter any change to chapter content. The 16 Part-skills underagents/<claude|gemini|codex|copilot>/are generated from chapters at the repo root, so any chapter edit can stale them. Always regenerate after a chapter edit — including prose tweaks, typo fixes, and mermaid changes, not just headings or structural edits — and commit the regenerated files if the regeneration produces a diff. The CIagents/build.py --checkstep inbuild-test.ymlwill fail if they're stale. Seeagents/SPEC.mdfor the full design. - Update
agents/README.md(and the top-levelREADME.md) when chapters are added, removed, renamed, or reordered.agents/build.pyregenerates the per-platform Part-skill content but does not touch either README. When the chapter set changes, hand-edit (a)agents/README.md— both the64 chapters + 2 appendicescount near the top, the example chapter range (./00-frontmatter.md…./63-custom-rom.md), and the per-Part chapter listing in the "What's in each Part" table — and (b) the top-levelREADME.mdchapter table under "What This Book Covers" plus the chapter count in surrounding prose. If the new/renamed chapter changes which Part it belongs to, also editagents/_content/manifest.tomlbefore regenerating.
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.
- 9d ago First seen · 43 lines · 1,324 tokens per session scan A db51719d9a4d
aosp-internal-book CLAUDE.md is an instructions file published in the GitHub repository aospbooks/aosp-internal-book (131 stars, last pushed 10d ago), licensed Apache-2.0. It adds 1,324 tokens to every session, about $0.0066 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-30.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.