HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
simonw
files-to-prompt
Python2024–2026
simonw / files-to-prompt

files-to-prompt

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

14Distinct people
20Mentions
0Explicit recommenders
2.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

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

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month20 dated mentions

Observed mentions: 2024-06-25 17:25:22 UTC to 2026-07-07 22:49:20 UTC.

012342024-06-01 00:00:00 UTC to 2024-07-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJun 20242024-07-01 00:00:00 UTC to 2024-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-08-01 00:00:00 UTC to 2024-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-09-01 00:00:00 UTC to 2024-10-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2024-10-01 00:00:00 UTC to 2024-11-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-11-01 00:00:00 UTC to 2024-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-12-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2025-01-01 00:00:00 UTC to 2025-02-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2025-02-01 00:00:00 UTC to 2025-03-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2025-03-01 00:00:00 UTC to 2025-04-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-04-01 00:00:00 UTC to 2025-05-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-05-01 00:00:00 UTC to 2025-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-06-01 00:00:00 UTC to 2025-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsJun 20252025-07-01 00:00:00 UTC to 2025-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-08-01 00:00:00 UTC to 2025-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-09-01 00:00:00 UTC to 2025-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-01 00:00:00 UTC to 2025-11-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-11-01 00:00:00 UTC to 2025-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-12-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2026-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-02-01 00:00:00 UTC to 2026-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-03-01 00:00:00 UTC to 2026-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-04-01 00:00:00 UTC to 2026-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-05-01 00:00:00 UTC to 2026-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-06-01 00:00:00 UTC to 2026-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-07-01 00:00:00 UTC to 2026-08-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJul 2026

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jun 20242024-06-01 00:00:00 UTC2024-07-01 00:00:00 UTC101
Jul 20242024-07-01 00:00:00 UTC2024-08-01 00:00:00 UTC000
Aug 20242024-08-01 00:00:00 UTC2024-09-01 00:00:00 UTC000
Sep 20242024-09-01 00:00:00 UTC2024-10-01 00:00:00 UTC303
Oct 20242024-10-01 00:00:00 UTC2024-11-01 00:00:00 UTC101
Nov 20242024-11-01 00:00:00 UTC2024-12-01 00:00:00 UTC000
Dec 20242024-12-01 00:00:00 UTC2025-01-01 00:00:00 UTC413
Jan 20252025-01-01 00:00:00 UTC2025-02-01 00:00:00 UTC303
Feb 20252025-02-01 00:00:00 UTC2025-03-01 00:00:00 UTC404
Mar 20252025-03-01 00:00:00 UTC2025-04-01 00:00:00 UTC101
Apr 20252025-04-01 00:00:00 UTC2025-05-01 00:00:00 UTC101
May 20252025-05-01 00:00:00 UTC2025-06-01 00:00:00 UTC000
Jun 20252025-06-01 00:00:00 UTC2025-07-01 00:00:00 UTC000
Jul 20252025-07-01 00:00:00 UTC2025-08-01 00:00:00 UTC000
Aug 20252025-08-01 00:00:00 UTC2025-09-01 00:00:00 UTC000
Sep 20252025-09-01 00:00:00 UTC2025-10-01 00:00:00 UTC000
Oct 20252025-10-01 00:00:00 UTC2025-11-01 00:00:00 UTC101
Nov 20252025-11-01 00:00:00 UTC2025-12-01 00:00:00 UTC000
Dec 20252025-12-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
Jan 20262026-01-01 00:00:00 UTC2026-02-01 00:00:00 UTC000
Feb 20262026-02-01 00:00:00 UTC2026-03-01 00:00:00 UTC000
Mar 20262026-03-01 00:00:00 UTC2026-04-01 00:00:00 UTC000
Apr 20262026-04-01 00:00:00 UTC2026-05-01 00:00:00 UTC000
May 20262026-05-01 00:00:00 UTC2026-06-01 00:00:00 UTC000
Jun 20262026-06-01 00:00:00 UTC2026-07-01 00:00:00 UTC000
Jul 20262026-07-01 00:00:00 UTC2026-08-01 00:00:00 UTC101

