Hacker GitHub

← All repos

simonw/files-to-prompt

View on GitHub ↗ ★ 2,803 Python

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

20 mentions on Hacker News by 14 people: 1 story, 19 comments · first 2024-06-25 · latest 2026-07-07

Mentions per year 20 mentions · busiest year 2025 (10)
20082026
  1. …in that it won't accept a lot of file formats, but appending .txt to the end works. I also use https://github.com/simonw/files-to-prompt to combine everything into one file which also helps.
  2. I wrote a tool for that: https://github.com/simonw/files-to-prompt - and there are other similar tools like repomix. These days I often use https://gitingest.com - it can grab any full repo on GitHub has something you can copy and paste,…
    comment by simonw · 2025-10-23 · in Living Dangerously with Claude
  3. …into a .txt file" I think simonw has a tool that also does something like this? Edit- found it: https://github.com/simonw/files-to-prompt
    comment by indigodaddy · 2025-04-22 · in An update to our pricing
  4. He mentions what he used here, https://simonwillison.net/2025/Mar/26/notes/ . https://github.com/simonw/files-to-prompt https://llm.datasette.io/
  5. Files-to-prompt has been a surprisingly useful tool for this kind of workflow. https://github.com/simonw/files-to-prompt
  6. I've been enjoying `files-to-prompt` by Simon Willison: https://github.com/simonw/files-to-prompt
  7. …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…
    comment by elwillbo · 2025-02-04 · in How I use LLMs as a staff engineer
  8. …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…
    comment by simonw · 2025-02-04 · in How I use LLMs as a staff engineer
  9. https://github.com/simonw/files-to-prompt/ seems to work fine especially for Claude as it follows the recommendations and format.
  10. 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, #…
  11. 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…
    comment by simonw · 2025-01-01 · in Things we learned about LLMs in 2024
  12. …and ask questions like "which modules handle incoming API request validation?" - that's why I built https://github.com/simonw/files-to-prompt
    comment by simonw · 2024-12-31 · in Things we learned about LLMs in 2024
  13. …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…
  14. If I understand correctly, this sounds like https://github.com/simonw/files-to-prompt/ . It's quite useful, with some filtering options (hidden files, gitignore, extensions) and support for Claude-style tags.
  15. …model. That's enough to fit a LOT of code, so I've occasionally dumped my entire codebase (using my https://github.com/simonw/files-to-prompt/ tool) in there, or selected pieces that are important like the model and URL definitions.
  16. Similar https://github.com/simonw/files-to-prompt
  17. …makes his better? Since you're asking, I tried these and here's my verdict: - [files-to-prompt]( https://github.com/simonw/files-to-prompt ) (from the GOAT simonw) --> There's no option to specify files to include, must work backwards with…
  18. …common these days. Here are a few I've collected over the past few months: - [files-to-prompt]( https://github.com/simonw/files-to-prompt ) (from the GOAT simonw) - [code2prompt]( https://github.com/mufeedvh/code2prompt ) -…
  19. …that to work (GPT-4o zsh snippet): for file in *.rst; do mv "$file" "${file%.rst}.rst.txt"; done My https://github.com/simonw/files-to-prompt tool might also be useful here, for turning a bunch of different files into a single file to…
    comment by simonw · 2024-06-25 · in Anthropic Introduces Claude Projects