Pack a project folder into one file for ChatGPT or Claude
Turn a codebase or document folder into one token-counted bundle for any AI chat, offline, with .gitignore respected, secrets redacted and Git diffs included.
Your progress
Pack a whole project folder into one file you can paste into ChatGPT, Claude or Gemini: a file tree, every file's contents and a real token count. 1FileTool's Pack Folder for AI does it on your own computer, skips what your .gitignore skips and replaces API keys and passwords before anything is written.
What you'll need
- 1FileTool 1.11.1 or later on macOS 13+, Windows or Linux. Pack Folder for AI is part of the free toolkit.
- A project folder. Any folder works; a Git repository unlocks the "only what changed" options in step 3.
- An AI chat to paste the bundle into. Packing is offline; what you do with the bundle afterwards is up to you.
Protect your originals first
Replace source is ON by default: the output overwrites the original file and no backup is kept. Before following along, open Settings › General and turn Replace source off, or pick a separate output folder.
Pack Folder for AI never changes the folder you pack. It writes one new file, <folder>-context.md, into your output folder, so Replace source has nothing to replace here.
Steps
1. Open Pack Folder for AI
In the sidebar, open AI Context and pick Pack Folder for AI under Bundle. It is also a quick action on Home (Pack folder for AI) and sits under Tools › AI Context in the menu bar.
2. Choose the folder
Press Choose folder… and pick the project. If it is a Git repository, the card tells you which branch you are on and whether there are uncommitted changes, for example "Git repo on feature/reports · uncommitted changes". If you packed this folder before, 1FileTool says "Restored the settings you used for this folder last time."
3. Decide what to pack
What to pack sets the scope:
- Everything packs every text file in the folder. Use it when the AI needs the whole project.
- Uncommitted changes, Staged changes, This branch vs its base and Recent commits pack only the files a change touched. Use them for a code review or "why does this break?" question.
Leave Include the diff on so the unified diff goes above the files, where the model reads it before the code.
4. Fit it to your model
Set Token model to the model you will paste into: GPT-4o (o200k), GPT-4 (cl100k), Claude (closest match) or Rough (chars ÷ 4). Then give it a Token budget, for example 100000, and set How much of each file to Auto (full, then code maps). Auto writes full files until half the budget is spent, then switches to code maps: declarations with line numbers, about a tenth of the tokens.
5. Check what stays out
Respect .gitignore (nested ones too) and Redact secrets are on by default; keep them on. Skip files over drops any single file above 512 KB, and Also exclude takes extra patterns such as *.snap, docs/**.
6. Pack it
The button names the job: Pack web-dashboard for Everything, or Pack uncommitted changes in web-dashboard for a Git scope. A few seconds later the result card shows the file and token totals, how many files were written as code maps, how many were skipped, and how many secrets were redacted.
7. Hand it to the AI
Copy bundle puts the whole bundle on your clipboard, ready to paste into a chat. Ask an agent opens it in AI Chat with the assistant already on your computer, and Reveal bundle shows the file.
The result
One Markdown file in your output folder, named after the folder (web-dashboard-context.md), that opens with the directory tree and, for a Git scope, the diff, followed by every file that fits the budget. The Biggest files in the bundle list underneath shows where the tokens went, with a code map badge on files that were outlined.
Prefer XML or plain text? Bundle format switches to XML, which reads well for Claude, or plain text, and the file becomes .xml or .txt.
If it didn't work
- "Git scopes need a repository.": the folder is not a Git repository, so only Everything is available. Pack everything, or pick the repository's root folder.
- The bundle is too big for your model: lower the Token budget, switch to Code maps only, or add the largest files from Biggest files in the bundle to Also exclude. The card itself suggests it: "Add any of these to the exclude patterns to shrink the next bundle."
- A file you expected is missing: it was ignored by
.gitignore, is binary, or is larger than Skip files over. The result card counts these as "skipped (binary, oversized or ignored)". - The Claude count is a little off: Claude's tokenizer is not public, so Claude (closest match) is an estimate. Leave some headroom.
- A secret still worries you: redaction catches private keys, cloud and API keys, access tokens and passwords, but read the bundle before you paste it anywhere you would not paste the code itself.
Try next
Packing documents rather than code? Convert Word, Excel and PowerPoint to Markdown first, then check the cost with the Token Counter. Or let your assistant do the packing itself: with AI Access on, Claude Code, Codex or Gemini can call filetool_pack_context directly.
Related
Tools used