chunking

chunking is a skill for Claude Code from kitchen-engineer42/joharnessburg. It costs 90 tokens per session (1,385 once invoked), scanned A, original, MIT.

A document-splitting method for breaking parsed Markdown into a tree of smaller sections. Each section keeps information about its source, place in the document, and size.

In plain words
What is it for?
Use it between document parsing and knowledge extraction. It helps prepare long documents or collections of shorter files for per-section processing and parallel review.
Why use it?
Large documents are difficult to process reliably in one pass. Smaller, organized chunks let later extraction workers handle focused pieces while preserving the document's structure.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the john plugin — 28 skills, 5 commands, 5 agents, 3 hooks shipped together

Good fit Use it between document parsing and knowledge extraction. It helps prepare long documents or collections of shorter files for per-section processing and parallel review.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kitchen-engineer42/joharnessburg/chunking
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 kitchen-engineer42/joharnessburg --skill chunking
Clone the repo
git clone --depth 1 https://github.com/kitchen-engineer42/joharnessburg

Made for: Claude Code.

Or install john, the plugin that ships this one along with the rest of its 28 skills, 5 commands, 5 agents, 3 hooks.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/kitchen-engineer42/joharnessburg/chunking.svg)](https://agentmods.dev/skills/kitchen-engineer42/joharnessburg/chunking)
Your own site
<a href="https://agentmods.dev/skills/kitchen-engineer42/joharnessburg/chunking"><img src="https://agentmods.dev/badge/skills/kitchen-engineer42/joharnessburg/chunking.svg" alt="Measured on agentmods" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,385 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.00090 $0.01385
Opus 5 $0.00045 $0.00692
Sonnet 5 $0.00018 $0.00277
Haiku 4.5 $0.00009 $0.00138

Measured 8d ago against content hash 29703c3ec035, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

chunking 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 8d 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/joharnessburg/skills/chunking/SKILL.md · 89 lines

How it starts

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

chunking

Parsed markdown is rarely the right unit for downstream extraction — too big to fit one extractor's context, too coarse to fan out subagents over. Chunking turns parsed output into a tree of progressively-disclosed pieces the extraction phase can sweep.

Where the work happens

  • Inputs: <project>/.john/parsed/*/doc.md (from [[parsing]])
  • Outputs: <project>/.john/chunks/<chunk-id>.md + <project>/.john/chunks/chunks_index.json (master map)
  • Each chunk has YAML frontmatter (chunk_id, parent_id, source_doc, char_count, header_path) + body markdown.

The onion decision lives in phase-design

The peeler-vs-wrapper-vs-hybrid decision is made at phase-design time, not chunking time — see [[phase-design]] for the rubric and the decision criteria. By the time this skill runs, PLAN.md's chunk phase already specifies which mode applies (and for hybrid corpora, the per-section mode). Read PLAN.md's chunk phase; execute what it says.

Brief mode reminders so you don't have to context-switch:

  • Peeler: long doc → tree of pieces via header hierarchy. Default for textbooks, regulations, long articles.
  • Wrapper: many short files → assembled tree. Default for corpora arriving as folders of small files.
  • Hybrid: peel the long ones, wrap the short ones, merge their trees at a shared root.

The peeler algorithm

  1. Read the parsed doc.md.
  2. Extract the header hierarchy (H1/H2/H3...) with line numbers.
  3. Walk top-down, splitting at the highest-level boundary that produces chunks within the token budget. Don't pre-decide a level; let content drive it.
  4. If a section is still too large after H1/H2/H3 splits, fall back to LLM-wedge chunking (see references/llm-wedge-chunker.md): ask an LLM to suggest cut points within the running window, fuzzy-match the suggestions back to the source via Levenshtein, slide forward.
  5. Emit each chunk with frontmatter linking parent/source. Build chunks_index.json as a tree.

Tunable: MAX_TOKEN_LENGTH per chunk. Default ~100K tokens (large; we want bigger chunks where possible — "bigger chunks > smaller chunks. Only chunk when necessary, never over-chunk" per the predecessor's pipeline spec). Drop if the extraction phase struggles.

Read the full file on GitHub · 89 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 89 lines · 90 tokens per session scan A 29703c3ec035

Subscribe to this mod's changes

chunking is a skill published in the GitHub repository kitchen-engineer42/joharnessburg (9 stars, last pushed 1mo ago), licensed MIT. It adds 90 tokens to every session and 1,385 once invoked, about $0.0005 per session on Opus 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-08-31.

Related

Other skills, from other repositories

text-stats

Compute word count, character count, or reading time for a piece of text using the in-bundle text-stats engine. Invoke whenever the user asks how long a passage is, how many words or characters it has, or how long it takes to read.

curie-eng/curie · 56 tokens

book-capture

Capture book pages from Mac Kindle, Apple Books, Kindle Cloud Reader, PDF files, or photos of a physical book, then OCR and generate structured Obsidian Markdown. Activates when user mentions capturing a book, Kindle screenshots, Apple Books capture, book OCR, book-to-markdown conversion, photographing a paper book…

masterleopold/book-capture · 80 tokens

wise-markitdown

File-to-markdown text extraction via Microsoft's markitdown CLI — the ONE tool to reach for whenever text/content must be extracted from a binary or structured file: PDF, Word (.docx), PowerPoint (.pptx), Excel (.xlsx/.xls), images (EXIF metadata), audio (metadata + transcription), HTML, CSV/JSON/XML, ZIP archives…

e1024kb/wise-claude · 195 tokens

research-capture

The durable research-evidence-trail discipline. At a deep-research-bearing research-first gate, persist the FULL claim-level trail (verified ∧ REFUTED) as - .md at the configured governance.researchpath (defaults to .foundry/research/) from the research-artifact template, and author the ADR at the configured…

lukasrepublic/agentic-foundry · 147 tokens

md-to-pdf

Convert Markdown to PDF via reportlab or weasyprint engines. Triggers - pdf, md to pdf, markdown to pdf, generate pdf.

kochetkov-ma/claude-brewcode · 34 tokens

especialista-em-documentos

Especialista em Documentos. Use para criar, editar, converter e estruturar arquivos .md, .doc e .docx: estilos, sumário, seções, tabelas e templates. Palavras-chave: documento, Word, docx, markdown, doc, modelo, formatação.

euwebertdefreitas/ai-skills-for-claude-code · 0 tokens