Skip to main content

Context Window Planner

How much code fits in one prompt?

Pick a model, describe your project, and see the math. No sign-up. Runs in your browser.

Step 1

Pick a model

Pick from the list, or scroll down to enter a custom context size.

Step 2

Describe your codebase

Step 3

Language

Your context budget24.8%fits
032.8K tokens
CodeConversationSystem + Response
Your codebase
96.0K tokens
Context window
32.8K tokens
Available for code
23.8K tokens
Files at a time
~29

120 files × 80 lines × 10 tok/line = 96.0K tokens

Semantic search

Use search to find relevant code snippets. Don't try to stuff everything in. Let the tool pull what it needs.

Same codebase, different models

How coverage changes across context window sizes with your 96.0K-token codebase.

ModelContextCoverageStrategy
Phi-4-mini16K12%Semantic search
Qwen2.5-Coder-32B32K24.8%Semantic search
Qwen3-14B128K100%Whole-repo context
Llama 3.3 70B128K100%Whole-repo context

How the math works

Token estimate

Lines of code multiplied by a tokens-per-line ratio for your language. Python averages ~8 tokens/line, Java ~11. These are empirical averages across Llama, Qwen, and Mistral tokenizers.

Budget split

Not all context goes to code. 15% is reserved for conversation history, 10% for the model's response, and ~800 tokens for the system prompt. The rest is what you can fill with source code.

Strategy

Over 80% coverage? Paste the whole repo. Between 30-80%? Point at specific files. Under 30%? Use search or a retrieval-augmented workflow. The tool tells you which.

Frequently asked questions

  • What is a context window planner?+

    A context window planner estimates how much of your codebase fits inside a model's context window at once. Enter your codebase size (or file count and average file size) and the model's context length, and it shows what percentage fits, plus how many tokens are left over for conversation history and the model's response.

  • How is my token budget split inside the context window?+

    Not all of a context window goes to your code. This planner reserves about 800 tokens for the system prompt, 15% of the window for conversation history, and 10% for the model's response. The remainder is what's actually available for source code.

  • How many tokens is my codebase?+

    Token count depends on language and how you estimate it. This tool multiplies your line count by an empirical tokens-per-line ratio for your language, for example roughly 8 tokens per line for Python and 11 for Java, averaged across common tokenizers. Enter file count and average file size for a quick estimate, or your exact total line count (from a tool like cloc) for a more precise one.

  • What context window size should I use for coding?+

    It depends on how much of your codebase needs to be visible at once. Above 80% coverage, you can generally paste the whole repository into a prompt. Between 30% and 80%, point the model at specific files instead of the whole repo. Below 30%, use search or a retrieval-based workflow rather than trying to fit everything into context.

  • Does a bigger context window always help?+

    Not always. Very large context windows can suffer from lost-in-the-middle degradation, where a model pays less attention to information buried in the center of a long prompt. 32K tokens is a practical minimum for repo-level coding work, and 64K-128K is a common sweet spot before returns start to taper.

Let Bodega One Code manage the context for you.

Bodega One Code reads your project, builds a semantic index, and pulls in the right files automatically. No manual context stuffing. Runs on your machine. Free for personal use.

Download Free

Token estimates are approximate. Actual tokenization varies by model and content. Estimates use average tokens-per-line ratios by language. Last updated March 2026.