Documentation
Context compilation for language models.
Getting started
Drop files into the workspace or run from the terminal. Decant reads.csv, .docm, .docx, .htm, .html, .log, .markdown, .md, .mdx, .pdf, .pptm, .pptx, .text, .tsv, .txt, .xhtml, .xlsm, .xlsx, counts tokens, and bundles them into a single Markdown file you can send to a model.
Other formats are named, not skipped. These are the ones it knows about and cannot read yet:.doc, .epub, .key, .msg, .numbers, .odt, .pages, .rtf. Anything else says so by extension when you drop it, and the rest of the batch still runs.
Tables keep their rows when a cell wraps. A few layouts still lose row structure — values centred between two labels, small tables split across two columns, letter-spaced text — but every value is still present.
decant ./docs --budget 100000 --recipe ./review.decant.json -o context.mdInstall it from npm with npm install -g @decantmd/cli, which puts decant on your path. Or run it once withnpx @decantmd/cli in place of decant.
| Flag | Meaning |
|---|---|
| --budget <n> | Token budget. Over budget is reported, never truncated. |
| --recipe <file> | Re-run a saved recipe and reconcile it against the paths. |
| --save-recipe <file> | Write the current configuration as a recipe. |
| --redact-recipe | Save headings as one-way signatures, not text. Stops a shared recipe being read; not proof against guessing. |
| -o, --output <file> | Write the bundle to a file instead of stdout. |
| --format <md|html|json> | Output format. Default md. |
| --anchors | Add provenance anchors and the citation instruction. |
| --no-dedup | Keep repeated blocks instead of referencing them once. |
| --redact-all | Redact detected secrets and phone numbers without review. Other personal data is not scanned by the CLI. |
| -q, --quiet | Suppress the summary on stderr. |
| -h, --help | Show this message. |
| -v, --version | Show the version. |
The workspace
The workspace has three panes: sources on the left, preview in the centre, and the budget rail on the right. Drop files into sources, check or uncheck sections in the tree, and watch the token count update in real time.
Recipes
A recipe saves your file selection, exclusions, budget, and whether its section headings are stored as signatures. Re-run it against the same files or changed versions without picking sections again.
{
"format": "decant.recipe/v3",
"name": "Contract review · September",
"redacted": false,
"createdAt": "2026-09-01T10:12:00.000Z",
"updatedAt": "2026-09-01T10:12:00.000Z",
"budget": 100000,
"includeAnchors": true,
"dedup": true,
"files": [
{
"path": "contracts/msa.pdf",
"size": 812344,
"lastModified": 1787821920000
},
{
"path": "notes/vendor-notes.docx",
"size": 20311,
"lastModified": 1788015600000
}
],
"excludedPaths": [],
"excludedSections": {
"contracts/msa.pdf": [
{
"title": "Schedule A",
"nth": 1,
"of": 1
}
]
}
}File identities are path, size, and modified time—never file contents.excludedSections is the exception: it records the heading of each section you cut, so the recipe reads as something you can edit and so a re-run can name the exclusion that no longer matches. Pass --redact-recipe when saving to write one-way signatures in place of those headings—enough to stop a shared recipe being read, not enough to defeat someone guessing a heading and hashing it. Paths are unaffected.
Secret scan
Before export, Decant scans for 15 credential patterns—rule set 2026-09-04: AWS access key, AWS secret key, GitHub token, OpenAI API key, Anthropic API key, Google API key, Slack token, Stripe secret key, Private key block, JWT, Bearer token, Credentials in a URL, Password-like assignment, Database connection string, Slack webhook. Each finding is listed with the secret itself masked to its first and last two characters. That list is the whole of it: a pattern it does not carry is a pattern it does not look for.
This finds common patterns. It will miss things. Read the output before you send it.
Nothing is removed from the bundle unless you ask for it. In the workspace, each finding is listed for you to redact, pseudonymise or keep, one value at a time. From the terminal,--redact-all applies every secret and phone finding; without it the findings are reported and the text goes out as written.
Personal data
Alongside the secret scan, the workspace scans for structured personal identifiers. Open Review findings in the budget rail to see each value, masked, with where it occurs. For each one choose Redact, Pseudonymise or Keep, and nothing changes until you apply. A choice covers every place the scan finds that value, and every other place the same text appears, such as an address inside a web address. It does not reach a value written a way the scan does not recognise. The scan, the list, Redact and Keep are free; pseudonymising personal data is part of Pro. The CLI scans for phones and secrets; other personal data is reviewed in the workspace. This is what the scan looks for, and what each check actually proves:
| Identifier | What is checked |
|---|---|
| Phone number | supported international, US, UK and Indian mobile formats; ambiguous bare national digits require a phone label |
| Card number | 15 or 16 digits, or 14 printed 4-6-4, not starting with 0, passing the Luhn check |
| US Social Security number | printed 3-2-4, or 9 digits in a row only after "SSN" or "Social Security"; ranges never issued are skipped |
| Email address | the name@domain shape |
| Web address | starts with http://, https:// or www. |
| IP address | IPv4 or IPv6 notation |
| MAC address | six hex pairs |
| IBAN | the ISO 13616 mod-97 check |
| Aadhaar number | 12 digits passing the Verhoeff check |
| Indian PAN | the format only; its check letter has no published algorithm |
| UK National Insurance number | the format and prefix rules; it has no check character |
It does not detect names, bank routing numbers, postal addresses, dates of birth. File names and folder paths are scanned for the same structured patterns as document text. Personal names are not detected. Saved recipes retain original paths for matching fresh files; review that metadata before sharing a recipe. A saved workspace keeps the full text read from its files in this browser, flagged values included, until you delete it.
Add manual values in Review findings to protect exact, case-sensitive text, including substrings in file names. Each value is proposed for review before Apply. Removing a rule also requires Apply. These rules stay in this tab only: reload, New bundle or a worker failure loses them. A non-sensitive warning flag survives so a restored workspace requires acknowledgement before export. Manual values and their decisions are never saved in recipes or browser storage; the original documents still follow the workspace's existing local persistence behavior. Manual entry is web-only.
Restore a model’s answer
After copying or downloading a bundle, open Restore an answer in Output. Choose the export you sent to the model, paste its full or partial answer, then select Restore placeholders. Known placeholders use that export’s original values; unknown placeholders stay unchanged and are listed for review. Literal placeholder text already in source documents is reserved when generating replacements. [REDACTED] has no reversible value.
Placeholder numbers can mean different values in different exports, so select the matching export carefully. Equivalent spellings of one value share a placeholder and restore to the first source spelling. Later workspace edits do not change an export’s mapping. You can copy or download the restored answer as plain text, including after a licence lapses.
Restore mappings stay only in worker memory in this tab. Reload, closing the tab, a worker failure or New bundle loses them. Forget selected export removes that mapping. Mappings, pasted answers and restored answers are not stored in recipes or browser storage; original source-document persistence is unchanged. Export again to create a new mapping after loss.
How well it finds them
Measured on 2026-10-15 over the 5,594 documents of the test split of gretelai/synthetic_pii_finance_multilingual on Hugging Face (revision7b844d1, Apache-2.0). The dataset is made of synthetic financial documents, and some of its values fail their own check (Card number, US Social Security number and IBAN). So recall counts only the values that pass, and the ones that fail are counted beside it. A flag counts as right when it lands on a labelled value of its kind. Two things move that figure in opposite directions: a real value the dataset did not label counts as a wrong flag, and a flag that covered only part of a value still counts as right. The part it missed is counted as not found.
| Identifier | Found, of values that pass their check | Fail their own check | Flags that were right |
|---|---|---|---|
| Phone number | 51.9% (480 of 924) | no check | 87.3% (486 of 557) |
| Card number | 78.6% (44 of 56) | 63 | 74.6% (44 of 59) |
| US Social Security number | 93.4% (85 of 91) | 62 | 96.6% (85 of 88) |
| Email address | 96.0% (1358 of 1415) | no check | 96.7% (1361 of 1407) |
| Web address | not measured | not measured | not measured |
| IP address | 87.2% (258 of 296) | no check | 97.0% (258 of 266) |
| MAC address | not measured | not measured | not measured |
| IBAN | 95.6% (152 of 159) | 39 | 96.8% (152 of 157) |
| Aadhaar number | not measured | not measured | not measured |
| Indian PAN | not measured | not measured | not measured |
| UK National Insurance number | not measured | not measured | not measured |
| Bank routing number (not detected) | 0.0% (0 of 157) | no check | — |
"Not measured" means the dataset has no label for that identifier, so there is no figure, not a zero. The benchmark is bench/src/pii.ts. It re-runs against the same pinned file, and the test suite fails if the detector changes and the figures are not re-run.
Phone formats and limits
Phone matches check format, not whether a number is assigned. Explicit international notation and recognisable US, UK and Indian mobile formats are supported. Ambiguous bare national digits need a nearby phone label; no country is inferred from your browser. Extensions are included when recognised.
| Format | Gold values | Recall | Precision | Partial matches |
|---|---|---|---|---|
| E.164 notation | 474 | 77.4% (367 of 474) | 94.3% (367 of 389) | 0 |
| US format | 417 | 30.7% (128 of 417) | 75.3% (134 of 178) | 6 |
| UK format | 107 | 80.4% (86 of 107) | 86.0% (86 of 100) | 0 |
| Indian mobile format | 0 | insufficient coverage | not measured | 0 |
| Ambiguous format | 142 | 5.6% (8 of 142) | 100.0% (8 of 8) | 0 |
Format cohorts overlap: E.164 includes all international notation, including US, UK and Indian numbers. Bare ten-digit numbers without country evidence remain ambiguous. Format is not proof of assignment; missing samples mean insufficient coverage.
A separate review of 237 numeric/context candidates in our 40-document PDF corpus found one source-verified US phone number, which the detector found with no extra phone flags. This is insufficient real-document coverage for general accuracy claims: there were no positive international, UK or Indian samples. Retrieval review is not exhaustive page-by-page annotation, and image-only pages are not OCR-scanned. Private corpus text and annotations are not published.
Provenance
Run with --anchors, or tick Add provenance anchors in the budget rail, and every section carries an anchor like⟦f3:p12⟧ with a citation instruction in the bundle header. Anchors are off by default. When the model cites one, the anchor names the file and the page the passage came from; a view that resolves an anchor back to the paragraph for you is not built yet.
CLI
The CLI shares the same parsing and tokenizer modules as the web app. It reads and writes recipe files itself with --recipe and--save-recipe.
A recipe exported from the workspace re-runs here, whether you picked the files individually or picked a folder. The two record paths differently — the browser keeps the folder name in each path, the CLI records them relative to the directory you hand it — so a recipe notes which prefix its own paths carry and each side is read on its own terms. Hand a folder recipe the folder it was built from, not the directory above it. If a recipe entry could mean more than one file, Decant says so and writes nothing rather than guessing.
decant ./docs --budget 100000 -o context.mdFAQ
Can I run Decant offline?
The Decant command-line tool runs with no network. The Decant app in the browser sends none of your files anywhere, and two test suites fail the build if it does. Beyond loading itself, the app can make requests to two services only. The Decant licence service gets a Pro trial, a licence key or an anonymous count if you allowed counting. Cloudflare's Turnstile check runs when you press Send or Activate. The app has no offline install yet, so its page still has to be loaded once.
Can I buy Decant Pro?
Yes. Decant Pro costs $29, paid once. Decant Pro has a 14-day free trial that asks for an email address and no card.