code2prompt

From public sources

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

AI toolCategory: AI ToolsOpen sourcedata checked Oct 15, 2026

Overview

  • ai
  • chatgpt
  • claude
  • cli
  • command-line
  • command-line-tool
  • gpt
  • llm
  • prompt
  • prompt-engineering

Installation

Commands are shown, never run by the marketplace. Check them against the official documentation.

Compatibility

Unknown means no evidence was found — not that the product is incompatible.
PlatformStatusArchitectureEvidenceConfidence
WindowsCompatiblex86_64official build in release v4.2.0: code2prompt-x86_64-pc-windows-msvc.exe0.70
macOSCompatiblearm64official build in release v4.2.0: code2prompt-aarch64-apple-darwin0.70
Compatiblex86_64official build in release v4.2.0: code2prompt-x86_64-apple-darwin0.70
LinuxCompatiblex86_64official build in release v4.2.0: code2prompt-x86_64-unknown-linux-gnu0.70
Web browserUnknown———
Server / self-hostedUnknown———
Container (OCI)Unknown———

Releases

checked Oct 29, 2026
v4.2.0LatestDec 11, 2025Official source ↗

Files in 4.2.0

The marketplace does not host these files: downloads go to the official source. Files have not been scanned by us.
FilePlatformSizeSHA-256Download from the official source
code2prompt-aarch64-apple-darwinmacos · arm6415.4 MB23e78b3fca75…Official source ↗
code2prompt-x86_64-apple-darwinmacos · x86_6416.5 MB97f588d80f6b…Official source ↗
code2prompt-x86_64-pc-windows-msvc.exewindows · x86_64 · exe12.2 MBe3285c8b7319…Official source ↗
code2prompt-x86_64-unknown-linux-gnulinux · x86_6419.7 MB69ff91f6e690…Official source ↗

Release history

Quality profile

algorithm quality-v1.0 · assessed Oct 15, 2026
Quality Score96
Risk Score0
Confidence 1.00
Quality Score and Risk Score are different measures. A high score does not guarantee safety.

Score components

Maintenance · 2020
last activity 20 days ago
Documentation · 1515
README 7758 chars, description present
Ready to use · 1515
install instructions: yes; releases: yes
Metadata · 1010
4/4 of description, homepage, license, topics
Releases · 1010
6 release(s), latest 308 days ago
Category confidence · 107
classifier confidence 0.65
Adoption · 1010
7726 stars (log-dampened, 10k = max)
License clarity · 55
SPDX MIT
Community · 55
issues enabled, 456 forks

License

MIT
Known licensefrom the repository host

This is the catalog policy status, not legal advice.

Sources

github.com/mufeedvh/code2promptPrimary★ 7,726 starslast activity Sep 25, 2026Primary repository · Confidence 1.00

Reviews

Sign in to write a review

No reviews yet.

Alternatives

README

From mufeedvh/code2prompt · license MIT · fetched Oct 29, 2026

[License] [Crates.io] [PyPI] [CI] [Discord] [Docs.rs] [Crates.io Downloads] [GitHub Stars]


[Flow Diagram]

Code2Prompt is a powerful context engineering tool designed to ingest codebases and format them for Large Language Models. Whether you are manually copying context for ChatGPT, building AI agents via Python, or running a MCP server, Code2Prompt streamlines the context preparation process.

⚡ Quick Install

Cargo

cargo install code2prompt 

To enable optional Wayland support (e.g., for clipboard integration on Wayland-based systems), use the wayland feature flag:

cargo install --features wayland code2prompt

Homebrew

brew install code2prompt

SDK with pip 🐍

pip install code2prompt-rs

🚀 Quick Start

Once installed, generating a prompt from your codebase is as simple as pointing the tool to your directory.

Basic Usage: Generate a prompt from the current directory. Output goes to stdout by default; use -c to copy it to the clipboard.

code2prompt .

Save to file:

code2prompt path/to/project --output-file prompt.txt

🤖 Agent Skill

Teach your coding agent to install and use code2prompt for repository navigation and scoped context gathering with the Skills CLI:

npx skills add mufeedvh/code2prompt

The code2prompt skill helps agents reduce exploration round trips: inspect a compact map of functions and classes using sem-core, then read relevant source files and tests together. It includes a map template and installation instructions for the optional entity-map feature, with a directory map fallback for standard builds. The code2prompt CLI is installed separately.

The installer adds the skill folder and its template to your agent. It may clone the repository temporarily to retrieve them; the rest of the repository is not installed as part of the skill.

To install it globally for a specific agent, for example Codex:

npx skills add mufeedvh/code2prompt --skill code2prompt --agent codex --global

🌐 Ecosystem

Code2Prompt is more than just a CLI tool. It is a complete ecosystem for codebase context.

🧱 Core Library 💻 CLI Tool 🐍 Python SDK 🤖 MCP Server
The internal, high-speed library responsible for secure file traversal, respecting .gitignore rules, and structuring Git metadata.Designed for humans, featuring both a minimal CLI and an interactive TUI. Generate formatted prompts, track token usage, and outputs the result to your clipboard or stdout.Provides fast Python bindings to the Rust Core. Ideal for AI Agents, automation scripts, or deep integration into RAG pipelines. Available on PyPI.Run Code2Prompt as a local service, enabling agentic applications to read your local codebase efficiently without bloating your context window.

📚 Documentation

Check our online documentation for detailed instructions

✨ Features

Code2Prompt transforms your entire codebase into a well-structured prompt for large language models. Key features include:

  • Terminal User Interface (TUI): Interactive terminal interface for configuring and generating prompts
  • Smart Filtering: Include/exclude files using glob patterns and respect .gitignore rules
  • Flexible Templating: Customize prompts with Handlebars templates for different use cases
  • Automatic Code Processing: Convert codebases of any size into readable, formatted prompts
  • Token Estimates: Estimate prompt size using parallel per-file token counts and estimated template overhead, including optional line numbers. The full rendered prompt is not re-tokenized, and the estimate excludes the JSON output envelope.
  • Smart File Reading: Simplify reading various file formats for LLMs (CSV, Notebooks, JSONL, etc.)
  • Git Integration: Include diffs, logs, and branch comparisons in your prompts
  • Blazing Fast: Built in Rust for high performance and low resource usage

Stop manually copying files and formatting code for LLMs. Code2Prompt handles the tedious work so you can focus on getting insights and solutions from AI models.

Alternative Installation

Refer to the documentation for detailed installation instructions.

Binary releases

Download the latest binary for your OS from Releases.

Source build

Requires:

git clone https://github.com/mufeedvh/code2prompt.git
cd code2prompt/
cargo install --path crates/code2prompt

⭐ Star Gazing

[Star History Chart]

📜 License

Licensed under the MIT License, see LICENSE for more information.

Liked the project?

If you liked the project and found it useful, please give it a :star: !

👥 Contribution

Ways to contribute:

  • Suggest a feature
  • Report a bug
  • Fix something and open a pull request
  • Help me document the code
  • Spread the word
Open the repository ↗