agentsop-multiscale-chunking

agentsop-multiscale-chunking is a skill for Claude Code, Codex from agentsope/SkillAlchemy. It costs 92 tokens per session (4,962 once invoked), scanned A, original, MIT.

A method for splitting long documents into multiple retrieval sizes for RAG, a system that searches documents before generating an answer. It addresses cases where small pieces lack context and large pieces are poor search matches.

In plain words
What is it for?
It helps design or review document-ingestion code for manuals, filings, contracts, research papers, and codebases when one chunk size is not sufficient.
Why use it?
It helps balance precise search results with enough surrounding information for the model to understand them.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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.

agentmods
npx agentmods add skills/agentsope/skillalchemy/agentsop-multiscale-chunking
Any agent
npx skills add agentsope/SkillAlchemy --skill agentsop-multiscale-chunking
Clone the repo
git clone --depth 1 https://github.com/agentsope/SkillAlchemy

Made for: Claude Code, Codex.

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 agentsop-multiscale-chunking

README.md
[![agentmods](https://agentmods.dev/badge/skills/agentsope/skillalchemy/agentsop-multiscale-chunking.svg)](https://agentmods.dev/skills/agentsope/skillalchemy/agentsop-multiscale-chunking)
Your own site
<a href="https://agentmods.dev/skills/agentsope/skillalchemy/agentsop-multiscale-chunking"><img src="https://agentmods.dev/badge/skills/agentsope/skillalchemy/agentsop-multiscale-chunking.svg" alt="Measured on agentmods" height="20"></a>
Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,962 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00092 $0.04962
Opus 5 $0.00046 $0.02481
Sonnet 5 $0.00018 $0.00992
Haiku 4.5 $0.00009 $0.00496

Measured 2d ago against content hash 12a2e1027361, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

agentsop-multiscale-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 2d 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.

skills/agentsop-multiscale-chunking/SKILL.md · 359 lines

How it starts

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

Multi-scale Chunking · C5 Enhancement Overlay

Overlay on top of [[llamaindex]]. The base skill teaches the 5-layer RAG pipeline and lists DecoupleChunkScope as one optimization knob among many. This overlay zooms in on that single knob and turns it into a standalone recipe: how to resolve the chunk paradox when one chunk size is provably not enough. Third-person analytical view for an agent writing / reviewing RAG ingestion code — not an end-user tutorial.


1. 何时激活 (Activation Rules)

Activate this overlay when all three RAG preconditions hold and the chunk paradox has actually surfaced:

  1. The corpus is long documents — prose manuals, financial filings, legal contracts, research papers, codebases — where a single answer-bearing fact sits inside a larger context that the LLM needs to interpret it.
  2. A chunk-size sweep has stalled: small chunks (128–256) win retrieval precision but the LLM answers from fragments; large chunks (1024–2048) give rich context but recall on specific queries drops because the embedding becomes a "topic average". The official failure-mode checklist documents both poles as separate failures — #2 (wrong chunk from too-small) and #6 (context overflow / dilution from too-large) (cited in [[llamaindex]] R3).
  3. Faithfulness or relevancy is plateauing below target and bumping chunk_size only moves the failure from one pole to the other.

Concrete triggers:

  • "Answers are technically retrieved but the model lacks context to explain them."
  • "I keep retuning chunk_size and it never wins on both faithfulness and recall."
  • A reviewer sees SentenceSplitter(chunk_size=4096) shipped as the fix for "incomplete answers" (this is anti-pattern A1 in [[llamaindex]]).

Do not activate when:

  • The corpus is short/static (<100k tokens) — prompt-stuff with caching; multi-scale chunking is over-engineering (§6).
  • The chunk-size sweep did converge on a single winner (e.g. 1024 for prose) — pin it and stop.
  • Retrieval quality is fine and the bottleneck is orchestration or synthesis.

Read the full file on GitHub · 359 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. 2d ago Changed · -7 lines · -133 tokens per session 12a2e1027361
  2. 6d ago First seen · 366 lines · 225 tokens per session scan A 7e5045b32dcf

Subscribe to this mod's changes

agentsop-multiscale-chunking is a skill published in the GitHub repository agentsope/SkillAlchemy (361 stars, last pushed 3d ago), licensed MIT. It adds 92 tokens to every session and 4,962 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-30.

Related

Other skills, from other repositories

karpathy-llm-wiki

Use when building or maintaining a personal LLM-powered knowledge base. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki quality, 'add to wiki', 'what do I know about', or any mention of 'LLM wiki' or 'Karpathy wiki'.

Astro-Han/karpathy-llm-wiki · 67 tokens

mixedbread-search

Build and query managed search indexes (Stores) using the Mixedbread Python and TypeScript SDKs. Use when creating knowledge bases, uploading documents, performing semantic or vector search, asking questions over documents, using agentic multi-step retrieval, combining store search with web results, filtering by…

mixedbread-ai/skills · 70 tokens

mxbai-cli

Use the mxbai CLI to manage stores, upload files, search documents, ask questions, and sync directories from the terminal. Use when performing Mixedbread operations via command line, setting up CI/CD pipelines with store sync, or managing API keys.

mixedbread-ai/skills · 55 tokens

ccg-docs

Generate Markdown documentation from code graphs, build RAG indexes for AI consumption, and lint documentation quality.

tae2089/code-context-graph · 23 tokens

rag-evaluator

Generates tailored giskard.checks evaluation suites for RAG (Retrieval-Augmented Generation) systems. Use whenever a user describes a Q&A bot grounded in documents, a knowledge-base chatbot, a retrieval system, or wants to evaluate answer groundedness, faithfulness, hallucination, retrieval quality, citation accuracy…

Giskard-AI/giskard-skills · 204 tokens

local-rag-mcp

Use when querying, ingesting, or maintaining a local RAG MCP corpus for semantic document retrieval with privacy controls.

yeaight7/agent-powerups · 29 tokens