The plugin ecosystem of DeepSeek Harness (DSH) allows developers to extend model reasoning capabilities. For reading tasks, the biggest pain point is context window limitations: putting an entire book into the main session quickly consumes tokens. dsh-deep-reading solves this problem: it splits chapters, processes the original text through single-chapter subagents, and lets the main session receive only short results, enabling a token-efficiency-first reading workflow.
The core value of the plugin is turning “reading a book” into something cumulative, resumable, and exportable. It maintains chapter memory with position markers, allowing users to switch perspectives without rereading the original text; it also supports verbatim export, ensuring that exported notes are completely identical to the source text.
Core Features¶
Import and Chapter Splitting¶
The plugin supports importing multiple formats and automatically splitting chapters:
- Format support: EPUB, a single Markdown file, a Markdown directory containing multiple chapters, TXT, and PDF.
- Conversion logic: TXT and PDF files are first converted to Markdown via lib/convert.js. The converted full text is preserved in books/<ID>/source.md.
- Chapter-splitting rules: Markdown is split by # top-level headings; content before a heading is treated as a “preface”. EPUB is split according to the book’s own spine structure.
- Paragraph numbering: On import, [1] [2] [3] paragraph numbers are added to each chapter’s main text for later locating.
- Idempotency: Re-importing when the source file has not changed returns skipped:true.
Single-Chapter Deep Reading and Subagents¶
- Original-text isolation: After the user initiates a deep reading instruction, the main session spawns a
reading_chaptersubagent. The subagent independently works with the chapter’s original text and reading purpose; the returned explanation and status are written to disk, but the original text does not enter the main session. - Resumable reading: Overly long chapters (default 12000 bytes) are automatically segmented. If interrupted, the next reading session can resume from the breakpoint; after the full chapter is read, the status changes from
partialtocomplete.
Chapter Memory and Reuse¶
- Memory with position markers: Each AI explanation must include a
[n]paragraph position marker and is written tomemory/NNN.md. Memory is bound to the source file hash; changes to the source file invalidate older memory. - Immutable memory: Once memory is marked
completeand written, it cannot be modified. If later understanding changes, corrections must be appended in later chapter memory entries. - Reuse of finished chapters:
dr_statuschecks whether memory satisfies three conditions:complete, matching hash, and matching protocol version. If satisfied, it is markedreusable, and subsequent explanations are based directly on memory without rereading the original text.
Tools and Export¶
The plugin provides the following core tools:
- dr_import: Import and split chapters.
- dr_read: Read-only mode, supporting four ways to locate the original text: index, range, locate, and find.
- dr_write: Write memory, explanations, user notes, and more.
- dr_status: Check the status of each chapter and reusable determination.
- dr_usage: Record token consumption, supporting report mode for aggregation.
- dr_export_epub: Concatenate lecture/*.md files verbatim into EPUB3.
Installation and Enablement¶
To install the plugin, use the official command and directly specify the local directory path:
dsh plugin --profile <profile> add <本目录路径>
After installation, the desktop version must restart the DSH app for the plugin to load.
Typical Usage¶
The following is a typical reading workflow:
- Import the book:
Import a book and specify an ID. The plugin automatically splits chapters and builds an index. - Deep-read a single chapter:
Initiate a deep reading instruction in the conversation. The main session spawns a subagent to process the chapter, and the original text does not enter the main conversation. - Continue reading:
In a new session, simply say “continue reading”. The plugin starts from the first incomplete or expired chapter. - Switch perspectives:
For a finished chapter, request “explain it again from a character’s perspective”. The plugin reuses memory and does not reread the original text. - Export:
Usedr_export_epubto generate an e-book with verbatim content.
Notes¶
- Scanned-copy limitation: PDF scans without a text layer are rejected.
- PDF dependency: PDF conversion depends on specific CMap tables and the
pdfjs-distbuild. If misconfigured, Chinese text may be silently lost. - Data structure:
completememory cannot be modified and must be corrected through later chapter entries. - Permissions: The plugin runs with the current DSH process permissions. Review the source code and license before installation.
Library Configuration¶
The default library path is $DSH_HOME/deep-reading/books. If you need to share the library or change the path, modify the booksRoot setting in the profile’s cordis.patch.yml.