Claude Code docs mirror pipeline

Fetches the official docs daily, records what changed, and makes them searchable locally.

#GitHub Actions#docs mirror#changelog#headless Claude#search MCP
Claude Code docs mirror

WorkflowClaude Code docs mirror

Sites & i18n GitHub Actions + local MCP

A pipeline that pulls the official Claude Code docs into Git every day, adds a plain-language summary of what changed in each update, and serves the bilingual pages through an MCP server with full-text and vector search.

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

TaskWhoInputsOutputs
1. Daily syncSync scriptcloud-sync.shOfficial mdmd mirror, Update log
2. Write digestDigest agent + Digest runnerclaude -p + digest_sync.shUpdate log, Refers to Digest rulesDigested log
3. SnapshotSnapshot queuecloud-translatemd mirrorPage snapshot
4. TranslateTranslator + Page driver + Engineclaude -p + translate_page + run.pyPage snapshotTranslations
5. AuditAuditor + EngineCodex + run.pyTranslationsAudit report
6. InjectTranslator + Engine + Layer injectorclaude -p + run.py + inject_layers.shAudit reportBilingual page
7. Check & mergeCheck & PRpublish_repo.pyBilingual pageAudit PR
8. SearchAuto-pull hook + Search MCPccdocs-autopull + cc-doc-searchAudit PRSearch index
Claude Code docs mirror

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
Daily sync

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

InputsOfficial md
Outputsmd mirror, Update log
Write digest

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

InputsUpdate log
OutputsDigested log
Refers toDigest rules
Snapshot

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
Inputsmd mirror
OutputsPage snapshot
Translate

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
InputsPage snapshot
OutputsTranslations
Audit

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
InputsTranslations
OutputsAudit report
Inject

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
InputsAudit report
OutputsBilingual page
Check & merge

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
InputsBilingual page
OutputsAudit PR
Search

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

InputsAudit PR
OutputsSearch 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.