HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
mufeedvh
code2prompt
Rust2024–2026
mufeedvh / code2prompt

code2prompt

A CLI tool to convert your codebase into a single LLM prompt with source tree, prompt templating, and token counting.

10Distinct people
14Mentions
0Explicit recommenders
7.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A CLI tool to convert your codebase into a single LLM prompt with source tree, prompt templating, and token counting.

GitHub

Where it is used

No documented product use has been verified yet.

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, 12:54:37 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 month14 dated mentions

Observed mentions: 2024-03-11 20:32:28 UTC to 2026-05-28 22:52:35 UTC.

01232024-03-01 00:00:00 UTC to 2024-04-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 commentsMar 20242024-04-01 00:00:00 UTC to 2024-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-05-01 00:00:00 UTC to 2024-06-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-06-01 00:00:00 UTC to 2024-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-07-01 00:00:00 UTC to 2024-08-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 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): 2 mentions; 0 submissions, 2 comments2024-10-01 00:00:00 UTC to 2024-11-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 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): 3 mentions; 2 submissions, 1 comments2025-01-01 00:00:00 UTC to 2025-02-01 00:00:00 UTC (exclusive): 2 mentions; 2 submissions, 0 comments2025-02-01 00:00:00 UTC to 2025-03-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 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): 0 mentions; 0 submissions, 0 commentsApr 20252025-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 comments2025-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): 0 mentions; 0 submissions, 0 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): 1 mentions; 1 submissions, 0 commentsMay 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
Mar 20242024-03-01 00:00:00 UTC2024-04-01 00:00:00 UTC211
Apr 20242024-04-01 00:00:00 UTC2024-05-01 00:00:00 UTC000
May 20242024-05-01 00:00:00 UTC2024-06-01 00:00:00 UTC101
Jun 20242024-06-01 00:00:00 UTC2024-07-01 00:00:00 UTC000
Jul 20242024-07-01 00:00:00 UTC2024-08-01 00:00:00 UTC101
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 UTC202
Oct 20242024-10-01 00:00:00 UTC2024-11-01 00:00:00 UTC000
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 UTC321
Jan 20252025-01-01 00:00:00 UTC2025-02-01 00:00:00 UTC220
Feb 20252025-02-01 00:00:00 UTC2025-03-01 00:00:00 UTC101
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 UTC000
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 UTC000
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 UTC110

What Hacker News says

14 sources
alfonsodev·Jan 7, 2025Submission

Ask HN: How do you load your code base as context window in ChatGPT?

I've read O1 has 200k tokens limit as per context window [1], my code base is about 177k, I could generate a prompt with code2prompt [2] tool and load my code base as a prompt, but: - it doesn't allow me to attach text files when o1 is selected. - Pasting the whole prompt is the text area freezes the browser for a while but when si done, I can't submitted as the send button is disabled. - When creating a project I can attach files but then I can't select o1 model. I'm on the fence to buy pro subscription, if only I could use o1 with my code base as context window. When they say 200k tokens it means trough the api? But then I'd incur in extra costs which seems odd since I'm already paying the subscription, and it's not an automation use case. I would appreciate if anyone can share their experience working with large context window for spe
Read the rest
2 points · Open discussion

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
I found this tool (repo2file) helpful for my workflows - quickly giving context for questions to my local LLM about my working (small) repo in the terminal. Until I saw this post, I wasn't aware of any of those. What 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 ignore option - [code2prompt](https://github.com/mufeedvh/code2prompt) --> It always puts the output to the paste buffer even if you specify output file - https://gh-repo-dl.cottonash.com/ --> There's no CLI - [1filellm](https://github.com/jimmc414/1filellm) --> Many dependencies and complicated setup(have to setup GitHub access token which I've never done) - [repopack](https://github.com/yam
Read the rest
adashy/repopack) - [ingest](https://github.com/sammcj/ingest) --> haven't tried these yet, but they actually look promising...
In Show HN: Dump entire Git repos into a single file for LLM prompts
These are extremely 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) - https://gh-repo-dl.cottonash.com/ - [1filellm](https://github.com/jimmc414/1filellm) - [repopack](https://github.com/yamadashy/repopack) - [ingest](https://github.com/sammcj/ingest) What makes yours better?
In Show HN: Dump entire Git repos into a single file for LLM prompts
I use code2prompt (https://github.com/mufeedvh/code2prompt) with the following zsh wrapper: function code2prompt() { # wrap the code2prompt command in a function that sets a number of default excludes # https://github.com/mufeedvh/code2prompt/ local arguments excludeFiles excludeFolders templatesFolder excludeExtensions templatesFolder="${HOME}/git/code2prompt/templates" excludeFiles=".editorconfig,.eslintignore,.eslintrc,tsconfig.json,.gitignore,.npmrc,LICENSE,esbuild.config.mjs,manifest.json,package-lock.json,\ version-bump.mjs,versions.json,yarn.lock,CONTRIBUTING.md,CHANGELOG.md,SECURITY.md,.nvmrc,.env,.env.production,.prettierrc,.prettierignore,.stylelintrc,\ CODEOWNERS,commitlint.config.js,renovate.json,pre-commit-config.yaml,.vimrc,poetry.lock,changelog.md,contributing.md,.pretterignore,.prettier
Read the rest
rc.json,\ .prettierrc.yml,.prettierrc.js,.eslintrc.js,.eslintrc.json,.eslintrc.yml,.eslintrc.yaml,.stylelintrc.js,.stylelintrc.json,.stylelintrc.yml,.stylelintrc.yaml" excludeFolders="screenshots,dist,node_modules,.git,.github,.vscode,build,coverage,tmp,out,temp,logs" excludeExtensions="png,jpg,jpeg,gif,svg,mp4,webm,avi,mp3,wav,flac,zip,tar,gz,bz2,7z,iso,bin,exe,app,dmg,deb,rpm,apk,fig,xd,blend,fbx,obj,tmp,swp,\ lock,DS_Store,sqlite,log,sqlite3,dll,woff,woff2,ttf,eot,otf,ico,icns,csv,doc,docx,ppt,pptx,xls,xlsx,pdf,cmd,bat,dat,baseline,ps1,bin,exe,app,tmp,diff,bmp,ico" echo "---" echo "Available templates:" ls -1 "$templatesFolder" echo "---" echo "Excluding files: $excludeFiles" echo "Excluding folders: $excludeFolders" echo "Run with -nn to disable the default excludes" # array of build arguments arguments=("--tokens") # if -t and a template name is provided, append the template flag with the full path to the template to the arguments array if [[ $1 == "-t" ]]; then arguments+=("--template" "$templatesFolder/$2") shift 2 fi if [[ $1 == "-nn" ]]; then command code2prompt "${arguments[@]}" "${@:2}" # remove the -nn flag else command code2prompt "${arguments[@]}" --exclude-files "$excludeFiles" --exclude-folders "$excludeFolders" --exclude "$excludeExtensions" "${*}" fi }
In Show HN: FileKitty – Combine and label text files for LLM prompt contexts

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.