chunk

Split PDF and Markdown files into token-based or page-based chunks.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/garimto81/claude --skill chunk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chunk
Source: https://github.com/garimto81/claude/tree/main/.claude/skills/chunk
Command: npx skills add https://github.com/garimto81/claude --skill chunk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymupdf, tiktoken, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the process of breaking down large PDF or Markdown files into smaller, more digestible pieces suitable for Large Language Models (LLMs).

Core Features & Use Cases

  • Token-based Chunking: Splits text based on token count for LLM input.
  • Page-based Chunking: Preserves document layout by splitting into fixed page groups, ideal for multimodal LLMs.
  • PRD Chunking: Hierarchically chunks documents like PRDs, preserving structure.
  • Use Case: You have a 50-page PDF report and need to feed its content into an LLM for summarization. This Skill can split it into manageable chunks, either by token count or by groups of pages, ensuring the LLM can process it effectively.

Quick Start

Use the chunk skill to split the attached document 'report.pdf' into token-based chunks.

Frequently Asked Questions about chunk

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

FAQPage Schema
How do I split a PDF into chunks for LLM processing?

Token-based chunking splits text based on token count for LLM input, while page-based chunking preserves document layout by dividing content into fixed page groups. The Skill supports both strategies to break down large PDFs into manageable pieces for LLM consumption.

What is the best way to chunk a Markdown file by token count?

The best way to chunk a Markdown file by token count is using a token-based splitting strategy. This approach divides the text based on token count, making the resulting chunks directly suitable for LLM input processing and analysis.

Can I split a large PDF report into fixed page groups for multimodal LLMs?

Yes, you can split a large PDF report into fixed page groups using the page-based chunking strategy. This method preserves the document layout, which is ideal for multimodal LLMs that process visual and textual information together.

Does PRD chunking preserve document structure when splitting text?

PRD chunking hierarchically chunks documents like Product Requirements Documents while preserving their structure. This ensures that the logical flow and organizational hierarchy of the original document remain intact within each generated chunk.

How does background execution handle large PDF files during chunking?

Background execution processes large PDF files asynchronously during chunking, preventing interface blockage. This allows you to continue working while the Skill splits the document into token-based or page-based chunks in the background.

Do I need tiktoken to split text by token count for LLM input?

Yes, tiktoken is required to split text by token count for LLM input. The Skill uses this dependency alongside pymupdf to accurately measure and divide PDF and Markdown files into token-based chunks for processing.