mufeedvh/code2prompt

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

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 46 minutes ago
Added to GitGenius on September 8th, 2026
Created on March 9th, 2024
Open Issues & Pull Requests: 14 (+0)
GitHub issues: Enabled
Number of forks: 437
Total Stargazers: 7,638 (+1)
Total Subscribers: 43 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 2.8 days
Mean response time: 35.2 days
90th percentile: 119.6 days
Tracked items: 81

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 5% of issues opened in the past year have been closed. Three people close 88% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 3
New in 7 days: 0
Closed in 7 days: 2
Avg open age: 327 days
Stale 30+ days: 3
Stale 90+ days: 2

Recent activity

Opened in 7 days: 0
Closed in 7 days: 2
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • enhancement (17)
  • bug (9)
  • support (9)
  • good first issue (8)
  • question (7)
  • help wanted (5)
  • documentation (4)
  • wontfix (4)

Most active issues this week

Detailed Description

Code2Prompt is a CLI tool that converts a codebase into a single LLM prompt with source tree visualization, prompt templating, and token counting.

The tool solves the problem of preparing codebases for use with large language models by automating context extraction and formatting. It ingests entire codebases and structures them into a single prompt that can be fed to LLMs like ChatGPT or Claude. The approach works by traversing the codebase, building a source tree representation, and formatting the output according to templates while tracking token usage to help users stay within model limits.

Code2Prompt suits developers who need to share codebase context with AI models, whether for manual prompting, building AI agents via Python, or running MCP servers. The tool handles the tedious work of collecting and organizing code snippets into a coherent prompt format. It offers optional features like clipboard integration and an entity-map feature for semantic code navigation that helps agents reduce exploration overhead by providing a compact map of functions and classes before reading source files.

The project shows active development with multiple installation methods supported including Cargo, Homebrew, and pip for Python SDK usage. The tool includes an agent skill for integration with coding agents, allowing them to use code2prompt for repository navigation and scoped context gathering. Documentation and community support are maintained through a website, documentation portal, and Discord community.