Who it is forA developer who keeps copying files one by one into a chat window to ask about a codebase.
The problemManually gathering and formatting files for an LLM is slow and you never know how many tokens you are sending.
The outcomeOne structured prompt of your project, with a token estimate, on your clipboard or in a file.
What you need first
- Cargo, Homebrew, or pip for the Python SDK; binaries are also on the releases page
- Git, Rust and Cargo only if you build from source
- Optional: the wayland feature flag for clipboard support on Wayland systems
Steps
- Install with
cargo install code2promptorbrew install code2prompt - Run
code2prompt .in your project; output goes to stdout, add -c to copy it to the clipboard - Save it instead with
code2prompt path/to/project --output-file prompt.txt - Check the token estimate before pasting so you stay inside your model's context window
- Paste the prompt into your LLM with your question
Prompt for your agent
Install mufeedvh/code2prompt and generate a prompt for <project folder> saved to prompt.txt. Tell me the token estimate, and if it is over <limit> tokens, rerun it excluding <folders> with glob filters.
Caveat. The token count is an estimate: the README says the full rendered prompt is not re-tokenized. Check that no secrets are in the files before sending them to a hosted model.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for mufeedvh/code2prompt and "Turn a whole repo into one prompt for an LLM"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer