aicoolies logo

code2prompt

CLI tool to convert codebases into LLM-ready prompts

Share
open-sourceOpen Source
Visit Website →

code2prompt is a Rust CLI that converts entire codebases into structured prompts optimized for LLM context windows. It intelligently filters files using gitignore patterns, respects token budgets, generates directory tree visualizations, and supports custom Handlebars templates for output formatting. The tool addresses the core challenge of feeding large codebases to AI coding assistants by producing clean, organized context that maximizes the value of limited token budgets.

code2prompt solves one of the most practical challenges in AI-assisted development: getting relevant codebase context into an LLM prompt without exceeding token limits or drowning the model in irrelevant files. The CLI traverses a project directory, respects gitignore rules and custom exclusion patterns, and assembles the selected files into a structured prompt with directory tree visualization, file contents, and metadata. Token counting against configurable limits helps developers stay within context window budgets for their target model.

The Handlebars template system allows customizing the output format for different use cases. Developers can create templates that emphasize architecture documentation, code review context, bug investigation, or refactoring analysis, each surfacing different aspects of the codebase. Built-in templates cover common scenarios, while the extensible template system accommodates specialized workflows. The Rust implementation ensures fast traversal of large repositories without the startup overhead of interpreted languages.

With over 7,300 GitHub stars and 300+ forks, code2prompt has become a standard tool in the AI coding workflow alongside tools like Repomix. The MIT license enables unrestricted use, and the single-binary distribution means no runtime dependencies to manage. The tool integrates naturally into command pipelines, accepting input from standard repository structures and outputting formatted text that can be piped directly to clipboard managers or LLM API calls.

Pricing

Free and open source under MIT License

Platforms

CLI on macOS, Linux, Windows

Categories

Tags

Use Cases

Alternatives

GStack

Virtual engineering team as Claude Code skills by YC CEO Garry Tan

GStack transforms Claude Code into a structured virtual engineering team through 23 opinionated slash command skills created by Y Combinator CEO Garry Tan. It assigns specialist roles including CEO product review, engineering manager architecture oversight, designer visual audit, QA lead with real browser testing, and release engineer deployment. Each skill enforces focused workflows with clear decision principles for running parallel coding sessions.

open-sourceOpen Source

Everything Claude Code

Agent harness performance system with 30+ agents and 136 skills

Everything Claude Code is a comprehensive agent harness performance optimization system providing 30 specialized agents, 136 skills, 60 commands, and automated hook workflows for AI-assisted development. Born from an Anthropic hackathon winner and evolved over 10+ months of intensive daily use, it works across Claude Code, Codex, Cursor, and OpenCode with built-in security scanning via AgentShield, continuous learning, and research-first development patterns.

open-sourceOpen Source
Embedder logo

Embedder

AI coding agent for embedded systems and firmware engineering

Embedder is a specialized AI coding agent for firmware and embedded systems development. It supports 400+ MCU variants including STM32 and ESP32, parses hardware datasheets to understand register maps and pin configurations, and verifies generated code by interacting with physical boards via serial console. YC S25 participant currently in beta.

api-usage-based

Related Tools

Ghostty logo

Ghostty

Top Pick

Fast, native terminal emulator

GPU-accelerated terminal emulator written in Zig by Mitchell Hashimoto (HashiCorp co-founder). Native UI rendering on macOS and Linux. Supports ligatures, true color, Kitty graphics protocol, and splits/tabs. Configurable via a simple key-value file with sensible defaults. Open-source with 20K+ GitHub stars and a focus on correctness, speed, and minimal resource usage. Growing as a modern alternative to iTerm2, Alacritty, and WezTerm.

open-sourceOpen Source
Claude Code logo

Claude Code

Top Pick

Anthropic's agentic coding CLI

Anthropic's agentic CLI coding tool that delegates complex tasks to Claude directly from the terminal. Understands entire codebases via automatic context gathering, edits multiple files, runs shell commands, and manages Git workflows autonomously. Supports CLAUDE.md for persistent project instructions, integrates with VS Code and JetBrains, and uses Claude Opus/Sonnet with extended thinking for complex architectural decisions. Built for terminal-first developers.

paidOpen Source
Cursor logo

Cursor

Top Pick

The AI-first code editor

AI-first code editor built as a VS Code fork that deeply integrates LLMs into every part of the development workflow. Features Tab autocomplete with multi-line predictions, Cmd+K inline editing, AI chat with full codebase awareness, and Agent mode for autonomous multi-file edits with terminal execution. Supports GPT-4, Claude, and more with automatic context from project files and docs. Includes privacy mode for SOC 2 compliance. The leading AI-native IDE with 100K+ paying users.

freemiumTelemetry
Hermes Agent logo

Hermes Agent

Top Pick

Open-source AI agent framework with persistent memory, reusable skills, tools, and messaging gateways

Hermes Agent is an open-source AI agent framework with persistent memory, reusable skills, 40+ tools, cron jobs, and messaging gateways.

open-sourceOpen Source
pi dev code

Pi

Top Pick

Minimal terminal coding harness

Pi Coding Agent is an MIT-licensed Node.js CLI from earendil-works for building and running coding agents in a local terminal. The current package describes a read/bash/edit/write toolset and session management, while the repo positions Pi as a unified LLM API, agent loop, TUI, and coding-agent CLI. It is best framed as a lean, self-extensible BYO-model toolkit rather than a managed IDE.

open-sourceOpen Source
OpenCode logo

OpenCode

Top Pick

Open-source AI coding agent for the terminal

Open-source terminal-based AI coding agent built in Go by the SST team, with a rich TUI (Bubble Tea) supporting 75+ model providers including OpenAI, Anthropic, Gemini, Bedrock, Groq, and OpenRouter. Features vim-like editing, persistent SQLite sessions, and LSP integration for 40+ languages. Fully free with no vendor lock-in, it has rapidly grown to 95k+ GitHub stars.

open-source

Used in Stacks

Comparisons