Documentation
AI integration
How to use your CODEXT output with major AI models. Recommended prompts, context window notes, and strategies for large codebases that exceed context limits.
Model-specific guides
CODEXT output works with any model that accepts text input. Here are optimized setups for each major model.
Claude 3.5 / 4
Best results with CODEXT output. Handles large bundles well. Paste directly into the user turn. No system prompt required — Claude infers structure from CODEXT's output format.
Recommended prompt structure
Here is my complete codebase, bundled with CODEXT:
[PASTE CODEXT OUTPUT]
Task: [your task here]
GPT-4o / GPT-4 Turbo
Works well up to ~100K token bundles. For larger projects, use CODEXT's per-file size cap to trim output. Paste into the user message. GPT-4o handles the structured format reliably.
Recommended prompt structure
I'm going to share my entire codebase as a structured text file generated by CODEXT. The format includes a project map followed by file contents.
[PASTE CODEXT OUTPUT]
Question: [your question]
Gemini 1.5 Pro / 2.0
Gemini's 1M context window makes it ideal for very large codebases. CODEXT output drops in cleanly. Use Google AI Studio or the Gemini API directly — the web UI handles large pastes.
Recommended prompt structure
The following is a complete codebase exported by CODEXT. The PROJECT MAP section shows the file tree; the FILE CONTENTS section has the actual code.
[PASTE CODEXT OUTPUT]
Please: [your request]
Mistral Large
Solid performance on structured code context. Use the same prompt structure as GPT-4. Mistral's tokenizer is slightly more efficient on code — your bundles will use fewer tokens than the estimate.
Recommended prompt structure
Below is my project codebase exported by CODEXT. Review the project map first, then the file contents.
[PASTE CODEXT OUTPUT]
Task: [your task]
Ollama (local)
Works with any Ollama-served model (Llama 3, Mistral, CodeLlama, etc.). Context window varies by model and quantization. Smaller models (7B) handle ~8K tokens well. Use the structure-only output mode for very large projects with small local models.
Recommended prompt structure
# Project context (CODEXT export)
[PASTE CODEXT OUTPUT]
## Task
[your task]
LM Studio
Paste CODEXT output into the system prompt field in LM Studio for best results — this keeps the codebase context persistent across the conversation without re-pasting. Works well with CodeLlama and DeepSeek Coder.
Recommended prompt structure
You are a coding assistant. The user's complete codebase is provided below.
[PASTE CODEXT OUTPUT]
Answer questions about this codebase accurately and concisely.
Context window tips
Most production codebases bundle to between 20K–150K tokens. Models with 128K+ context windows handle the majority of real projects without splitting. Here's how to handle the cases that don't fit.
Rough token estimates by project size
Small project (5–15 files) ~5K–20K tokens Medium project (50–150 files) ~30K–80K tokens Large project (300+ files) ~100K–300K tokens Monorepo (1000+ files) ~300K–1M+ tokens (filter aggressively)
Strategies for large bundles
When your bundle exceeds the model's context window, don't paste everything — be selective. Here are four approaches, in order of preference.
1
Exclude non-critical directories
Use CODEXT settings to toggle off test files, fixtures, migration history, or generated schemas. These are often large and rarely needed for the AI's task.
2
Use the per-file size cap
Set a lower cap (e.g., 100KB) to skip large generated files like lockfiles, compiled CSS, or auto-generated type definitions. The file still appears in the tree — just without content.
3
Bundle by concern
Drop subdirectories instead of the root. Bundle src/ and paste it for logic questions. Bundle infra/ separately for deployment questions. The AI doesn't need the entire repo every time.
4
Use structure-only mode
Omit file contents entirely — only include the project map. Useful when asking the AI to plan an approach before diving into implementation. Dramatically smaller output.
Task-specific prompt patterns
After pasting the CODEXT output, frame your request with one of these patterns:
Debugging
There is a bug in [feature/file]. Here is the full codebase context:
[CODEXT output]
The bug: [describe the symptom]. What is causing it?
Code review
Review the following codebase for correctness, performance, and maintainability:
[CODEXT output]
Focus on: [specific areas, or "everything"]
Feature implementation
I need to add [feature] to this codebase:
[CODEXT output]
Requirements: [your requirements]. Show me exactly where and what to change.
Documentation
Generate documentation for the following codebase:
[CODEXT output]
Format: [README / JSDoc / inline comments / API reference]