AI Context: Markdown, tokens and folder packs
Turn documents into Markdown, count tokens, split long files and pack a whole folder or Git diff into one bundle for any AI model, with secrets redacted.
The AI Context section prepares files for a language model on your own computer: clean Markdown, an honest token count, parts that fit a context window, or a whole folder packed into one bundle. Nothing is sent anywhere; you decide what to paste. Added in 1FileTool 1.11.1.
Convert to Markdown
Convert to Markdown takes Word, Excel, PowerPoint, PDF, HTML, EPUB, CSV, JSON and XML and writes Markdown a model reads well. Turn on Read scanned pages to run OCR on PDFs and images that have no text layer; it is much slower.
When a result is ready, Copy text puts it on the clipboard and Ask an agent opens it in AI Chat with the assistant already on your machine.
Token Counter
Token Counter shows what a file costs and which model context windows it fits. Pick the Token model that matches yours: GPT-4o (o200k), GPT-4 (cl100k), Claude (closest match) or Rough (chars ÷ 4). Claude's tokenizer is not public, so its count is an estimate.
Split for Context
Split for Context breaks a long document into parts that each stay under Tokens per part, with Overlap tokens repeated from the previous part so nothing loses its context at a boundary. Splits prefer paragraph breaks, then line breaks, so a part does not end mid-sentence.
Pack Folder for AI
Pack Folder for AI turns a folder into one bundle: a file tree, every file's contents and the total token count, with the largest files listed by tokens when it finishes. By default it respects .gitignore (nested ones too) and redacts secrets such as private keys, cloud and API keys, access tokens and passwords before anything is written; Respect .gitignore and Redact secrets can be switched off.
What to pack narrows it inside a Git repository:
- Everything: every text file in the folder.
- Uncommitted changes: what you changed but have not committed.
- Staged changes: what is in the index.
- This branch vs its base: everything the branch changed (set Compare against, or leave it empty for main, master or develop).
- Recent commits: the last N commits (set How many commits).
With Include the diff on, the unified diff goes at the top of the bundle.
How much of each file keeps big projects in budget:
- Full contents: every line of every file.
- Auto (full, then code maps): full files until half the Token budget is spent, then outlines.
- Code maps only: declarations with line numbers, roughly a tenth of the tokens.
Bundle format is Markdown (the default), XML (reads well for Claude) or plain text. Token budget stops the bundle at that many tokens (0 packs everything), and Skip files over caps the size of any one file. Copy bundle copies the result.
Use it from your assistant or on autopilot
Your AI assistant can run the same jobs through AI Access with filetool_to_markdown, filetool_count_tokens and filetool_pack_context. Convert to Markdown is a Folder Monitor action, and both Convert to Markdown and Split for Context can be steps in a workflow recipe. Doc to Markdown and Pack folder for AI are quick actions on Home, and all four tools are under Tools › AI Context in the menu bar.