Start using AI properly: 10 skills that replace an assistant

document-reader

ask a long document the question you actually have

How the two work together

Claude thinks it through. Paste the Claude prompt into Claude Code, or drop the folder into your skills folder. Claude does the judgement: what to look for, what is worth doing, what is right.

Codex gets it done. At the hand-off point Claude runs Codex on your machine with one command and passes it the Codex prompt. Codex does the mechanical part and hands the result back. Claude checks it before you see it.

No API key to set up: Claude calls the Codex you already have installed. If Codex is not installed, Claude does that half itself and tells you.

Prompt for Claude

---
name: document-reader
description: Answers your real question about a long document or folder of them, using only quotes from the text, with the gaps left visible. Use for contracts, reports, policies and research packs.
---

# Ask a long document the question you actually have

An answer built from numbered quotes in your own documents, so every line is checkable and any gap shows as a hole.

## Claude does

1. Ask for two inputs, refuse to start without both: the documents and the real question. "Summarise this" is not a question; push for the decision behind it.
2. Size the input. Below roughly 20,000 tokens (about 15,000 words), read straight through. At or above it, Anthropic recommends the quote-first method below.
3. Wrap each document in this exact shape so answers can cite by number:
   `<documents><document index="1"><source>filename</source><document_content>...</document_content></document></documents>`
4. Documents at the TOP of the prompt, question at the BOTTOM. Anthropic measures end-placed queries as worth up to 30 percent better quality on complex multi-document inputs. Formatting instructions go near the end too.
5. Pass one, quotes only: verbatim quotes into `<quotes>` tags, each tagged with its document index. If none are relevant, write "No relevant quotes found" and stop.
6. Pass two: answer from those quotes only, citing each by number. Outside knowledge is banned in this pass.
7. Retraction pass: claim by claim, find the supporting quote; delete any claim without one and mark the hole with empty `[]` brackets.
8. Say it plainly where it applies: "I do not have enough information to confidently assess this."
9. Refuse to guess dates, figures, names, obligations, or anything a document implies but never states.

## Then Codex does

Bulk file work: walking a folder of PDFs, Word files and emails, extracting the plain text, splitting oversized files into ordered chunks, and packaging it all into the indexed XML bundle with a source table. Mechanical, and slow by hand.

```
codex exec --sandbox danger-full-access --skip-git-repo-check -C "<working folder>" - < CODEX.md
```

Claude fills in first: {DOC_FOLDER}, the folder of files; {QUESTION}, the question word for word; {OUTPUT_FILE}, the bundle's path.

## Claude checks

1. Every file appears once, with a unique index and its real filename in `<source>`.
2. Spot-check three quotes character by character against the original. A near-quote is a fabricated quote.
3. No chunk boundary cuts a sentence, clause or table row in half.
4. Nothing summarised, tidied, reordered or de-duplicated. Raw text only.
5. No answer or analysis in the bundle. Codex packages; it does not read.

Any failure: reject, name the file and line, rerun. Never hand-patch the bundle.

## Rules

- Documents top, question bottom, always.
- Quotes first, answer second. Never one pass.
- No supporting quote means the claim is deleted, not softened.
- A visible gap beats a confident sentence.
- Public information only.
- Never invent a fact, a number or a quote.
- Anything sent in someone's name says whose name it is.

## If Codex is not installed

Claude bundles the documents itself, in batches, and says so.

## Built from

- Anthropic prompting best practices, long context: https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices (30 percent gain, 20k threshold, XML wrapper).
- Anthropic Reduce hallucinations: https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-hallucinations (quote grounding, `[]` retraction).
- anthropics/skills: https://github.com/anthropics/skills (174,340 stars via api.github.com).
- anthropics/prompt-eng-interactive-tutorial: https://github.com/anthropics/prompt-eng-interactive-tutorial (38,070 stars via api.github.com).

Prompt for Codex

# Ask a long document the question you actually have - Codex task

## You are given

- {DOC_FOLDER} : a folder path holding the source documents. Formats may include .pdf, .docx, .txt, .md, .csv, .eml, .html.
- {QUESTION} : the user's real question, copied word for word. You do NOT answer it. It is here only so you can order the documents sensibly and name the output.
- {OUTPUT_FILE} : the path to write the finished bundle to.

## Produce

One UTF-8 file at {OUTPUT_FILE} containing, in this order:

1. A source table, as a plain Markdown table, one row per document: index, filename, file type, word count, character count, chunk count.
2. The bundle, in exactly this structure, one `<document>` block per document, indexes starting at 1 and never repeating:

```
<documents>
<document index="1">
<source>exact-filename.pdf</source>
<document_content>
...raw extracted text...
</document_content>
</document>
</documents>
```

3. If a document exceeds 20,000 tokens (estimate at 4 characters per token), split it into ordered chunks and give each chunk its own `<document>` block, with `<source>` written as `exact-filename.pdf (chunk 2 of 5)`. Break only at a blank line, a heading or a paragraph end. Never mid-sentence, mid-clause or mid-table-row.
4. A line at the end reading `TOTAL DOCUMENTS: n` and `TOTAL WORDS: n`.

## Rules

- Extract text verbatim. Do not summarise, paraphrase, rewrite, tidy, translate, reorder or de-duplicate anything.
- Keep original spelling, casing, numbers, currency symbols and line breaks. Keep headings and page markers where the extractor emits them.
- Preserve table content as text; do not reformat tables into prose.
- Do not answer {QUESTION}, do not comment on the documents, do not add analysis, opinions or notes anywhere in the file.
- Escape nothing and strip nothing from the source text apart from control characters that break the file.
- If a file cannot be read (encrypted, scanned with no text layer, corrupt), still give it an index and write `EXTRACTION FAILED: <reason>` inside its `<document_content>`. Never skip it silently and never substitute guessed content.
- Do not fetch anything from the internet. Work only on files inside {DOC_FOLDER}.
- Do not modify, move, rename or delete anything in {DOC_FOLDER}. Read only.
- Never invent a fact, a number or a quote.

## Return

Print to stdout, and nothing else:

1. The absolute path of {OUTPUT_FILE}.
2. The source table exactly as written into the file.
3. `TOTAL DOCUMENTS: n` and `TOTAL WORDS: n`.
4. A list of any files that hit `EXTRACTION FAILED`, with the reason.
5. The first 200 characters of the first `<document_content>` block, so the caller can confirm the text is raw and not summarised.

Built from the best public work on this

Sources

Best public prompt we found for this job

https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-hallucinations

Anthropic's own wording for the retraction pass, which is the step that turns reading into checking:

find a direct quote from the documents that supports it. If you can't find a supporting quote for a claim, remove that claim... and mark where it was removed with empty [] brackets

Paired with their permission-to-decline line, which they list first among hallucination reducers:

If you're unsure about any aspect or if the report lacks necessary information, say I don't have enough information to confidently assess this.

And the escape hatch for the quote-extraction pass itself, from the long-context guidance: if no relevant quotes exist, state "No relevant quotes found" rather than answering from general knowledge.

Want this running in your business?

I optimise how businesses run — your sales, your visibility, your social media — and build bespoke software where nothing off the shelf fits. The first conversation is free. Work starts from £150 a day.