CodeTrellis — Give AI Full Project Awareness
Scan your codebase, compress to ~1K tokens, inject into every AI prompt.
Works with: GitHub Copilot | Claude | Cursor | Windsurf | any MCP-compatible AI
The Problem
- AI assistants read files one at a time — they never see your full project
- They don't know about existing components, schemas, or patterns
- You explain your project structure repeatedly in every conversation
- AI lacks business domain understanding — doesn't know why code exists
Quick Start
pip install codetrellis
codetrellis scan /path/to/project --optimal
codetrellis init . --ai # sets up Copilot/Claude/Cursor integration
How It Works
┌─────────────────────────────────────────────────────────────────┐
│ CodeTrellis WORKFLOW │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 1. SCAN 2. COMPRESS 3. INJECT │
│ ───────── ─────────── ──────── │
│ │
│ Read every → Convert to → Add to every │
│ file in minimal AI prompt │
│ project tokens │
│ │
│ 187 lines → 30 tokens → Full awareness │
│ │
└─────────────────────────────────────────────────────────────────┘
Top Features
- 120+ language/framework parsers — Python, TypeScript, Go, Rust, Java, C#, and more
- MCP server for real-time AI context injection (JSON-RPC 2.0)
- MCP
get_best_practicestool — returns framework-specific coding practices on demand (106 YAML practice files covering 25 ecosystems) - JIT context engine — delivers only relevant sections for the file you're editing
- Incremental builds — only re-extract changed files
- Best Practices Library — 4,500+ practices auto-selected for your stack
- Output tiers — from ~800 tokens (compact) to full code context (logic)
- CI/CD mode — deterministic, parallel builds for pipelines
- AI integration — auto-generates Copilot, Claude, Cursor, Windsurf configs
Installation
pip install codetrellis
# Optional extras
pip install codetrellis[all] # AST parsing, YAML, color, token counting
pip install codetrellis[ast] # Tree-sitter AST parsing only
Output Tiers
| Tier | Truncation | Tokens | Use Case |
|---|---|---|---|
compact |
Yes | ~800-2000 | Quick overview |
prompt |
NO | ~8000-15000 | Default AI injection (includes code logic!) |
full |
NO | ~15000+ | Detailed analysis |
logic |
NO | ~30000+ | Full code context |
json |
NO | Variable | Machine processing |
# Use tiers
codetrellis scan ./project --tier compact # Minimal
codetrellis scan ./project --tier prompt # Default (recommended)
codetrellis scan ./project --tier full # Everything
codetrellis scan ./project --tier logic # With function bodies
CLI Commands
# Scanning
codetrellis scan [path] # Scan project
codetrellis scan [path] --optimal # Maximum quality (recommended)
codetrellis scan [path] --incremental # Only changed files
codetrellis scan [path] --ci # CI/CD mode (deterministic + parallel)
codetrellis scan --remote <url> # Scan a remote git repo
# AI Integration
codetrellis init . --ai # Generate Copilot/Claude/Cursor configs
codetrellis init . --update-ai # Regenerate AI files (no re-scan)
codetrellis mcp --stdio # Start MCP server
codetrellis context path/to/file.py # JIT context for a file
codetrellis skills # Generate AI-executable skills
# View & Export
codetrellis show # Show full matrix
codetrellis prompt # Print prompt-ready matrix
codetrellis export --json # Export as JSON
# Quality & Maintenance
codetrellis verify [path] # Build quality gate
codetrellis validate [path] # Validate extraction completeness
codetrellis coverage [path] # Show extraction coverage
codetrellis watch # Auto-sync on file changes
codetrellis clean [path] # Clean caches
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
MIT License — Keshav Chaudhary 2026
Metadata
Release files for codetrellis 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| codetrellis-1.3.0.tar.gz | 3.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| codetrellis-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 MB
Release files / codetrellis-1.3.0.tar.gz
| Download URL | codetrellis-1.3.0.tar.gz |
|---|---|
| Size | 3.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f7b8965d1d0a1f2d7bf83ebd33bd1a07c331e98393162f4f830473cb71cd2f7
|
|
BLAKE2b-256 checksum How to use checksums |
e9c10bcbd945424499c6cafaa3f9caa7dca86a930a1c08d9331577dacff139d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency logRelease files / codetrellis-1.3.0-py3-none-any.whl
| Download URL | codetrellis-1.3.0-py3-none-any.whl |
|---|---|
| Size | 4.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ecc57fdff9416d6f144edf4e8a26022210e24417e3f01af2392d5929a82cbcf6
|
|
BLAKE2b-256 checksum How to use checksums |
f17930f92cb07b464c393c5174773464f508f91f2c5624305ddbe63f2e1fb514
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency log