Stop Wasting AI Tokens: The Ultimate Code Context Collector
A free, client-side tool to surgically extract your project code into a single file for Claude, DeepSeek, and ChatGPT.
If you are dragging and dropping raw project folders into Claude 3.5 Sonnet, DeepSeek, or ChatGPT, you are systematically destroying the model's contextual reasoning capabilities.
Stop Wasting AI Tokens
When you dump a raw directory into an AI prompt, the model wastes massive amounts of its context window attempting to read node_modules, binary image assets, hidden .git histories, and 50,000-line lockfiles. It gets overwhelmed by noise instead of analyzing your actual engineering logic.
To solve this daily friction, I built the AI Context Collector. It is a free, 100% client-side utility that generates a surgical Bash or PowerShell script to package your project locally before you prompt the AI.
The AI Context Collector
Use the interactive dashboard below to generate your custom extraction script. I recommend bookmarking this page to integrate it into your daily AI development workflow.
AI Context Collector
Generate a surgical terminal script to pack your project code.
Folder Filters
File Filters
OUT="$HOME/Desktop/all_code.txt"
rm -f "$OUT"
echo "š PROJECT STRUCTURE:" > "$OUT"
find . \( -name "node_modules" -o -name ".idea" -o -name ".git" -o -name "dist" -o -name "build" -o -name ".next" -o -name ".turbo" -o -name ".vercel" -o -name "out" -o -name "coverage" -o -name "ignore" \) -prune -o -print >> "$OUT"
echo -e "\n\nš» FILE CONTENTS:\n" >> "$OUT"
find . \( -name "node_modules" -o -name ".idea" -o -name ".git" -o -name "dist" -o -name "build" -o -name ".next" -o -name ".turbo" -o -name ".vercel" -o -name "out" -o -name "coverage" -o -name "ignore" -o -name "public" -o -name "assets" -o -name "static" \) -prune -o -type f -not -name "*.webp" -not -name "*.png" -not -name "*.jpg" -not -name "*.jpeg" -not -name "*.mp4" -not -name "*.mp3" -not -name "*.ico" -not -name "*.svg" -not -name "*.lock" -not -name "*.lockb" -not -name "*.yaml" -not -name "*.ttf" -not -name "*.woff" -not -name "*.woff2" -not -name "*.pdf" -not -name "package-lock.json" -not -name "pnpm-lock.yaml" -not -name "yarn.lock" -not -name "bun.lockb" -exec sh -c '
echo -e "\n\n==== FILE: $1 ====";
if [ "$(basename "$1")" = ".env.local" ]; then
grep -v "^#" "$1" | grep "=" | cut -d "=" -f 1;
else
cat "$1";
fi;
echo -e "\n--- END FILE ---"
' _ {} \; >> "$OUT"
echo "ā
Done! Mission complete: $OUT"How to Use the Collector
This tool is designed to be completely frictionless. You do not need to install any global NPM packages or configure complex CLI environments.
1. Configure Your Filters
The tool comes pre-configured with the most common exclusion rules for modern web development (Next.js, React, Node). You can easily customize them directly in the text boxes:
- Deep Prune: Removes the folder completely from both the directory tree map and the file contents. Perfect for
node_modulesand.git. - Content Prune: Keeps the folder visible in the directory tree map so the AI knows it exists, but ignores the files inside it. Ideal for
publicorassetsfolders.
2. Select Your Operating System
Click either Bash (Mac/Linux) or PowerShell (Windows). The tool instantly writes a native, highly optimized terminal command tailored to your OS environment.
3. Copy and Execute
Click the Copy Code button. Open your terminal, navigate to the root directory of your project, and paste the command. The script runs instantaneously on your local machine and creates a beautifully formatted all_code.txt file directly on your Desktop.
4. Prompt the AI
Drag and drop the generated all_code.txt file into your favorite LLM interface. Your prompt is now 100% pure signal and zero noise.
By supplying the exact directory tree at the top of the text file, the AI receives a topological map of your project before reading the code. This drastically improves its ability to understand component relationships and global state management.
Built-in Security: The Zero-Leak Environment
One of the biggest risks of dropping raw folders into AI models is accidentally uploading your .env files containing production database credentials or API secrets.
Never upload raw .env files to cloud AI models. Extracting only the keys ensures the model understands your environment variables without compromising your security.
This tool has a built-in safeguard specifically for .env.local files. The generated script parses the file, extracts the variable keys (so the AI knows how your app is configured), but automatically strips out the secret values before writing them to the output file.
How the script handles Windows encoding issues
If you are on Windows, standard PowerShell commands often corrupt text files with Mojibake (garbled characters) when dealing with UTF-8 formats or emojis. The PowerShell script generated by this tool bypasses this by leveraging native .NET classes ([System.IO.File]::ReadAllText) to enforce strict UTF-8 extraction, ensuring your code remains pristine.
š IELTS Goldmine: Words & Phrases
| Word/Phrase | Meaning (in English) | Example from this post |
|---|---|---|
| Systematically | Done or acting according to a fixed plan or system; methodically. | "...you are systematically destroying the model's contextual reasoning capabilities." |
| Contextual | Depending on or relating to the circumstances that form the setting for an event. | "...destroys the model's contextual reasoning capabilities." |
| Overwhelmed | Buried or drowned beneath a huge mass of something. | "It gets overwhelmed by noise instead of analyzing your actual engineering logic." |
| Surgical | Done with great precision or exactness. | "...generates a surgical Bash or PowerShell script to package your project..." |
| Frictionless | Achieved with little or no difficulty; smooth. | "This tool is designed to be completely frictionless." |
| Topological | Relating to the arrangement or physical layout of a network or structure. | "...the AI receives a topological map of your project..." |
| Pruning | Trimming or cutting away dead or overgrown branches/data to increase fruitfulness. | "Deep Prune: Removes the folder completely from both the directory tree..." |
| Instantaneous | Occurring or done in an instant or instantly. | "The script runs instantaneously on your local machine..." |
| Safeguard | A measure taken to protect someone or something or to prevent something undesirable. | "This tool has a built-in safeguard specifically for .env.local files." |
| Pristine | In its original condition; unspoiled or clean. | "...ensuring your code remains pristine." |