
Grepai Chunking
- 596 installs
- 18 repo stars
- Updated February 1, 2026
- yoanbernabeu/grepai-skills
grepai-chunking is a Claude Code skill that tunes GrepAI `.grepai/config.yaml` chunk size and overlap so semantic code search matches how a repository is structured.
About
grepai-chunking is a Claude Code skill for configuring how GrepAI splits source files into embeddable segments before semantic search and indexing. The skill explains default ~512-token chunks, overlap tradeoffs, and adjustments for verbose versus concise code styles to improve retrieval accuracy. Developers reach for grepai-chunking when GrepAI search misses symbols, returns fragmented matches, or after onboarding a large monorepo to `.grepai/config.yaml`. It pairs with other GrepAI skills for languages and tracing when tuning a polyglot codebase index.
- Explains token-based chunking with a visual split from large files into ~512-token segments
- Documents `chunking.size` and `chunking.overlap` in `.grepai/config.yaml`
- Covers tradeoffs: oversized chunks reduce precision, undersized chunks lose context
- Guidance for verbose vs concise code styles and troubleshooting weak search hits
- Clarifies that each chunk receives its own embedding for vector search
Grepai Chunking by the numbers
- 596 all-time installs (skills.sh)
- +5 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #1,595 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-chunkingAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 596 |
|---|---|
| repo stars | ★ 18 |
| Security audit | 3 / 3 scanners passed |
| Last updated | February 1, 2026 |
| Repository | yoanbernabeu/grepai-skills ↗ |
How do you configure GrepAI code chunking for search?
Tune GrepAI `.grepai/config.yaml` chunk size and overlap so semantic code search matches how your repo is structured.
Who is it for?
Developers indexing large or polyglot repos with GrepAI who need tighter semantic code-search recall.
Skip if: Teams not using GrepAI or projects where raw ripgrep text search without embeddings is sufficient.
When should I use this skill?
The developer tunes GrepAI indexing, edits `.grepai/config.yaml`, or troubleshoots poor semantic code-search results.
What you get
Optimized `.grepai/config.yaml` chunk and overlap settings with improved semantic search recall.
- Tuned chunk and overlap settings
- Indexing configuration notes
By the numbers
- Default GrepAI chunks are roughly 512 tokens per segment
Files
GrepAI Chunking Configuration
This skill covers how GrepAI splits code files into chunks for embedding, and how to optimize chunking for your codebase.
When to Use This Skill
- Optimizing search accuracy
- Adjusting for code style (verbose vs. concise)
- Troubleshooting search results
- Understanding how indexing works
What is Chunking?
Chunking is the process of splitting source files into smaller segments for embedding:
┌─────────────────────────────────────┐
│ Large Source File │
│ (1000+ tokens) │
└─────────────────────────────────────┘
↓
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Chunk 1 │ │ Chunk 2 │ │ Chunk 3 │
│ ~512 │ │ ~512 │ │ ~512 │
│ tokens │ │ tokens │ │ tokens │
└─────────┘ └─────────┘ └─────────┘
↓
Each chunk gets
its own embeddingWhy Chunking Matters
Embedding models have optimal input sizes:
- Too large chunks: Less precise search results
- Too small chunks: Lost context, fragmented results
- Just right: Good balance of precision and context
Configuration
Basic Settings
# .grepai/config.yaml
chunking:
size: 512 # Tokens per chunk
overlap: 50 # Overlap between chunksUnderstanding Parameters
Chunk Size
The target number of tokens per chunk.
| Size | Effect |
|---|---|
| 256 | More precise, less context |
| 512 | Balanced (default) |
| 1024 | More context, less precise |
Overlap
Tokens shared between adjacent chunks. Preserves context at boundaries.
| Overlap | Effect |
|---|---|
| 0 | No overlap, may lose context at boundaries |
| 50 | Standard overlap (default) |
| 100 | More context, larger index |
Visualization
With size=512 and overlap=50:
File: auth.go (1000 tokens)
Chunk 1: tokens 1-512
┌────────────────────────────────────┐
│ func Login(user, pass)... │
└────────────────────────────────────┘
↘
50 token overlap
↙
Chunk 2: tokens 463-974
┌────────────────────────────────────┐
│ ...validate credentials... │
└────────────────────────────────────┘
↘
50 token overlap
↙
Chunk 3: tokens 925-1000
┌──────────────┐
│ ...return │
└──────────────┘Recommended Settings by Language
Verbose Languages (Java, C#)
chunking:
size: 768 # Larger to capture full methods
overlap: 75Concise Languages (Go, Python)
chunking:
size: 512 # Standard size
overlap: 50Very Concise (Rust, Zig)
chunking:
size: 384 # Smaller for precise results
overlap: 40Recommended Settings by Codebase
Small Functions (Microservices)
chunking:
size: 384 # Capture individual functions
overlap: 40Large Classes (Monolith)
chunking:
size: 768 # Capture more context
overlap: 100Mixed Codebase
chunking:
size: 512 # Balanced default
overlap: 50How Tokens are Counted
GrepAI uses approximate token counting:
- ~4 characters = 1 token (for English text)
- Code varies based on identifiers and syntax
Example:
func calculateTotal(items []Item) float64 {
total := 0.0
for _, item := range items {
total += item.Price * float64(item.Quantity)
}
return total
}≈ 45 tokens
Impact on Index Size
Larger overlap = more chunks = larger index:
| Size | Overlap | Chunks per 10K tokens | Index Impact |
|---|---|---|---|
| 512 | 0 | ~20 | Smallest |
| 512 | 50 | ~22 | Standard |
| 512 | 100 | ~24 | +10% |
| 256 | 50 | ~44 | +100% |
Impact on Search Quality
Too Small Chunks (size: 128)
Query: "authentication middleware"
Result: "...c.AbortWithStatus(401)..."
(Fragment, missing context)Just Right (size: 512)
Query: "authentication middleware"
Result: "func AuthMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
token := c.GetHeader("Authorization")
if token == "" {
c.AbortWithStatus(401)
return
}
// validate token...
}
}"
(Complete function with context)Too Large Chunks (size: 2048)
Query: "authentication middleware"
Result: "// Multiple unrelated functions...
func AuthMiddleware()... (your match)
func LoggingMiddleware()...
func CORSMiddleware()..."
(Too much noise)Experimentation
Testing Different Settings
1. Try smaller chunks for more precise results:
chunking:
size: 384
overlap: 402. Re-index:
rm .grepai/index.gob
grepai watch3. Test with searches:
grepai search "your query"4. Adjust and repeat until satisfied.
Comparing Results
Before changing settings, save a search result:
grepai search "authentication" > before.txtAfter changing settings and re-indexing:
grepai search "authentication" > after.txt
diff before.txt after.txtChunk Boundaries
GrepAI tries to split at logical boundaries: 1. Empty lines (function/class boundaries) 2. Closing braces 3. Statement ends
This means actual chunk sizes may vary slightly from the target.
Best Practices
1. Start with defaults: 512/50 works well for most codebases 2. Adjust based on code style: Verbose = larger, concise = smaller 3. Test with real queries: See what your searches return 4. Re-index after changes: Must regenerate embeddings 5. Consider overlap: Don't set to 0 unless index size is critical
Common Issues
❌ Problem: Search results are too fragmented ✅ Solution: Increase chunk size:
chunking:
size: 768❌ Problem: Search results have too much irrelevant context ✅ Solution: Decrease chunk size:
chunking:
size: 384❌ Problem: Results miss related code at function boundaries ✅ Solution: Increase overlap:
chunking:
overlap: 100❌ Problem: Index is too large ✅ Solutions:
- Decrease overlap
- Increase chunk size
- Add more ignore patterns
Output Format
Chunking status:
✅ Chunking Configuration
Size: 512 tokens
Overlap: 50 tokens
Index Statistics:
- Total files: 245
- Total chunks: 1,234
- Avg chunks/file: 5.0
- Avg chunk size: 478 tokens
Recommendations:
- Current settings are balanced
- Consider size: 384 for more precise results
- Consider size: 768 for more contextRelated skills
How it compares
Use grepai-chunking after grepai-languages when search quality issues stem from chunk boundaries rather than unsupported file types.
FAQ
What file does grepai-chunking configure?
grepai-chunking edits `.grepai/config.yaml` to set chunk size and overlap so GrepAI splits source files into segments suited for embedding and semantic code search.
What is the default GrepAI chunk size?
grepai-chunking documents GrepAI's default approach of splitting large source files into segments of roughly 512 tokens each, with configurable overlap for better context continuity.
Is Grepai Chunking safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.