HOW-TO GUIDE

How to hand document reading to a cheap model from Claude Code and Codex

Based on a guide by Ercan Atay on Medium · Nov 30, 2026

You'll end with: Headless, tool-free calls to a small model that read documents and lists for your main Claude Code or Codex agent, which plans and checks.

Why it's worth having: A short task as a headless call used 810 tokens instead of 255,000 as a subagent, and one contract folder question fell from 90,000 to 21,800 tokens.

At a glance

WHO IT'S FOR
Engineers, analysts, and admins who run Claude Code or Codex on document-heavy work.
LEVEL
Advanced
COST
Free to read. Claude Code and Codex run on your own paid plans; markitdown is free and open source.
YOU NEED
Claude Code or the Codex CLI · markitdown · Python

The method, in short

  1. 1Run the small model headless with no tools, no MCP servers, no settings files, and a one-line system prompt, from an empty folder.
  2. 2Convert PDF, Word, and Excel files to Markdown locally with markitdown, then send 30,000-token chunks that match your keywords.
  3. 3Have the small model write long results to a file and return only the path and a short summary to the main model.
  4. 4Add a Claude Code PreToolUse hook that blocks small-model subagents and points to the headless call instead.

The article has the exact Claude Code and Codex flags, the hook, the team rollout, and every measured token count.