Challenge
- The official docs change often, but the official site does not make it easy to see which page changed and how
- The markdown versions update first and the rendered site catches up later (in the author's measurement, 9 pages still showed old content 14 hours later)
- With close to 200 pages, you want to pull up the right passage mid-conversation
Approach
- Every day at a fixed time, GitHub Actions fetches the markdown of every page listed in llms.txt, prunes removed pages, appends to the update log and commits
- The cloud job cannot log in to Claude, so it leaves only a pending marker in the summary slot; locally, digest_sync.sh has headless Claude read the diff and write the key points
- A local MCP server indexes the bilingual pages with full-text search (FTS5) and vectors (bge), and picks up changed files automatically before each search
Outcome
- Each sync adds one log entry with a link to the commit and counts of added, changed and removed pages; the key points of the change are filled in when the local digest runs
- If a sync fails, the README status turns red, so a missed update is noticed at once
- From a Claude Code conversation, search_docs and get_page bring up the latest docs
This keeps a local mirror of the official Claude Code docs for study and search. The official markdown goes into Git unchanged, so you can check in a diff what changed on which day.
The flow is fetch → summarise → bilingual pages → search index. Fetching runs daily in the cloud, summaries are written by headless Claude locally, and bilingual pages are built a few at a time on a self-hosted runner under a daily cap, each passing an independent audit before it is merged.
The full workflow
| Task | Who | Inputs | Outputs |
|---|---|---|---|
| 1. Daily sync | Sync scriptcloud-sync.sh | Official md | md mirror, Update log |
| 2. Write digest | Digest agent + Digest runnerclaude -p + digest_sync.sh | Update log, Refers to Digest rules | Digested log |
| 3. Snapshot | Snapshot queuecloud-translate | md mirror | Page snapshot |
| 4. Translate | Translator + Page driver + Engineclaude -p + translate_page + run.py | Page snapshot | Translations |
| 5. Audit | Auditor + EngineCodex + run.py | Translations | Audit report |
| 6. Inject | Translator + Engine + Layer injectorclaude -p + run.py + inject_layers.sh | Audit report | Bilingual page |
| 7. Check & merge | Check & PRpublish_repo.py | Bilingual page | Audit PR |
| 8. Search | Auto-pull hook + Search MCPccdocs-autopull + cc-doc-search | Audit PR | Search index |
8 steps · 3 roles · 9 tools · running since 2026-06-27 · 1,795 commits · 134 daily syncs
The cloud pulls the official markdown daily, a local Claude writes what changed, another runner translates page by page with an audit by a second model, and everything is searchable from any conversation.
- Sync (1) and translation (3–7) run on separate runners and never write the same files, so they cannot collide
- The cloud cannot log in to Claude, so only the digest (2) runs locally
- At most 20 pages a day. An agent translates and decides on audit findings; a different model audits
- Search (8) pairs a hook with an MCP server, so it is up to date before each question
Project folders involved (4)
This workflow does not live in one folder: it runs across projects.
- claude-code-docs-mirror (private repo)
- The core: the markdown mirror, the update log, the bilingual pages and the sync and translation pipelines
- site-bilingual plugin
- The author's plugin: it bundles the bilingual engine and the digest skill, proven on this mirror
- (private) search-server folder
- A private search-server folder: the MCP server with its index and its own runtime
- ~/.claude/hooks/ccdocs-autopull.sh
- The hook that pulls the mirror automatically before a conversation uses it
Step 1 · Sync script
Daily synccloud-sync.sh
Every day at a fixed time, the markdown of every indexed page is pulled in.
- It reads the official index (llms.txt), fetches every page and prunes pages that have gone
- It adds one entry at the top of the update log, leaves only a pending marker for the summary, and commits
- On failure it turns the README status red, so a missed update is visible
Common misconceptionThe rendered site lags behind the markdown: measured once, 9 pages still showed old content 14 hours later
| Inputs | Official md |
| Outputs | md mirror, Update log |
Step 2 · Digest agent + Digest runner
Write digestsync-digest
A local Claude reads the diff and writes the key changes in plain words.
- Only page names, settings keys and headings that actually appear in the diff may be named
- Three to six points; the remaining small edits are folded into a count
- The marker is switched to done and committed, so nothing is written twice
Claude CodeHeadless claude -p reads the skill, with tools limited to read, edit and git
Common misconceptionIf the local run is skipped, summaries pile up: 20 entries were still pending on 2026-11-18
| Inputs | Update log |
| Outputs | Digested log |
| Refers to | Digest rules |
Step 3 · Snapshot queue
Snapshotsingle-file
Only the changed pages are captured as single-file HTML with headless Chrome.
- Pages whose markdown changed enter the translation queue
- If the new snapshot is byte-identical, the old translation still holds and the page leaves the queue
- A setting that keeps hidden tab content is mandatory: with the default, 103 of 160 tab panels came out empty
| Inputs | md mirror |
| Outputs | Page snapshot |
Step 4 · Translator + Page driver + Engine
Translaterun.py
An agent fills a literal and a free translation under each English block.
- It fills only the empty cells of a unit table extracted from the page; translated units are left alone
- One session per page, at most 20 pages a day; the rest wait for the next day
- Tools are limited by an allow-list; it never runs with all permissions
| Inputs | Page snapshot |
| Outputs | Translations |
Step 5 · Auditor + Engine
Auditcodex audit
A different model audits the translation, 30 units per batch.
- It looks for mistranslation, omissions, inconsistent terms and literal and free versions swapped
- Results come back as JSON in a fixed schema and are retried if they fail validation
- If the units are unchanged since last time, the audit is skipped, so an interrupted run resumes where it stopped
| Inputs | Translations |
| Outputs | Audit report |
Step 6 · Translator + Engine + Layer injector
Injectaudit-reviewed
The agent decides which audit findings to accept, then injects translations and display layers.
- Only real corrections are accepted; changes of meaning, dropped terms and style churn are rejected
- Injection adds one line before </body> and changes no original element by a single byte
- Five layers are added (bilingual diagrams, an open-on-official-site button, translator credits and more), each removable in one go
| Inputs | Audit report |
| Outputs | Bilingual page |
Step 7 · Check & PR
Check & mergepublish_repo.py
Pages that pass the sanity check are merged automatically as audit PRs.
- One PR per page, so the audit record stays with it
- A page that fails the check keeps its PR open for a person to review
- Publishing before injection would commit a page without its layers, so the order is fixed
| Inputs | Bilingual page |
| Outputs | Audit PR |
Step 8 · Auto-pull hook + Search MCP
Searchsearch_docs
From inside a conversation, the latest bilingual pages are searched by full text and vectors.
- A hook runs git pull in the background at most once every 30 minutes, keeping the disk current
- Before each search the MCP server compares file times and re-indexes only what changed
- With no changes the check takes about 15 ms and the embedding model is not even loaded
Claude CodeThe MCP server is registered per user, so it works from a conversation in any project folder
| Inputs | Audit PR |
| Outputs | Search index |
Key points
Never miss an official update. Sync runs automatically every day and every changed page lands in a commit. If it fails, the README shows a red light, so there is no such thing as an unrecorded update.
Summaries say only what the diff says. The summary agent may name only pages, settings keys and section titles that actually appear in the diff. It writes 3 to 6 points and folds the remaining small edits into a count.
Separate who writes where. Sync writes only the markdown and the update log; translation writes only HTML. The two never touch the same files, so they can run side by side without conflicts.