Repomix + Fable 5: Pack a Repo for a Long-Context Review
Flatten an entire codebase into a single file and let Fable 5 hold all of it at once for a whole-system review.
Run this workflow
CI-verified, 5/5 fixtures passing.
Build this with your agent
One copy-paste hands Claude Code, Codex, or Cursor the full recipe, steps included, nothing to fetch.
Intended Use
Sending an entire repo to Fable in one shot for an architecture write-up or dependency-risk audit. CI actually runs repomix against a scaffolded fixture repo and confirms it produced a non-empty, well-formed XML file with the file manifest, no API key, because packing never calls a model. Fable's review of the packed file is the fenced model step.
Not for
- Packing a sprawling repo naively, at $50 per MTok output that gets expensive; use include/ignore globs
- Treating 'millions of tokens' as infinite; watch the token count repomix prints
- Expecting CI to verify the review; that is the fenced model step
The Stack
Tested Against
repomix@latestnode@20.xclaude-fable-5Side effects & data flow
- Network
- npm registry, to fetch repomix
- Writes
- ./sample/, ./checkrepomix.mjs
- Credentials
- none required
Prerequisites
- Node 20+ (npx repomix@latest)
- An Anthropic API key for claude-fable-5 (only for the fenced review)
Steps
- 1
Pack the repo into one file
In your project: npx repomix@latest. It walks the repo, respects .gitignore, and writes repomix-output.xml with a file tree, contents, and token counts. Then send that file as the user message to claude-fable-5 and ask for, say, a dependency-risk audit.
- 2
What CI checks: repomix actually packs the repo into well-formed XML
CI scaffolds a small fixture repo, runs npx repomix@latest --style xml, and confirms the output file exists, is non-empty well-formed XML, and contains the file manifest. Fully deterministic, no key, because packing never calls a model. Fable's review is fenced.
mkdir -p sample/src cat > sample/src/index.js <<'EOF' export function add(a, b) { return a + b } EOF cat > sample/README.md <<'EOF' # Sample A tiny repo for packing. EOF ( cd sample && npx --yes repomix@latest --style xml >/dev/null 2>&1 ) cat > checkrepomix.mjs <<'EOF' import { existsSync, readFileSync } from 'node:fs'; const out = 'sample/repomix-output.xml'; let ok = true; function check(label, cond){ console.log(label + ': ' + (cond ? 'yes' : 'NO')); if(!cond) ok=false; } check('packed output file exists', existsSync(out)); const xml = existsSync(out) ? readFileSync(out, 'utf8') : ''; check('output has repomix XML structure', xml.includes('<file_summary>') && xml.includes('<file path=')); check('output contains the file manifest', xml.includes('src/index.js')); if(!ok){ console.log('repomix pack check FAILED'); process.exit(1); } console.log('repomix pack check OK: packed the repo into well-formed XML'); EOF node checkrepomix.mjs - 3
Send it to Fable for review (the model step, not checked by CI)
Hand the packed file to claude-fable-5 and ask for a whole-system review. That runs the model and is non-deterministic, so CI never claims it. The badge covers the pack, not the review.
Eval, 5 fixtures
Last passed: verified todayoutput-existscontainstimeout 600s · max $0Expected:
packed output file exists: yesxml-structurecontainstimeout 600s · max $0Expected:
output has repomix XML structure: yesmanifestcontainstimeout 600s · max $0Expected:
output contains the file manifest: yescheck-okcontainstimeout 600s · max $0Expected:
repomix pack check OK: packed the repo into well-formed XMLclean-exitexit_codetimeout 600s · max $0Expected:
0
Results
~22.9k stars; the cheapest way to feed Fable's long-context strength a whole codebase in one call.
Did this work for you?
Our CI checks the setup runs. You tell us if the whole thing worked. Tell us straight.
Liked this workflow?
Get new verified workflows in WebAfterAI, three issues a week (Tue, Thu, Sat).