# simonw/files-to-prompt

Concatenate a directory full of files into a single prompt for use with LLMs

Repository: https://github.com/simonw/files-to-prompt
Canonical: https://ross.abutalabs.com/products/files-to-prompt
Language: Python
License: Apache-2.0
License Family: permissive
Last push: 2025-02-19T05:57:43+00:00

## Health v2 (maintenance only)
Score: 26/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 7, release rhythm 28, longevity 63
- inputs: {"age_days": 894, "days_push": 560, "days_rel": 560, "gap_med": 37, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2779, forks 178 (observed 2026-08-28T04:07:21.543869+00:00)

## What it is
A Python CLI tool that concatenates a directory of files into a single prompt suitable for pasting into LLMs, with filtering by extension, ignore patterns, and output formats like Claude XML and Markdown. It is published on PyPI as files-to-prompt and actively maintained by Simon Willison.

## Use cases
- concatenate a codebase into one prompt for an LLM
- feed multiple source files to Claude or ChatGPT
- prepare repository context for code review by an AI
- filter files by extension before sending to an LLM
- output files in Claude XML format
- include line numbers when sharing code with an LLM

## When to choose
- you need to quickly assemble file contents into an LLM prompt from the terminal
- you want gitignore-aware filtering and multiple output formats
- you prefer a small pip-installable tool that pipes well with other commands

## When to avoid
- you need an IDE plugin or GUI for building LLM context
- you need to send very large codebases exceeding model context limits
- you want automatic embedding or RAG-style retrieval instead of raw concatenation

## Facets
- artifact type: cli-tool
- maturity: active
- function: cli, prompt-engineering, developer-tools, file-system
- domain: developer-tools, large-language-models, files
- platform: cli, python, cross-platform
- tags: llm-prompting, code-context, file-concatenation, cxml, piped-output, command-line

## Member repositories
- simonw/files-to-prompt (main) score 26

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:21.543869+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:16:09.133301+00:00, confidence not recorded.
  - readme: https://github.com/simonw/files-to-prompt (fetched 2026-08-28T04:07:21.543869+00:00, sha 72ea053f66eb)
  - registry_pypi: https://pypi.org/pypi/files-to-prompt/json (fetched 2026-08-29T09:55:38.004085+00:00, sha b5a353a970a1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
