{"by":"grbsh","descendants":33,"id":41521121,"kids":[41522243,41527935,41521877,41526336,41525943,41534761,41528232,41521965,41522208],"score":65,"text":"Hey HN, I wanted to share a simple command line tool I made that has sped up and simplified my LLM assisted coding workflow. Whenever possible, I’ve been trying to use Claude as a first pass when implementing new features &#x2F; changes. But I found that depending on the type of change I was making, I was spending a lot of thought finding and deciding which source files should be included in the prompt. The need to copy&#x2F;paste each file individually also becomes a mild annoyance.<p>First, I implemented `repogather --all` , which unintelligently copies <i>all</i> sources files in your repository to the clipboard (delimited by their relative filepaths). To my surprise, for less complex repositories, this alone is often completely workable for Claude — much better than pasting in the just the few files you are looking to update. But I never would have done it if I had to copy&#x2F;paste everything individually. 200k is quite a lot of tokens!<p>But as soon as the repository grows to a certain complexity level (even if it is under the input token limit), I’ve found that Claude can get confused by different unrelated parts &#x2F; concepts across the code. It performs much better if you make an attempt to exclude logic that is irrelevant to your current change. So I implemented `repogather &quot;&lt;query here&gt;&quot;` , e.g. `repogather &quot;only files related to authentication&quot;` . This uses gpt-4o-mini with structured outputs to provide a relevance score for each source file (with automatic exclusions for .gitignore patterns, tests, configuration, and other manual exclusions with `--exclude &lt;pattern&gt;` ).<p>gpt-4o-mini is so cheap and fast, that for my ~8 dev startup’s repo, it takes under 5 seconds and costs 3-4 cents (with appropriate exclusions). Plus, you get to watch the output stream while you wait which always feels fun.<p>The retrieval isn’t always perfect the first time — but it is fast, which allows you to see what files it returned, and iterate quickly on your command. I’ve found this to be much more satisfying than  embedding-search based solutions I’ve used, which seem to fail in pretty opaque ways.<p><a href=\"https:&#x2F;&#x2F;github.com&#x2F;gr-b&#x2F;repogather\">https:&#x2F;&#x2F;github.com&#x2F;gr-b&#x2F;repogather</a><p>Let me know if it is useful to you! Always love to talk about how to better integrate LLMs into coding workflows.","time":1726149839,"title":"Show HN: Repogather – copy relevant files to clipboard for LLM coding workflows","type":"story","url":"https://github.com/gr-b/repogather"}