DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to let an agent read a document map first, then one section with Textfold

Give an agent a command that returns a document one level at a time, coarsest first.

Short answer: Run python3 -m pip install textfold and connect a model in the first run, since a document not folded yet is folded first with that model; then Get the map of a document with python3 -m textfold get https://arxiv.org/abs/2512.23916; Get one section's points with python3 -m textfold get 2512.23916 --level key --section 3. All steps.

  • Research
  • Intermediate
  • 30 minutes
  • From the README
  • Any agent

Who it is forA developer or analyst whose agent or script has to process long documents without filling its context window with the whole text.

The problemAgents that load an entire paper or report spend most of their context on text they only needed to skim.

The outcomeThe agent reads the section map first, then pulls only the sections it needs at a chosen level.

What you need first

  • Python 3.9 or newer, or the TextFold desktop app for macOS or Windows
  • A model you already have, such as Claude Code, Codex, a ChatGPT plan, an API key, or a free OpenRouter setup

Steps

  1. Run python3 -m pip install textfold and connect a model in the first run, since a document not folded yet is folded first with that model.
  2. Get the map of a document with python3 -m textfold get https://arxiv.org/abs/2512.23916.
  3. Get one section's points with python3 -m textfold get 2512.23916 --level key --section 3.
  4. Get the whole document in the TextFold format with python3 -m textfold get report.pdf --json when a full structured copy is needed.

Prompt for your agent

Using the TextFold repo at github.com/chenxiachan/textfold, run `python3 -m textfold get <document> ` first without a level to read the section map, then run it again with `--level key --section <n>` for the one section that answers the task. Expected output: the section topics, then the points of that section with their reasons. Verify that each model-written line is marked as such before using it.

Caveat. The README does not say how long a first fold takes, so budget for a model call on each document the first time it is read.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for chenxiachan/textfold and "Let an agent read a document map first, then one section"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer