search

Found

info Overview

Combine multiple source files into one Markdown block with directory tree. Paste straight into ChatGPT or Claude; binary files auto-skipped.

📘 How to Use

  1. Click the upload zone or drop the source files you want to combine
  2. Review the directory tree and concatenated code in the preview pane

Codebase to LLM Prompt Builder

upload_file

Click to select or drag and drop

Copied!
Article

Codebase to LLM Prompt Builder | Fold a Whole Repo into One Paste-Ready Block

Bundle multiple source files into a single Markdown block containing both a directory tree and the full file contents. The output is shaped to drop straight into ChatGPT, Claude, or any other LLM chat without extra cleanup.

💡 About this tool

When you ask an LLM to refactor a project, the model needs context. Pasting one file at a time hides the project layout and forces the model to guess imports, dependencies, and call sites. Most "context errors" you see in long ChatGPT or Cursor sessions stem from missing structural framing, not from the snippet being wrong.

This converter writes two sections into the output:

  • # Directory Structure — a flat list of every loaded file path
  • # Source Codes — each file wrapped in a Markdown code fence with its extension as the language tag

Binary types (image/*, video/*, audio/*, application/pdf, application/zip) are skipped at upload time, so dragging in a folder full of mixed assets won't pollute the prompt with base64 noise. The preview shows the first 2000 characters; the clipboard copy always carries the full text.

🧐 Frequently Asked Questions

Q. Can I drag in an entire folder? A. Yes — drag the folder directly onto the drop zone. Browsers that expose webkitRelativePath will keep the nested folder structure in the output's # Directory Structure section. Otherwise you get a flat list of file names.

Q. Does this work with private or proprietary code? A. File reading happens entirely in your browser; no file is uploaded to a server during conversion. Whatever you then paste into ChatGPT, Claude, or another service is of course bound by that service's terms — review them before pasting production code.

Q. Why does the preview cut off at 2000 characters? A. The preview pane is a sanity check, not the deliverable. The copy button always grabs the entire concatenated Markdown so the receiving LLM sees the whole repo.

Q. Will Cursor / Cline / Aider already do this for me? A. Those tools embed similar bundling for their own agent runs, but they don't expose the raw prompt. If you want to debug "why did Claude misread my project," reproducing the prompt in a normal chat with this tool's output is the quickest way to see what context the agent actually had.

Q. How do I keep the prompt under the model's token budget? A. Load only the relevant subset — for example, just the modules involved in the bug. Both Claude and GPT-4 class models tend to do better with a focused 20-file slice than a 200-file mega-prompt where most files are irrelevant.

📚 Fun Facts

A widely shared rule of thumb in the Claude / Cursor / Aider community is "give the model the project structure first, then the code" — basically the format this tool produces. When you stuff raw code into a chat without the tree, the model often invents a directory layout that doesn't exist, then writes refactors against the imaginary layout. Showing it the actual tree once at the top of the prompt cuts that failure mode dramatically.

Tip from the Aider community: when bundling a TypeScript or Python project, include package.json or pyproject.toml in the first batch. It's a cheap way to tell the model which versions, frameworks, and lint rules are in play before it generates any code suggestions.