// the find
simonw/files-to-prompt
Concatenate a directory full of files into a single prompt for use with LLMs
A small CLI (and Python library) from Simon Willison that walks a directory and concatenates its files into one text blob suitable for pasting into an LLM prompt, with output formats for Claude XML, Markdown fenced blocks, or plain text. Aimed at developers who want to hand an entire codebase or subset of it to an LLM without hand-copying files.
Respects .gitignore by default so you don't have to hand-maintain a separate exclude list; --ignore takes fnmatch patterns for one-off exclusions. Supports reading paths from stdin (including NUL-separated for filenames with spaces), so it composes with find/fd instead of reinventing directory traversal. The --cxml output matches Anthropic's documented long-context prompt structure, and --markdown correctly escalates backtick fence length when a file already contains triple backticks. Test suite runs via GitHub Actions on every push.
No token or size estimate before writing output, so it's easy to blow past a model's context window on a large repo without warning. No built-in binary-file detection — feeding it a directory with images or compiled artifacts will likely dump garbage bytes into the prompt unless you remember -e to filter extensions. Single-file cli.py implementation with no plugin points, so anything beyond the built-in output formats means forking rather than extending. No parallelism or streaming for very large trees, everything is read into memory before being written out.