How to Prepare Code for AI Code Review
Share code with ChatGPT, Claude or Gemini effectively: what to include, what to strip, and how to fit large codebases into context.
Less code, better review
Dumping a whole repository dilutes the model's focus and burns tokens on generated files. Pick the files that actually touch the problem.
What to include
A compact package helps:
- A short description of the goal or bug
- The file tree (directories only)
- Relevant source files and type definitions
- Error messages and logs
- Not: lockfiles, build output, minified assets
Check the size
Paste the bundle into the Token Counter. For long logs, the Context Compressor removes duplicated lines while preserving error terms you specify.
Try it free in your browser
- Context Compressor — Reduce token usage with compression strategies tuned for LLMs.
- Token Counter — Live token, character, and context-window meter for any prompt. Uses official tiktoken encoders.
Tools mentioned
Frequently asked
Should I include package lockfiles?
No. They are huge and rarely relevant. Include package.json or equivalent instead.
How do I share a large codebase?
Share a file tree and the specific files involved in the change, then add more on request.
Keep reading
How to Prepare PDFs for ChatGPT, Claude, and Gemini
A practical guide to extracting clean, AI-ready text from PDFs — born-digital and scanned — so ChatGPT, Claude, and Gemini answer accurately and don't waste tokens on headers, footers, and page numbers.
The Best Way to Feed Long Documents to Claude (and Other Long-Context Models)
Claude's 200K-token context is generous, but you'll still want to clean, compress, and structure long documents before sending them. Here's a step-by-step playbook.
Cleaning Whisper Transcripts for AI Summaries
OpenAI Whisper, Otter, and YouTube transcripts are full of timestamps, filler words, and speaker noise. Here's how to strip them before sending to ChatGPT or Claude — and why it matters.