Coding agents and dev tools · Edition No. 30 · 24 Sep 2026

mufeedvh/code2prompt

Turns a folder of code into one templated prompt with a source tree and a token count, respecting the ignore rules already in the project.

← Coding agents and dev toolsRead the whole edition →

7,501 stars · MIT · v4.2.0 (2025-12-11, ungh) · Track this in Scout

Turns a folder of code into one templated prompt with a source tree and a token count, respecting the ignore rules already in the project.

▶Repo detailsthe review · specs · pros & cons · install

What it is

code2prompt is a Rust command-line tool that walks a directory, respects the ignore rules already in the project, and writes the result as a single templated prompt. Templates control the shape of the output, so the same codebase can be formatted differently for different questions.

What it is good for. Anyone who asks an assistant about their own code and keeps getting answers based on half the picture. It is also useful for writing documentation from a codebase, or for producing a review request that actually contains the files being reviewed.

Stars7,501
LicenceMIT
Latestv4.2.0 (2025-12-11, ungh)
Good
  • It obeys .gitignore, so build output and dependency folders do not end up in the prompt by accident.
  • The token count is printed before you send anything, which is the difference between a question that fits and a question that is silently truncated.
  • Filters by file type and by path, so you can send only the parts that matter.
Watch for
  • A big codebase produces a prompt too large for any model. The filters are not optional on a real project; they are the job.
  • The newest release, v4.2.0, is dated 11 December 2025, while code landed on 29 June 2026 — three months ago.
  • It prepares a prompt and stops. It does not talk to any model, so you still need something to paste it into.
Similar repositories
Install
# with Rust installed
cargo install code2prompt
# or on macOS
brew install code2prompt
code2prompt . --exclude "node_modules,dist,*.lock"
Screenshots
mufeedvh/code2prompt: GitHub preview cardmufeedvh/code2prompt: Screenshot 1mufeedvh/code2prompt: Screenshot 2mufeedvh/code2prompt: Screenshot 3

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.