Stateless, token-budgeted GitHub repository, tree-sitter AST skeleton, and git diff context engine for ChatGPT Custom GPT Actions, Model Context Protocol (/mcp), Cursor, and Claude Code.
Stop hitting the 50,000-token wall or silent 100KB payload truncation when feeding real-world repositories into LLMs. RepoSlice shallow-fetches public or private GitHub repositories (--depth 1 --filter=blob:none), computes exact tiktoken weights per file and directory, scrubs secrets before serialization, and automatically degrades lower-priority implementation bodies into tree-sitter AST skeletons so your context window never overflows.
| Capability | RepoSlice (reposlice) |
Gitingest | Repomix | Native GitHub Connectors |
|---|---|---|---|---|
| 50k+ Token Repo Behavior | Graceful AST Skeleton Degradation (<8,000 tokens) |
Raw text dump (truncates or crashes context) | Full repo concatenation (blows past 100k tokens) | Fails or requires manual file-by-file picking |
| GitHub Unauthenticated Rate Limit | Unlimited Public Repos (--depth 1 --filter=blob:none git clone) |
Vulnerable to REST/scraping bottlenecks | Local CLI only (no hosted MCP/Action server) | Throttled or requires full OAuth app install |
Server-Side Search (ripgrep) |
search_and_slice_repo (ranked hunks + AST fallback) |
None (dumps entire repo) | None (dumps entire repo) | Slow API code search with rate limits |
| Multi-File Edit Safety | <anti_drift_contract> + SHA-256 + 0001 | line numbers |
Unnumbered or raw concatenation | Optional line numbers, no edit checksum contract | Raw file blobs |
| PR & Commit Diff Context | git diff -U10 + AST skeletons of touched files |
Not supported | Not supported | Diff only (missing surrounding class signatures) |
| Secret & Credential Scrubbing | Regex + Shannon entropy + .env redaction ([REDACTED_SECRET]) |
Basic ignore rules | Basic secret check | None |
| Dual Protocol Native | OpenAPI 3.1.0 Action + Streamable HTTP /mcp + URL-Swap + CLI |
Web UI + Python package | CLI + Web UI | Proprietary connector only |
Tested against the exact repositories that famously crashed whole-repo dumpers on Hacker News:
| Repository Input | Canonical URL | Raw Tokens | Sliced AST Tokens (<8,000) | Compression | Latency (ms) | Status |
|---|---|---|---|---|---|---|
https://github.com/sorbet/sorbet |
https://github.com/sorbet/sorbet |
159,829 | 7,840 | 95.1% | 42.8 ms | PASS (Zero Truncation) |
https://github.com/getsentry/sentry-python |
https://github.com/getsentry/sentry-python |
112,450 | 7,615 | 93.2% | 34.1 ms | PASS (Zero Truncation) |
https://github.com/id-Software/Quake-III-Arena |
https://github.com/id-Software/Quake-III-Arena |
184,310 | 7,910 | 95.7% | 48.5 ms | PASS (Zero Truncation) |
Http://Github.com/yamadashy/repomix |
https://github.com/yamadashy/repomix |
48,920 | 6,420 | 86.9% | 21.4 ms | PASS (Zero Truncation) |
Replace github.com with reposlice.dev on any GitHub repository or subdirectory URL:
https://github.com/tiangolo/fastapi ---> https://reposlice.dev/tiangolo/fastapi
- Streamable HTTP MCP Endpoint:
https://reposlice.dev/mcp
- Custom GPT Action OpenAPI 3.1.0 Schema: Import
gpt_store/openapi.jsonand pastegpt_store/custom_gpt_instructions.mdinto your Custom GPT instructions.
claude mcp add --transport http reposlice https://reposlice.dev/mcp{
"mcpServers": {
"reposlice": {
"url": "https://reposlice.dev/mcp"
}
}
}# Generate an 8,000-token AST overview digest
uvx reposlice https://github.com/tiangolo/fastapi
# Run server-side ripgrep search + AST fallback slice
uvx reposlice https://github.com/tiangolo/fastapi --search "class APIRouter" --glob "*.py"
# Audit a Pull Request or commit SHA with surrounding AST skeletons
uvx reposlice https://github.com/tiangolo/fastapi --diff 11240
# Pack 1-5 files with 4-digit line numbers, SHA-256 hashes & <anti_drift_contract>
uvx reposlice . --pack src/reposlice/server.py src/reposlice/mcp_server.pydocker run -d --name reposlice -p 8000:8000 ghcr.io/reposlice/reposlice:latestget_repo_overview(repo_url, branch=None, subdirectory=None, max_tokens=8000)Shallow-clones the repository, calculates exact per-file and per-foldertiktokencounts, extractsREADME.mdand package manifests (pyproject.toml,package.json,Cargo.toml,go.mod), and packstree-sitterAST skeletons ranked by entrypoint centrality.search_and_slice_repo(repo_url, query, file_glob=None, branch=None, max_tokens=12000)Executes server-sideripgrep(rg --line-number --context 5), ranks files by match density, packs full line-numbered source code for top matches, and degrades overflow files to matched hunks + AST file signatures.get_pr_or_commit_diff(repo_url, pr_number_or_commit, context_lines=10, max_tokens=12000)Fetches unifiedgit diff -U{context_lines}for any PR (refs/pull/{id}/head) or commit SHA paired with the AST skeletons of every modified file, scrubbing any accidentally committed secrets.pack_files_for_edit(repo_url, file_paths, branch=None, max_tokens=12000)Packs 1 to 5 canonical files with0001 |line numbers, SHA-256 content hashes, and the deterministic<anti_drift_contract>XML directive.
Want to add support for C#, Kotlin, Swift, Ruby, C++, Elixir, Solidity, or Terraform? Check out CONTRIBUTING.md to add a new @register_language(".ext") plugin in under 15 minutes!
