Code2prompt | Bloghttps://code2prompt.dev/enWhy I Developed Code2Prompthttps://code2prompt.dev/blog/20250411_why_i_wrote_code2prompt/https://code2prompt.dev/blog/20250411_why_i_wrote_code2prompt/The story behind code2prompt: my Open-Source quest to tackle context challenges in LLM workflows Fri, 11 Apr 2025 00:00:00 GMT<div><h2 id="introduction">Introduction</h2><a href="#introduction"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “Introduction”</span></a></div> <p>I’ve always been fascinated by how Large Language Models (LLMs) transform coding workflows—generating tests, docstrings, or even shipping entire features in minutes. But as I pushed these models further, a few critical pain points kept surfacing:</p> <table><thead><tr><th>Planning Difficulties</th><th>High Token Costs</th><th>Hallucinations</th></tr></thead><tbody><tr><td>🧠 ➡️ 🤯</td><td>🔥 ➡️ 💸</td><td>💬 ➡️ 🌀</td></tr></tbody></table> <p>That’s why I started contributing to <code dir="auto">code2prompt</code>, a Rust-based tool to help feed just the proper context into LLMs.</p> <p>In this post, I’ll share my journey and explain why I’m convinced that <code dir="auto">code2prompt</code> is relevant today and integrates so well and why it’s become my go-to solution for better, faster AI coding workflows.</p> <div><h2 id="my-first-steps-with-llms">My First Steps with LLMs 👣</h2><a href="#my-first-steps-with-llms"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “My First Steps with LLMs 👣”</span></a></div> <p>I started experimenting with LLMs on <code dir="auto">OpenAI Playground</code> with <code dir="auto">text-davinci-003</code> when it gained traction in November 2023. Language models enabled a new revolution. It felt like having a brilliant new assistant who would crank out unit tests and docstrings almost on command. I enjoyed pushing the models to their limits—testing everything from small talk and ethical dilemmas to jailbreaks and complex coding tasks. However, as I took on more extensive projects, I quickly realized that the models had glaring limitations. At first, I could only fit a few hundred lines of code into the context window, and even then, the models often struggled to understand the code’s purpose or structure. That’s why I quickly noticed that the importance of context was paramount. The more concise my instructions were and the better the context, the better the results.</p> <p><img src="https://code2prompt.dev/assets/blog/post1/playground.png" alt="OpenAI Playground"></p> <div><h2 id="model-evolution-️">Model Evolution 🏗️</h2><a href="#model-evolution-️"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “Model Evolution 🏗️”</span></a></div> <p>The models could produce impressive results but often struggled with larger codebases or complex tasks. I found myself spending more time crafting prompts than actually coding. At the same time, the models kept improving with the release of new versions. They increased reasoning abilities and context size, offering new perspectives and possibilities. I could fit almost two thousand lines of code into the context window then, and the results improved. I could write entire features in a matter of a few iterations, and I was amazed by how quickly I could get results. I was convinced that LLMs were the future of coding, and I wanted to be part of that revolution. I firmly believe that AI won’t replace us yet. But will assist us in the form of assistants where humans are the experts still in control.</p> <div><h2 id="my-first-projects-with-llms">My First Projects with LLMs🚀</h2><a href="#my-first-projects-with-llms"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “My First Projects with LLMs🚀”</span></a></div> <p>I started to write a <code dir="auto">ROS</code> pathfinding module for a robotic competition, generate features for a clean architecture <code dir="auto">Flutter</code> cross-platform app, and made a small web app to keep track of my expenses in <code dir="auto">Next.js</code>. The fact that I built this small app in one evening, in a framework I’d never touched before, was a game-changer moment for me; LLMs weren’t just tools but multipliers. I developed `bboxconverter’, a package to convert bounding boxes, and the list goes on. LLMs can help you learn new technologies and frameworks quickly; that’s awesome.</p> <div><h2 id="a-new-paradigm-software-30">A New Paradigm: Software 3.0 💡</h2><a href="#a-new-paradigm-software-30"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “A New Paradigm: Software 3.0 💡”</span></a></div> <p>I dove deeper into LLMs and started to build agents and scaffold around them. I reproduced the famous paper <a href="https://restgpt.github.io/">RestGPT</a>. The idea is excellent: give LLMs the ability to call some REST API with an OpenAPI specification, such as <code dir="auto">Spotify</code> or <code dir="auto">TMDB.</code> These capabilities introduce a new software programming paradigm, which I like to call <strong>Software 3.0</strong>.</p> <table><thead><tr><th>Software 1.0</th><th>Software 2.0</th><th>Software 3.0</th></tr></thead><tbody><tr><td>Rules-based</td><td>Data-driven</td><td>Agentic</td></tr></tbody></table> <p>The same idea propelled the <a href="https://modelcontextprotocol.io/introduction">MCP</a> protocol, which allows LLMs to call tools and resources directly in a seamless way because, by design, the tool needs a description to be called by the LLM in the opposite of REST Apis that doesn’t necessarily require OpenAPI specification.</p> <div><h2 id="the-limitations-of-llms">The Limitations of LLMs 🧩</h2><a href="#the-limitations-of-llms"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “The Limitations of LLMs 🧩”</span></a></div> <div><h3 id="hallucinations">Hallucinations 🌀</h3><a href="#hallucinations"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “Hallucinations 🌀”</span></a></div> <p>While reproducing the famous paper <code dir="auto">RESTGPT,</code> I noticed some serious limitations of LLMs. The paper’s authors encountered the same issues I had: LLMs were <strong>hallucinating</strong>. They generate code that is not implemented, inventing arguments and simply following the instructions to the letter without leveraging common sense. E.g., in the original RestGPT codebase, the authors asked in <a href="https://github.com/Yifan-Song793/RestGPT/blob/main/model/caller.py">the caller prompt</a>.</p> <blockquote> <p>“to not get clever and make up steps that don’t exist in the plan.”</p> </blockquote> <p>I found this statement funny and very interesting because it was the first time I encountered someone instructing LLMs not to hallucinate.</p> <div><h3 id="limited-context-size">Limited Context-Size 📏</h3><a href="#limited-context-size"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “Limited Context-Size 📏”</span></a></div> <p>Another limitation was the context size; LLMs perform well in finding the needle in the haystack but struggle to make sense of it. When you give too much context to the language models, they tend to get lost in the details and lose sight of the big picture, which is annoying and requires constant steering. The way I like to think about it is in a similar way as the <a href="https://towardsdatascience.com/curse-of-dimensionality-a-curse-to-machine-learning-c122ee33bfeb/">curse of dimensionality</a>. Replace the word “dimension” or “feature” by “context”, and you get the idea.</p> <p><img src="https://code2prompt.dev/assets/blog/post1/curse_of_dimensionality.png" alt="Curse of Dimensionality"></p> <p>The more context you give to the LLM, the more difficult it is to find the correct answer. I came up with a nice sentence to summarize this idea:</p> <blockquote> <p>Provide as little context as possible but as much as necessary</p> </blockquote> <p>This is heavily inspired by the famous <a href="https://www.lematin.ch/story/alain-berset-la-formule-qui-defie-le-temps-166189802108">quote of Alain Berset</a>, a Swiss politician 🇨🇭 who said during the COVID-19 lockdown:</p> <blockquote> <p>“Nous souhaitons agir aussi vite que possible, mais aussi lentement que nécessaire”</p> </blockquote> <p>This represents the idea of compromise and applies to the context size of LLMs!</p> <div><h2 id="searching-for-a-better-way-code2prompt">Searching for a Better Way: code2prompt 🔨</h2><a href="#searching-for-a-better-way-code2prompt"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “Searching for a Better Way: code2prompt 🔨”</span></a></div> <p>Therefore, I needed a way to load, filter, and organize my code context quickly by provisioning the least amount possible of context with the best quality possible. I tried manually copying files or snippets into prompts, but that became unwieldy and error-prone. I knew automating the tedious process of forging the context to ask better prompts would be helpful. Then, one day, I typed “code2prompt” into Google, hoping to find a tool that piped my code directly into prompts.</p> <p>Lo and behold, I discovered a <strong>Rust-based project</strong> by <a href="https://www.reddit.com/r/rust/comments/1bghroh/i_made_code2prompt_a_cli_tool_to_convert_your/">Mufeed</a> named <em>code2prompt</em>, sporting about 200 stars on GitHub. It was still basic at the time: a simple CLI tool with basic limited filter capacity and templates. I saw enormous potential and jumped in straight to contribute, implementing glob pattern matching, among other features, and soon became the main contributor.</p> <div><h2 id="vision--integrations">Vision &amp; Integrations 🔮</h2><a href="#vision--integrations"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “Vision &amp; Integrations 🔮”</span></a></div> <p>Today, there are several ways to provide context to LLMs. Generating from the larger context, using Retrieval-Augmented Generation (RAG), <a href="https://www.all-hands.dev/blog/openhands-context-condensensation-for-more-efficient-ai-agents">compressing the code</a>, or even using a combination of these methods. Context forging is a hot topic that will evolve rapidly in the coming months. However, my approach is <strong>KISS</strong>: Keep It Simple, Stupid. The best way to provide context to LLMs is to use the simplest and most efficient way possible. You forge precisely the context you need; it’s deterministic, contrary to RAG.</p> <p>That’s why I decided to push <code dir="auto">code2prompt</code> further as a simple tool that can be used in any workflow. I wanted to make it easy to use, easy to integrate, and easy to extend. That’s why I added new ways to interact with the tool.</p> <ul> <li><strong>Core</strong>: The core of <code dir="auto">code2prompt</code> is a Rust library that provides the basic functionality to forge context from your codebase. It includes a simple API to load, filter, and organize your code context.</li> <li><strong>CLI:</strong> The command line interface is the simplest way to use <code dir="auto">code2prompt</code>. You can forge context from your codebase and pipe it directly into your prompts.</li> <li><strong>Python API:</strong> The Python API is a simple wrapper around the CLI that allows you to use <code dir="auto">code2prompt</code> in your Python scripts and agents. You can forge context from your codebase and pipe it directly into your prompts.</li> <li><strong>MCP</strong>: The <code dir="auto">code2prompt</code> MCP server allows LLMs to use <code dir="auto">code2prompt</code> as a tool, thus making themselves capable of forging the context.</li> </ul> <p>The vision is described further in the <a href="https://code2prompt.dev/docs/vision">vision page</a> in the doc.</p> <div><h2 id="integration-with-agents">Integration with agents 👤</h2><a href="#integration-with-agents"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “Integration with agents 👤”</span></a></div> <p>I believe that future agents will need to have a way to ingest context, and <code dir="auto">code2prompt</code> is the simple and efficient way to do it for textual repositories like codebase, documentation, or notes. A propical place to use <code dir="auto">code2prompt</code> would be in a codebase with meaningful naming conventions. For example, in clean architecture, there is a clear separation of concerns and layers. The relevant context usually resides in different files and folders but share the same name. This is a perfect use case for <code dir="auto">code2prompt</code>, where you can use the glob pattern to grab the relevant files.</p> <p><strong>Glob Pattern-first:</strong> Precisely select or exclude files with minimal fuss.</p> <p>Furthermore, the core library is designed as a stateful context manager, allowing you to add or remove files as your conversation with the LLM evolves. This is particularly useful when providing context for a specific task or goal. You can easily add or remove files from the context without re-running the process.</p> <p><strong>Stateful Context:</strong> Add or remove files as your conversation with the LLM evolves.</p> <p>Those capabilities make <code dir="auto">code2prompt</code> a perfect fit for agent-based workflows. The MCP server allows seamless integration with popular AI agent frameworks like <a href="https://github.com/paul-gauthier/aider">Aider</a>, <a href="https://block.github.io/goose/">Goose</a>, or <a href="https://github.com/jhillyerd/cline">Cline</a>. Let them handle complex goals while <code dir="auto">code2prompt</code> delivers the perfect code context.</p> <div><h2 id="why-code2prompt-matters">Why Code2prompt Matters ✊</h2><a href="#why-code2prompt-matters"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “Why Code2prompt Matters ✊”</span></a></div> <p>As LLMs evolve and context windows expand, it might seem like purely brute-forcing entire repositories into prompts is enough. However, <strong>token costs</strong> and <strong>prompt coherence</strong> remain significant roadblocks for small companies and developers. Focusing on just the code that matters, <code dir="auto">code2prompt</code> keeps your LLM usage efficient, cost-effective, and less prone to hallucination.</p> <p><strong>In short:</strong></p> <ul> <li><strong>Reduce hallucinations</strong> by providing the right amount of context</li> <li><strong>Reduce token-usage</strong> costs by manually curating the proper context needed</li> <li><strong>Improve LLM performance</strong> by giving the right amount of context</li> <li>Integrates the agentic stack as a context feeder for text repositories</li> </ul> <div><h2 id="you-can-join-its-open-source">You can join It’s Open Source! 🌐</h2><a href="#you-can-join-its-open-source"><span aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span><span>Section titled “You can join It’s Open Source! 🌐”</span></a></div> <p>Every new contributor is welcome! Come aboard if you’re interested in Rust, forging innovative AI tools, or simply want a better workflow for your code-based prompts.</p> <p>Thanks for reading, and I hope my story inspired you to check out code2prompt. It’s been an incredible journey, and it’s just getting started!</p> <p><strong>Olivier D’Ancona</strong></p>open-sourcecode2promptAIAgent