files-to-prompt is a Python command-line tool that takes one or more files or entire directories and concatenates their contents into a single, LLM-friendly prompt. It walks the directory tree, outputting each file preceded by its relative path and a separator, so a model can understand which content came from where. The tool is aimed at workflows where you want to ask an LLM questions about a whole codebase, documentation set, or notes folder without manually copying files together. It includes rich filtering controls, letting you limit by extension, include or skip hidden files, and ignore paths that match glob patterns or .gitignore rules. The output format is flexible: you can emit plain text, Markdown with fenced code blocks, or a Claude-XML style format designed for structured multi-file prompts. It can read file paths from stdin (including NUL-separated paths), which makes it easy to combine with find, rg, or other shell tools.
Features
- Concatenates files or entire directories into a single, structured prompt for LLMs
- Adds relative file paths and separators between files for clear context boundaries
- Extension filters, include-hidden flag, ignore patterns and .gitignore integration for precise file selection
- Multiple output formats, including plain text, Markdown with fenced code blocks, and Claude XML
- Supports reading paths from stdin, with optional NUL-separated mode for filenames with spaces
- Simple pip installation and a concise CLI interface built for shell pipelines