# AI use cases for Textfold (chenxiachan/textfold)

Repo: [chenxiachan/textfold](https://github.com/chenxiachan/textfold) | Use cases: 5 | Page: https://dedupedai.com/use-cases/chenxiachan-textfold/

TextFold is an open-source Python tool that folds papers, web pages, files, and AI replies into five levels of detail, from a one-screen overview down to the original text.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Read a long paper from overview to full text: https://dedupedai.com/use-cases/chenxiachan-textfold/read-a-paper-in-five-levels/
- Let an agent read a document map first, then one section: https://dedupedai.com/use-cases/chenxiachan-textfold/let-an-agent-read-a-document-by-level/
- Fold long Claude Code replies to a level you can scan: https://dedupedai.com/use-cases/chenxiachan-textfold/fold-claude-code-replies/
- Export a folded paper as one page that opens without a server: https://dedupedai.com/use-cases/chenxiachan-textfold/save-a-folded-page-to-share/
- Open your Zotero library items as folded text: https://dedupedai.com/use-cases/chenxiachan-textfold/read-a-zotero-library-in-levels/

## How to read a long paper from overview to full text with Textfold

Repo: [chenxiachan/textfold](https://github.com/chenxiachan/textfold) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Paste an arXiv or PubMed Central link and read the paper one level at a time.

**Who it is for:** A researcher or student who has a long paper to understand quickly and needs to decide which parts deserve a close read.

**The problem:** A full paper takes a long time to read, and it is hard to tell which sections matter before reading them.

**The outcome:** A folded view of the paper as a map of its sections, which you zoom into to reach the exact sentences you need.

### Steps

1. Run `python3 -m pip install textfold` in a terminal, then run `python3 -m textfold serve`.
2. Open `http://localhost:3017` in your browser.
3. If the first page asks, connect a model: use Claude Code, Codex, or your ChatGPT plan, or click OpenRouter in one click.
4. Paste the paper's arXiv or PubMed Central link and pick a language.
5. Read the map at level 5, then press 3 or 2 on a section you want to understand more closely, and press 1 for the original text.

### Prompt to paste into your agent

```text
Using the TextFold repo at github.com/chenxiachan/textfold, run `python3 -m textfold get <paper-link> --level key --section 3` to get the key points of section 3 of the paper. Expected output: the points of that section, each with its reason. Verify that every point is marked as model-written and points back to the author's sentences it rests on.
```

### Caveat

Each level below Full is a fold of the text, and lines at levels 3 to 5 are written by a model, so check them against the original sentences they cite.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/chenxiachan-textfold/read-a-paper-in-five-levels/

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

Repo: [chenxiachan/textfold](https://github.com/chenxiachan/textfold) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

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

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

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

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

### 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 to paste into your agent

```text
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.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/chenxiachan-textfold/let-an-agent-read-a-document-by-level/

## How to fold long Claude Code replies to a level you can scan with Textfold

Repo: [chenxiachan/textfold](https://github.com/chenxiachan/textfold) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Install the TextFold mod so every Claude Code reply shows five levels, from one sentence to full text.

**Who it is for:** A developer who gets long Claude Code replies and wants to read the answer first and expand only what matters.

**The problem:** Long agent replies bury the answer, and reading every word of each reply takes time.

**The outcome:** Each reply can be shown at the level you press, from the one-sentence gist to every word Claude wrote.

### Steps

1. Make sure Claude Code is version 2.1.287 or later.
2. Run `claude plugin marketplace add chenxiachan/textfold`.
3. Run `claude plugin install textfold@textfold`.
4. In the prompt, type a digit while the prompt is empty: 5 for the one-sentence answer, 3 for the points, 1 for every word.

### Prompt to paste into your agent

```text
Using the TextFold repo at github.com/chenxiachan/textfold, install the Claude Code plugin with `claude plugin marketplace add chenxiachan/textfold` and `claude plugin install textfold@textfold`. Expected output: after a reply, pressing 5 shows the answer in one sentence and pressing 1 shows the full reply. Verify that the Full level matches the reply exactly, since nothing is paraphrased.
```

### Caveat

The plugin needs Claude Code 2.1.287 or later, and the README says short replies under about 80 words always show as written.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/chenxiachan-textfold/fold-claude-code-replies/

## How to export a folded paper as one page that opens without a server with Textfold

Repo: [chenxiachan/textfold](https://github.com/chenxiachan/textfold) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Export a paper's levels as a single HTML file to share or keep offline.

**Who it is for:** A reader who wants to pass a summarized paper to a colleague or keep a copy that opens in any browser.

**The problem:** A folded reading view lives on a local server, so it is not easy to send to someone else.

**The outcome:** One HTML file with the levels, your chosen notes, and optionally the original PDF beside the text.

### Steps

1. Fold the paper first, either in the reader at `http://localhost:3017` or with the command below.
2. Run `python3 -m textfold export 2512.23916` to write the page without your notes.
3. In the reader, click **Save** at the top to keep the page with your notes, or keep only your notes as a page, a PDF, Markdown for Obsidian, or JSON.
4. Send the HTML file. It opens anywhere without a server.

### Prompt to paste into your agent

```text
Using the TextFold repo at github.com/chenxiachan/textfold, run `python3 -m textfold export <arxiv-id>` for the paper with ID <arxiv-id>. Expected output: an HTML file with the five levels of that paper. Verify that the file opens in a browser with no server running and that the license note under the title is still shown.
```

### Caveat

The README says that when you share a file, you must follow the terms of the original text, which appear under its title.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/chenxiachan-textfold/save-a-folded-page-to-share/

## How to open your Zotero library items as folded text with Textfold

Repo: [chenxiachan/textfold](https://github.com/chenxiachan/textfold) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Connect TextFold to the Zotero 7 app and read any library item in five levels.

**Who it is for:** A researcher who keeps papers in Zotero and wants to read them in levels without moving files around.

**The problem:** Papers saved in Zotero are hard to skim, and exporting them to another tool breaks the link to the library.

**The outcome:** Your Zotero collections open in TextFold, and any item reads in levels with the title, authors, and citekey you entered in Zotero.

### Steps

1. In Zotero 7, go to **Settings › Advanced** and turn on **Allow other applications on this computer to communicate with Zotero**.
2. Open TextFold at `http://localhost:3017`, or open the desktop app.
3. Click **Zotero library**, under the drop zone.
4. Pick an item and click **Read**.

### Prompt to paste into your agent

```text
Using the TextFold repo at github.com/chenxiachan/textfold, enable Zotero 7 communication under Settings › Advanced, then open the Zotero library in TextFold. Expected output: your Zotero collections listed, and the chosen item shown at its folded levels. Verify that the item's title and authors match what is in Zotero, and that nothing in the Zotero library has changed.
```

### Caveat

The README says the Zotero connection works only while the Zotero app is running on the same computer, and items with only a DOI open from Europe PMC, which needs an open full text.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/chenxiachan-textfold/read-a-zotero-library-in-levels/
