long-document-handler

Interrupt document processing when content exceeds 20,000 tokens.

Updated Nov 24, 2025
One-click install
npx skills add https://github.com/carlo-spada/xentri --skill long-document-handler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: long-document-handler
Source: https://github.com/carlo-spada/xentri/tree/main/.claude/skills/long-document-handler
Command: npx skills add https://github.com/carlo-spada/xentri --skill long-document-handler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Large documents can overwhelm AI context windows, leading to incomplete analysis, poor quality responses, and wasted tokens. This skill prevents these issues by intelligently managing long content, ensuring Claude provides accurate and comprehensive results without manual intervention.

Core Features & Use Cases

  • Context Window Protection: Automatically detects and stops processing documents exceeding token limits, preventing AI "forgetfulness" and truncation.
  • Smart Reading Options: Offers choices like targeted extraction, summary generation, or document sharding, allowing you to get precise information or a high-level overview efficiently.
  • Guided Writing Strategies: Provides methods for writing large documents in phases, outlines, or split designs, helping you structure complex content effectively.
  • Use Case: When asked to analyze a massive 100-page architecture document, Claude will pause, inform you of its size, and offer to summarize it or extract specific sections. This saves you from receiving a garbled, incomplete response and guides you to the most efficient way to process the information.

Quick Start

"Analyze the attached 'project-epic-v2.md' document and tell me its key objectives."

Frequently Asked Questions about long-document-handler

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent large documents from overwhelming Claude's context window?

Large documents exceeding 20,000 tokens can cause incomplete analysis and truncated responses. This skill automatically detects oversized content and pauses processing, notifying you of the document's size and offering alternatives like targeted extraction, summarization, or sharding to keep Claude within safe limits.

What should I do when a document is too large to analyze in one pass?

When a document surpasses token limits, you can choose between multiple strategies: extract specific sections you need, generate a high-level summary, split the document into manageable shards, or proceed with full reading if context permits. Each option is presented with explicit thresholds (80,000+ characters, 15,000+ words, 2,000+ lines, 20,000+ tokens).

Can I use this skill with architecture docs, PRDs, and markdown files?

Yes, this skill is designed for lengthy structured documents like architecture documentation, product requirement documents, and extended markdown files. It detects when these files approach context limits and offers processing modes tailored to complex, multi-section content.

How does token estimation work for determining document size?

The skill estimates tokens using a roughly 4-character-per-token ratio and flags documents when they reach 20,000 tokens or equivalent thresholds (80,000+ characters, 15,000+ words, 2,000+ lines), giving you an upfront warning before processing stalls.

What are the limitations when writing large documents with this skill?

This skill supports guided strategies for writing large documents in phases or split designs, but the actual composition happens in stages. It helps structure complex content and integrates with shard and BMAD workflows, though it enforces stop-on-threshold behavior rather than enabling unlimited writing.

Why should I use document sharding instead of summarization?

Sharding splits your document into smaller, independently processable chunks, preserving detail and structure across the entire content. Summarization provides high-level overviews when detail isn't needed. Choose sharding for comprehensive analysis of large files and summarization when you need quick insights without full content.