AI Context Collector
Generate terminal commands to pack your entire project into a single text file for AI prompting.
•1 min read
When discussing complex architecture with an AI (like DeepSeek or Claude 3.5 Sonnet), feeding it file-by-file is a waste of time and destroys the system's contextual understanding.
This tool generates a dynamic script for Mac/Linux (Bash) or Windows (PowerShell) that automatically:
- Maps your entire project directory structure.
- Reads the contents of all relevant files.
- Automatically ignores media files (
.png,.webp) and build directories (node_modules,.next). - Outputs everything into a single, perfectly formatted
all_code.txtfile on your Desktop.
AI Context Collector
Generate a surgical terminal script to pack your project code.
Folder Filters
File Filters
Terminal (Bash)
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"Why use this instead of drag-and-drop?
Dragging and dropping folders into an AI interface often leads to token bloat. The AI wastes tokens reading binary files, .git histories, and package-lock files. This script surgically extracts only what matters—the code itself—saving you token costs and improving the AI's reasoning accuracy.