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.01281 | $0.01281 |
| Opus 5.5 | $0.00512 | $0.00512 |
| Sonnet 5.5 | $0.00256 | $0.00256 |
| Haiku 4.5 | $0.00128 | $0.00128 |
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 22d 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
67 chapters + 4 appendices, ~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. - Never cite line-of-code counts. Do not write how many lines a file, class, crate, or subsystem contains — no
(1,210 lines), no "at roughly 7,200 lines", no "Lines of Code" table column, no# 8234 linescomment in a source tree listing. These numbers go stale on every AOSP sync and are the first thing to rot in a chapter. Convey scale with prose the source can't invalidate ("one of the largest classes in the framework", "a small file of stubs") or, better, with a structural fact that is actually stable (how many files a package has, what the class is responsible for). This does not apply to source citations with line numbers (file.cpp:123, "lines 117-131"), which rule 6 requires, nor to qualitative scale statements with no specific count ("hundreds of millions of lines of code"). - Update the top-level
README.mdwhen chapters are added, removed, renamed, or reordered. Hand-edit the chapter table under "What This Book Covers" (each row carries its Part), the chapter count in the surrounding prose, and the file counts under "Project Structure".llms.txt(rule 11) groups chapters by the same Parts, so keep the two in step.
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.
- 22d ago Changed · -2 lines · -314 tokens per session 14f3e46aa5a3
- 1mo ago Changed · +2 tokens per session a03a9569c6bf
- 1mo ago Changed · +2 lines · +269 tokens per session c235542efa3e
- 2mo 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 (144 stars, last pushed 23d ago), licensed Apache-2.0. It adds 1,281 tokens to every session, about $0.0051 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
aosp-internal-book CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| aosp-internal-book CLAUDE.mdaospbooks/aosp-internal-book | Instructions file | 144 | 23d ago | Apache-2.0 | A | 1,281 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 275k | 3d ago | MIT | A | 4,313 | Codex, OpenCode |