Aider provides AI pair programming from a terminal for software development tasks.
Code2prompt
code2prompt converts a codebase into one language-model prompt with a source tree, templates, and token counts.

About Code2prompt
Code2Prompt is an open-source, Rust-based command-line tool and associated ecosystem that converts entire codebases into single, structured prompts optimized for large language models. It is hosted publicly on GitHub and includes additional components like a Python SDK and local MCP server for broader integration use cases.
The tool automates the tedious work of gathering, formatting, and contextualizing code for LLM input, with built-in support for .gitignore rule compliance, custom Handlebars templating, token count estimates, and Git metadata inclusion. It supports both minimal CLI usage and an interactive terminal user interface for configuring prompt generation, with output options including stdout, file export, or clipboard copying. It is suited for developers, AI agent builders, and anyone who regularly works with LLMs on code-related tasks, from quick ad-hoc ChatGPT queries to building automated coding agent workflows.
Key features
- Converts entire codebases into single structured LLM prompts
- Respects .gitignore rules for file inclusion and exclusion
- Supports custom Handlebars templates for prompt formatting
- Provides parallel per-file token count estimates
- Includes Git metadata (diffs, logs, branch comparisons) in prompts
- Offers interactive TUI for prompt configuration
- Open-source and free to use
- Built in Rust for high performance and low resource usage
- Offers multiple integration options (CLI, Python SDK, MCP server)
- Eliminates manual work of formatting code for LLM input
- Token count estimates are approximate and exclude the JSON output envelope
Code2prompt at a glance
- Category
- AI & Machine Learning › AI Coding Tools
- Type
- Open-source project
- Pricing
- Not confirmed. Check the site
- Open source
- Yes · Source code
- Language
- English
- Last checked
- Oct 5, 2026 · Online when checked
- Listed
- Oct 5, 2026
Code2prompt alternatives
Tools and sites you could use instead, ranked by how closely they match.
Honey reduces token usage by giving AI coding agents a cross-tool skill for writing less code and prose.
Claude Engineer offers a command-line interface for software development with Anthropic’s Claude model.
Ponytail provides guidance for AI agents to reduce unnecessary coding work.
Langfuse provides open-source tracing and evaluation for language model applications and agents.
This repository collects templates for CLAUDE.md, Cursor rules, and PRPs used with AI coding assistants.
Popular in AI Coding Tools
Well-known listings from the same topic.
Code2prompt FAQ
What is Code2Prompt?
How do I install Code2Prompt?
Does Code2Prompt respect .gitignore rules?
Can I customize the format of generated prompts?
Tell us and an editor will check it.
Claim the listing and suggest updates yourself. An editor checks every claim first.












