Skip to main content

CodeTrellis - Project Self-Awareness System - AI context injection tool

Project description

CodeTrellis — Give AI Full Project Awareness

Scan your codebase, compress to ~1K tokens, inject into every AI prompt.

PyPI Python License: MIT Tests

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)
  • 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

📋 Full feature list

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codetrellis-1.0.2.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codetrellis-1.0.2-py3-none-any.whl (4.0 MB view details)

Uploaded Python 3

File details

Details for the file codetrellis-1.0.2.tar.gz.

File metadata

  • Download URL: codetrellis-1.0.2.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codetrellis-1.0.2.tar.gz
Algorithm Hash digest
SHA256 477e9df6cc9c7bf4bc51ccd617991ff53f1e9ced3b82fe0a9c7d6dbcae79e78e
MD5 0fb339d74ae0f53e445a98a363bc8c19
BLAKE2b-256 5fff5fdf9af3ede7a7a4f28fee45d195b22d92db2fd5c928c3b2805e3b4433dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for codetrellis-1.0.2.tar.gz:

Publisher: release.yml on chaudhary-keshav/codetrellis-matrix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codetrellis-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: codetrellis-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codetrellis-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b0169c8f70498f7fff0f33cc53eee69865292535fb71e666da6a2580705ca673
MD5 00533b344bf9413b293b7f2f51478d39
BLAKE2b-256 9d47da6bfbbe040aae6f6e681e402f39b0ea42c95a3d7f64aa7a567e27a3cb32

See more details on using hashes here.

Provenance

The following attestation bundles were made for codetrellis-1.0.2-py3-none-any.whl:

Publisher: release.yml on chaudhary-keshav/codetrellis-matrix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page