chunking-strategies

chunking-strategies is a skill for Claude Code from jpoutrin/product-forge. It costs 35 tokens per session (650 once invoked), scanned A, original, MIT.

A guide to chunking, meaning splitting documents into smaller pieces, for retrieval-augmented generation (RAG). It describes fixed-size, meaning-based, and recursive ways to divide text.

In plain words
What is it for?
Use it when building document-processing pipelines and choosing chunk sizes and boundaries for different document types.
Why use it?
The way a document is split affects which information an AI system can find and use later.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the rag-cag plugin — 2 skills, 1 agent shipped together

Good fit Use it when building document-processing pipelines and choosing chunk sizes and boundaries for different document types.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jpoutrin/product-forge/chunking-strategies
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jpoutrin/product-forge --skill chunking-strategies
Clone the repo
git clone --depth 1 https://github.com/jpoutrin/product-forge

Made for: Claude Code.

Or install rag-cag, the plugin that ships this one along with the rest of its 2 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for chunking-strategies

README.md
[![agentmods](https://agentmods.dev/badge/skills/jpoutrin/product-forge/chunking-strategies/github.svg)](https://agentmods.dev/skills/jpoutrin/product-forge/chunking-strategies)
Your own site
<a href="https://agentmods.dev/skills/jpoutrin/product-forge/chunking-strategies"><img src="https://agentmods.dev/badge/skills/jpoutrin/product-forge/chunking-strategies/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for chunking-strategies

Your own site · 80×15
<a href="https://agentmods.dev/skills/jpoutrin/product-forge/chunking-strategies"><img src="https://agentmods.dev/badge/skills/jpoutrin/product-forge/chunking-strategies.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 650 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00035 $0.00650
Opus 5.5 $0.00014 $0.00260
Sonnet 5.5 $0.00007 $0.00130
Haiku 4.5 $0.00003 $0.00065

Measured 3mo ago against content hash 59992b7886b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

chunking-strategies scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/rag-cag/skills/chunking-strategies/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Chunking Strategies Skill

This skill provides chunking strategies for RAG document processing.

Chunking Methods

1. Fixed-Size Chunking

def fixed_size_chunk(text: str, chunk_size: int = 500, overlap: int = 50):
    chunks = []
    start = 0
    while start < len(text):
        end = start + chunk_size
        chunks.append(text[start:end])
        start = end - overlap
    return chunks

2. Semantic Chunking

Split on natural boundaries (sentences, paragraphs).

def semantic_chunk(text: str, max_tokens: int = 500):
    paragraphs = text.split("\n\n")
    chunks = []
    current_chunk = []
    current_tokens = 0

    for para in paragraphs:
        para_tokens = count_tokens(para)
        if current_tokens + para_tokens > max_tokens:
            chunks.append("\n\n".join(current_chunk))
            current_chunk = [para]
            current_tokens = para_tokens
        else:
            current_chunk.append(para)
            current_tokens += para_tokens

    if current_chunk:
        chunks.append("\n\n".join(current_chunk))
    return chunks

3. Recursive Chunking

Hierarchical splitting on multiple separators.

SEPARATORS = ["\n\n", "\n", ". ", " "]

def recursive_chunk(text: str, max_size: int, separators: list[str]):
    if len(text) <= max_size:
        return [text]

    sep = separators[0] if separators else ""
    chunks = []
    parts = text.split(sep)

    for part in parts:
        if len(part) <= max_size:
            chunks.append(part)
        elif len(separators) > 1:
            chunks.extend(recursive_chunk(part, max_size, separators[1:]))
        else:
            chunks.append(part[:max_size])

    return chunks

Chunking by Document Type

Document Type Recommended Strategy Chunk Size
Technical docs Semantic (headers) 500-1000 tokens
Legal documents Semantic (sections) 1000-2000 tokens
Code Function/class based 200-500 tokens
Conversations Message boundaries 100-300 tokens
General text Recursive 300-500 tokens

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 104 lines · 35 tokens per session scan A 59992b7886b6

Subscribe to this mod's changes

chunking-strategies is a skill published in the GitHub repository jpoutrin/product-forge (16 stars, last pushed 9mo ago), licensed MIT. It adds 35 tokens to every session and 650 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

chunking-strategies compared with skills from other repositories

chunking-strategies next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
chunking-strategiesjpoutrin/product-forgeSkill169mo agoMITA35Claude Code
agent-platform-rag-engine-managementgoogle/skillsSkill26ktodayApache-2.0A85Claude Code, Codex
llm-app-patternsdavila7/claude-code-templatesSkill35ktodayMITA54Claude Code, Codex
graphifyGraphify-Labs/graphifySkill157kyesterdayApache-2.0B76Claude Code
9router-embeddingsdecolua/9routerSkill33k12d agoMITA66Claude Code, Codex
eddtruera/trulensSkill3.7ktodayMITA63Claude Code, Codex
browserwing-adminMemTensor/MemOSSkill13kyesterdayApache-2.0B47Claude Code, Codex