What Hacker News says

20 sources
I'm in your boat with having to write a significant amount of English documents. I always write them myself, and have ChatGPT analyze them as well. I just had a thought - I wonder if I could paste in technical documentation, and code, to validate my documentation? Will have to try that later. CoPilot is used for simple boilerplate code, and also for the autocomplete. It's often a starting point for unit tests (but a thorough review is needed - you can't just accept it, I've seen it misinterpret code). I started experimenting with RA.Aid (https://github.com/ai-christianson/RA.Aid) after seeing a post on it here today. The multi-step actions are very promising. I'm about to try files-to-prompt (https://github.com/simonw/files-to-prompt) mentioned elsewhere in the thread. For now, LLMs are a level-up in tooling but not a replacement for deve
Read the rest
lopers (at least yet)
In How I use LLMs as a staff engineer
On last resort bug fixes: > I don’t do this a lot, but sometimes when I’m really stuck on a bug, I’ll attach the entire file or files to Copilot chat, paste the error message, and just ask “can you help?” The "reasoning" models are MUCH better than this. I've had genuinely fantastic results with this kind of thing against o1 and Gemini Thinking and the new o3-mini - I paste in the whole codebase (usually via my https://github.com/simonw/files-to-prompt tool) and describe the bug or just paste in the error message and the model frequently finds the source, sometimes following the path through several modules to get there. Here's a slightly order example: https://gist.github.com/simonw/03776d9f80534aa8e5348580dc6a8... - finding a bug in some Django middleware
In How I use LLMs as a staff engineer
I have to add https://github.com/simonw/files-to-prompt as a marker guid. I think "the part of it" is key here. For packaging a codebase, I'll select a collection of files using rg/fzf and then concatenate them into a markdown document, # headers for paths ```filetype <data>``` for the contents. The selection of the files is key to let the LLM focus on what is important for the immediate task. I'll also give it the full file list and have the LLM request files as needed.
In Yek: Serialize your code repo (or part of it) to feed into any LLM
I use my https://github.com/simonw/files-to-prompt tool like this: files-to-prompt . -e py -e md -c | pbcopy Now I have all the Python and Markdown files from the current project on my clipboard, in Claude's recommended XML-like format (which I find works well with other models too). Then I paste that into the Claude web interface or Google's AI Studio if it's too long for Claude and ask questions there. Sometimes I'll pipe it straight into my own LLM CLI tool and ask questions that way: files-to-prompt . -e py -e md -c | \ llm -m gemini-2.0-flash-exp 'which files handle JWT verification?' I can later start a chat session on top of the accumulated context like this: llm chat -c (The -c means "continue most recent conversation in the chat").
In Things we learned about LLMs in 2024
I use them successfully on larger project all the time. "Here's some example JavaScript code that sends an email through the SendGrid REST API. Write me a python function for sending an email that accepts an email address, subject, path to a Jinja template and a dictionary of template context. It should return true or false for if the email was sent without errors, and log any error messages to stderr" That prompt is equally effective for a project that's 500 lines or 5,000,000 lines of code. I also use them for code spelunking - you can pipe quite a lot of code into Gemini and ask questions like "which modules handle incoming API request validation?" - that's why I built https://github.com/simonw/files-to-prompt
In Things we learned about LLMs in 2024

Show HN: Source to Prompt- Turn your code into an LLM prompt with more features

Your Source to Prompt-- Turn your code into an LLM prompt, but with way more features! I just made this useful tool as a single html file that lets you easily turn your coding projects into targeted single text files for use in LLM prompts for AI-aided development. Unlike the many other existing competing projects-- to name just a few: 1. [files-to-prompt](https://github.com/simonw/files-to-prompt) 2. [repo2txt](https://repo2txt.simplebasedomain.com/) 3. [code2prompt](https://github.com/mufeedvh/code2prompt) 4. [repomix](https://github.com/yamadashy/repomix) 5. [ingest](https://github.com/sammcj/ingest) 6. [1filellm](https://github.com/jimmc414/1filellm) 7. [repo2file](https://github.com/artkulak/repo2file) ...there are some real advantages to this one that make it stand out: * It's a single html file that you download to your local machi
Read the rest
ne-- that's it! just open in a modern browser like chrome and you can use it securely. * Because it's locally hosted, with no requirements like python or anything else, it's very quick to get it running on any machine, and because it's local, you can use it on your own private repos without worrying about using a github authorization token or similar annoyance. * You don't even need to be working with a repo at all, it works just as well with a regular folder of code files. Also, I added tons of quality of life improvements that were major pain points for me personally: These include laboriously re-selecting the same or very similar subset of files over and over again; now you can save a preset (either to localStorage in the browser or exported and saved as a JSON file) and dramatically speed this up. There are also a few other features to speed up the file selection process, such as quick string based filtering on file names, and common quick selection patterns (such as "select all React files"). It also keeps track of the total size in KB and lines of text that have been selected in a handy tally section which is always visible in the upper right corner, so you always know when you are reaching the maximum of the context window of whatever model you're working with. Based on my experience, I added in warnings for GPT4o and o1 and also Claude3.5 Sonnet. Before the listing of the files and their contents, it also automatically includes the hierarchical file/folder structure of the files you select, and next to each one, shows the size in KB and the number of lines, which helps give the model context about which files are the most important. I also added the ability to minify the code so you can cram more into the context window. Similarly, you can also strip out code comments, and it will tell you how much space this saved. You can also specify a "preamble" that you can save and quickly edit, as well as a "goal" where you specify what you're trying to accomplish. All of this can be included in your saved presets to save you time. I hope you find it useful!
1 points · Open discussion
I just made this useful tool as a single html file that lets you easily turn your coding projects into targeted single text files for use in LLM prompts for AI-aided development: https://github.com/Dicklesworthstone/your-source-to-prompt.h... Unlike the many other existing competing projects-- to name just a few: files-to-prompt: https://github.com/simonw/files-to-prompt repo2txt: https://repo2txt.simplebasedomain.com/ code2prompt: https://github.com/mufeedvh/code2prompt repomix: https://github.com/yamadashy/repomix ingest: https://github.com/sammcj/ingest 1filellm: https://github.com/jimmc414/1filellm repo2file: https://github.com/artkulak/repo2file ...there are some real advantages to this one that make it stand out: It's a single html file that you download to your local machine-- that's it! just open in a modern browser like chrome an
Read the rest
d you can use it securely. Because it's locally hosted, with no requirements like python or anything else, it's very quick to get it running on any machine, and because it's local, you can use it on your own private repos without worrying about using a github authorization token or similar annoyance. You don't even need to be working with a repo at all, it works just as well with a regular folder of code files. Also, I added tons of quality of life improvements that were major pain points for me personally: These include laboriously re-selecting the same or very similar subset of files over and over again; now you can save a preset (either to localStorage in the browser or exported and saved as a JSON file) and dramatically speed this up. There are also a few other features to speed up the file selection process, such as quick string based filtering on file names, and common quick selection patterns (such as "select all React files"). It also keeps track of the total size in KB and lines of text that have been selected in a handy tally section which is always visible in the upper right corner, so you always know when you are reaching the maximum of the context window of whatever model you're working with. Based on my experience, I added in warnings for GPT4o and o1 and also Claude3.5 Sonnet. Before the listing of the files and their contents, it also automatically includes the hierarchical file/folder structure of the files you select, and next to each one, shows the size in KB and the number of lines, which helps give the model context about which files are the most important. I also added the ability to minify the code so you can cram more into the context window. You can also specify a "preamble" that you can save and quickly edit, as well as a "goal" where you specify what you're trying to accomplish.
In Source to Prompt- Turn your code into an LLM prompt, but with more features

Showing the 15 most recent of 20 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.