files-to-prompt: Concatenate Files into a Single Prompt for LLMs
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
files-to-prompt is a command-line tool designed to concatenate the contents of multiple files from a directory into a single, structured prompt suitable for Large Language Models (LLMs). It offers flexible options for filtering files by extension, ignoring patterns, and supports various output formats including standard text, Claude XML, and Markdown. This utility streamlines the process of preparing complex codebases or documentation for AI analysis.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
files-to-prompt is a powerful command-line utility created by Simon Willison that simplifies the process of preparing textual data for Large Language Models (LLMs). It efficiently concatenates the contents of multiple files, or even entire directories, into a single, cohesive output. This tool is particularly useful for developers and researchers who need to feed large amounts of code, documentation, or other text files into LLMs for tasks like code analysis, summarization, or question-answering, ensuring the LLM receives a well-structured context.
Installation
Installing files-to-prompt is straightforward using pip:
pip install files-to-prompt
Examples
Here are some common ways to use files-to-prompt:
Basic Usage: Concatenate all files in a directory.
files-to-prompt path/to/directory
Filter by Extension: Include only files with specific extensions.
files-to-prompt path/to/directory -e py -e js
Output as Claude XML: Format the output specifically for Anthropic's Claude LLMs, optimizing for its context window.
files-to-prompt path/to/directory --cxml
Output as Markdown: Generate output with fenced code blocks, useful for pasting into Markdown documents.
files-to-prompt path/to/directory --markdown
Include Line Numbers: Add line numbers to each file's content in the output.
files-to-prompt path/to/directory -n
Ignore Files: Exclude files matching a specific pattern.
files-to-prompt path/to/directory --ignore "*.log"
Read from Stdin: Pipe file paths from another command, such as find.
find . -name "*.py" -print0 | files-to-prompt --null
Why Use files-to-prompt?
In the era of powerful LLMs, providing well-structured and relevant context is crucial for obtaining accurate and useful responses. files-to-prompt addresses this need by:
- Streamlining Context Preparation: Automatically gathers and formats content from multiple files, saving manual effort.
- Optimizing for LLMs: Offers specific output formats like Claude XML and Markdown, which can improve how LLMs process and understand the provided context.
- Flexibility and Control: Provides extensive options for filtering, ignoring, and customizing the output, allowing users to precisely control what content is included.
- Developer-Friendly: Integrates seamlessly into existing workflows, especially for projects involving codebases or extensive documentation.
Links
- GitHub Repository: https://github.com/simonw/files-to-prompt
- PyPI: https://pypi.org/project/files-to-prompt/
- Background Article: Building files-to-prompt entirely using Claude 3 Opus
Related repositories
Similar repositories that may be relevant next.

AMD Skills: Empowering AI Agents with AMD's Optimized Software Stack
August 16, 2026
AMD Skills is the official catalog of AI agent skills from AMD, designed to empower AI agents with optimized software for AMD hardware. This repository provides knowledge, scripts, and conventions for working with AMD's stack, enabling seamless integration with major coding agents like Cursor, Claude Code, OpenAI Codex, and Gemini CLI.

agent-tackle-box: A Terminal Debugger for LangGraph & LangChain Agents
August 15, 2026
agent-tackle-box is a comprehensive toolkit for developing AI agents, featuring the powerful `agent-debugger`. This terminal debugger provides deep insights into LangGraph and LangChain agents. It allows developers to inspect state, monitor tool calls, and step through Python code, all within a unified Textual UI.

ADR: Uber's Enterprise Security System for AI Agents
August 14, 2026
ADR (Agentic AI Detection and Response) is an enterprise security system developed by Uber to secure AI agents. It offers critical capabilities like observability, security benchmarking, and threat detection, ensuring the safe operation of both employee and customer-facing AI applications. This open-source project is deployed in production at Uber and was accepted to MLSys 2026.

SkillOpt: Optimizing Self-Evolving Agent Skills for LLMs
August 11, 2026
SkillOpt is an innovative text-space optimizer from Microsoft that enables the training of reusable natural-language skills for frozen LLM agents. It approaches skill development with the rigor of deep-learning optimization, using trajectory-driven edits and validation-gated updates. This results in deployable `best_skill.md` artifacts that significantly boost agent performance across various benchmarks and models without modifying model weights.
Source repository
Open the original repository on GitHub.
13 counted GitHub visits