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.
npx skills add alivirgo/Major-AI-Skills --skill token-aware-chunkinggit clone --depth 1 https://github.com/alivirgo/Major-AI-SkillsWrote 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.
[](https://agentmods.dev/skills/alivirgo/major-ai-skills/token-aware-chunking)<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/token-aware-chunking"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/token-aware-chunking/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.
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/token-aware-chunking"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/token-aware-chunking.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00023 | $0.01220 |
| Opus 5.5 | $0.00009 | $0.00488 |
| Sonnet 5.5 | $0.00005 | $0.00244 |
| Haiku 4.5 | $0.00002 | $0.00122 |
Grade A, and why
token-aware-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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Token-Aware Semantic Chunking Protocol (Boundary-Aligned RAG Slicing)
Overview
When indexing documentation or codebases for vector search and RAG retrieval, naive splitters slice text by fixed character counts (text[i:i+2000]).
Fixed-character chunking causes severe retrieval degradations:
- Broken Code Blocks: Splits a TypeScript interface or Python function midway through its body, creating unparseable syntax fragments.
- Mid-Word Token Clipping: Slices words across token boundaries, corrupting embedding vector representations.
- Embedding Model Ceiling Exceedance: A character count that translates to 8,250 tokens gets silently truncated by an embedding model with an 8,192-token ceiling.
The Token-Aware Semantic Chunking Protocol measures chunk size strictly using the target tokenizer (tiktoken / BPE) and splits text recursively along semantic boundaries (Markdown Headers, AST Function Blocks, Double Newlines).
Fixed-Character Slicing vs. Token-Aware Semantic Chunking
┌─────────────────────────────────────────────────────────────┐
│ Text Chunking Mechanics │
│ │
│ Fixed Character Slicing (`len(text) == 2000`): │
│ • Chunk 1 ends: `function calculateTotal(price: num` │
│ • Chunk 2 starts: `ber, tax: number) { return price + ...` │
│ ↳ Syntax broken across 2 chunks! Vector embedding corrupted│
│ │
│ Token-Aware Semantic Slicing (512 Tokens / AST Boundary): │
│ • Chunk 1: Complete `calculateTotal` function + docstring │
│ • Chunk 2: Complete `processPayment` function │
│ ↳ 100% Valid code syntax, exact 512-token budget adherence │
└─────────────────────────────────────────────────────────────┘
The 4-Tier Semantic Split Hierarchy
When partitioning text into token-bounded chunks, search for split delimiters in descending priority:
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.
- 1mo ago Changed · -20 tokens per session 9443023b51f9
- 1mo ago First seen · 131 lines · 43 tokens per session scan A 38a6bff88e80
token-aware-chunking is a skill published in the GitHub repository alivirgo/Major-AI-Skills (2 stars, last pushed today), licensed MIT. It adds 23 tokens to every session and 1,220 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-08-31.
Other skills, from other repositories
azure-data-factory
Expert knowledge for Azure Data Factory development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when configuring IR/SSIS/SHIR, mapping data flows, SAP/SaaS connectors, CI/CD…
azure-machine-learning
Expert knowledge for Azure Machine Learning development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using AutoML, Prompt Flow, online/batch endpoints, vector stores/RAG, or…
azure-databricks
Expert knowledge for Azure Databricks development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using Unity Catalog, Lakeflow pipelines, Lakebase, AI Runtime/agents, or…
azure-hdinsight
Expert knowledge for Azure HDInsight development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when working with HDInsight Spark/Hive/Kafka/HBase clusters, Ambari/Oozie pipelines…
azure-synapse-analytics
Expert knowledge for Azure Synapse Analytics development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using Synapse SQL pools, Spark pools, Delta Lake, Synapse Link…
azure-cognitive-search
Expert knowledge for Azure AI Search development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when configuring data sources, skillsets, vector/semantic search, indexers, or…