DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to turn a whole repo into one prompt for an LLM with Code2prompt

Point Code2prompt at a folder to get a formatted prompt with the source tree and files, copied or saved.

Short answer: Install with cargo install code2prompt or brew install code2prompt; then 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. All steps.

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

  1. Install with cargo install code2prompt or brew install code2prompt
  2. Run code2prompt . in your project; output goes to stdout, add -c to copy it to the clipboard
  3. Save it instead with code2prompt path/to/project --output-file prompt.txt
  4. Check the token estimate before pasting so you stay inside your model's context window
  5. 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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer