mufeedvh/code2prompt
65.9
Adequate · 29 September 2026
9.7k
lines of production code
Rust
primary language
2
measurements over time
What this system is
Code2Prompt is a tool that converts codebases into structured prompts for LLMs, supporting CLI, Python SDK, and MCP server interfaces. It intelligently processes various file types, including code, notebooks, and data formats, to optimize token usage while providing detailed code maps and statistics. The system features a reactive terminal UI for interactive file selection and template management, alongside comprehensive documentation and testing infrastructure.
Features
Added code2prompt skill for efficient codebase exploration
A new 'code2prompt' skill has been added to the skills directory, providing instructions for using the code2prompt CLI to explore codebases efficiently. The skill includes a template (code-map.hbs) for generating structured entity maps and guides users on installing the CLI, mapping unfamiliar areas, and reading selected context together to reduce agent round trips.
skills · high confidence
Added example projects for history notes, recipes, and Node.js apps
The website now includes three new example project structures in the assets library: history notes (covering medieval, renaissance, and WWII topics with revision goals), a recipe manager (with pantry ingredients and recipes for pasta, pizza, salad, and soup), and a basic Node.js application (processing JSON user data). Each example includes source files, prompts, and question definitions to demonstrate content organization and code processing capabilities.
website/src/assets/examples · high confidence
Initial Astro site structure with base and blog layouts
The website now uses Astro, introducing a BaseLayout that sets up the global HTML shell, metadata, favicon, sitemap link, and includes jQuery and Prism.js for syntax highlighting. A new BlogPostLayout provides a styled template for individual blog posts, displaying the title, date, author, and description while rendering post content with prose styling.
website/src/layouts · high confidence
Initial project scaffolding and documentation
This change establishes the initial structure of the code2prompt project. It introduces a default configuration file (.c2pconfig) with settings for output, file patterns, and user variables, alongside an AGENTS.md guide defining contributor rules and verification skills. The repository is populated with comprehensive documentation, including a main README.md (with English and Spanish versions) detailing installation via Cargo, Homebrew, and pip, as well as usage for the CLI, Python SDK, and MCP server. Additionally, an MCP server installation guide (llms-install.md) and an expanded .gitignore covering multiple operating systems and build artifacts are added.
(repo-wide) · high confidence
Initial website landing page with Astro components
The website now features a new landing page built with Astro, including a Header with a scroll indicator, a Footer, and several content sections (Section0 through Section4) that explain Code2Prompt's features, usage (CLI, SDK, MCP), and community links. The page uses Tailwind CSS for styling and includes dynamic example loading in Section0.
website/src/components · high confidence
Initial website public assets and syntax highlighting theme
The website now includes its core public assets, establishing the brand identity with a CNAME file for code2prompt.dev and a new SVG favicon. Additionally, syntax highlighting for code blocks is enabled via a new Prism.js CSS file, applying the 'atom-dark' theme to style code snippets with specific colors for keywords, comments, and strings.
website/public · high confidence
Intelligent file processing for CSV, TSV, JSONL, and Jupyter Notebooks
The file processor module now extracts structured schemas and samples instead of raw content for CSV, TSV, JSONL, and Jupyter Notebook files to optimize LLM token usage. CSV and TSV processors extract column headers and one sample row, while JSONL processors extract field names and one sample line. Jupyter Notebook processing is configurable, allowing users to set the maximum number of code cells to include, and to optionally include cell outputs and markdown cells. A default text processor handles other file types using encoding detection via chardetng.
_crates/code2prompt-core/src/file\processor · high confidence
Introduce entity-level code maps and configurable file processors
The core library now supports extracting structural entities (functions, classes, methods) from source files via the optional \entity-map\ feature, exposing them to templates as \FileEntry.entities\ and a top-level \code\_map\ for compact codebase outlines. Additionally, file-type processors (such as for Jupyter notebooks) are now configurable through \FileProcessorsConfig\, allowing users to customize how specific file types are handled during prompt generation.
crates/code2prompt-core/src · high confidence
Introduce native Python bindings for code2prompt
This change adds the \code2prompt-python\ crate, providing native Python bindings for the \code2prompt\_core\ Rust library. Users can now install the \code2prompt\_rs\ package via pip to interact with the core API using a session-based model (\Code2PromptSession\) that supports file selection, pattern matching, and prompt generation. The bindings expose configuration options such as output format, tokenization, and file processing, and are compatible with Python 3.11 and newer.
crates/code2prompt-python · high confidence
Introduce template editing UI with validation and variable management
The template widget area now provides a dedicated interface for managing templates, featuring a three-column layout that includes a template editor with syntax validation (highlighting errors and missing variables), a variable manager for viewing and editing system and user-defined variables, and a picker for selecting between default and custom templates. This change adds the \TemplateWidget\ and its sub-components (\TemplateEditorWidget\, \TemplateVariableWidget\, \TemplatePickerWidget\) to handle the full lifecycle of template creation and configuration within the application.
crates/code2prompt/src/widgets/template · high confidence
Introduces a reactive template editor with variable management and picker
The template editing workflow in the TUI has been restructured into a reactive, multi-panel interface. Users can now edit template content with real-time syntax validation (checking for balanced braces and valid Handlebars syntax), automatically detect template variables, and manage them via a dedicated variable panel that distinguishes between system, user-defined, and missing variables. A new template picker allows selection from built-in defaults or custom user files, with the editor state automatically syncing variables when templates change or are loaded.
crates/code2prompt/src/model/template · high confidence
New TUI widget components for file selection, output, settings, and statistics
The application now includes a dedicated widgets module providing a complete terminal user interface (TUI) using Ratatui. Users can navigate and select files via a tree view with search and filter patterns, view generated prompts with scrolling and copy/save options, adjust configuration settings through a grouped list interface, and analyze code statistics via overview, extension-based histograms, and token distribution maps. These components replace previous state management approaches by reading directly from the central Model, ensuring a consistent and interactive experience for code analysis tasks.
crates/code2prompt/src/widgets · high confidence
New statistics view with navigation and aggregation
The TUI now includes a dedicated Statistics tab that lets users cycle through three views—Overview, Token Map, and Extensions—using next/prev navigation. The Overview view shows selected and total file counts, while the Extensions view displays token distribution aggregated by file extension, sourced from the codebase analysis.
crates/code2prompt/src/model/statistics · high confidence
Python SDK exposes code analysis configuration and formatting options
The Python SDK now provides Python-native classes for configuring code analysis behavior, including \IpynbProcessorConfig\ to control Jupyter notebook processing (max code cells, output inclusion, markdown inclusion) and configuration for output formats (Markdown, JSON, XML), tokenizers, token formats, and file sorting methods.
crates/code2prompt-python/src · high confidence
Website assets updated with new SVGs and marquee styles
The website's public assets now include new SVG images for AI providers (Claude, Deepseek, Gemini, Groq, Mistral, Ollama, OpenAI, Qwen) and an architecture diagram, alongside new CSS for a scrolling marquee component and overlay images.
website/public/assets · high confidence
Behavioural changes
Centralized TUI display formatting logic
The view layer has been refactored to consolidate all formatting and display logic into a dedicated module, separating it from the model and widgets. This change introduces a new \formatters\ module that provides pure functions for generating display structures, such as organizing settings into groups (Output Format, Sorting & Organization, Tokenizer & Encoding, Git Integration, File Selection) and mapping configuration values to their UI representations. Users benefit from a cleaner separation of concerns, which improves maintainability and ensures that display logic is isolated from business logic.
crates/code2prompt/src/view · high confidence
Introduces Elm-style command system and refactors TUI state management
The application's terminal UI now uses a pure Model-View-Update architecture where side effects (like running analysis, copying to clipboard, saving files, or refreshing the file tree) are handled via a new \Cmd\ enum rather than direct mutations. This change introduces a centralized \Model\ struct and a comprehensive \Message\ enum to manage state transitions for tabs, file tree navigation, settings, and template editing. The file tree display has been refactored to use a hierarchical \DisplayFileNode\ structure that respects gitignore patterns and supports search mode, while settings are now managed through a typed \SettingKey\ enum that allows toggling options like line numbers, output format, and tokenizer type.
crates/code2prompt/src/model · high confidence
Introduces unified configuration layering and Linux clipboard persistence
The code2prompt CLI now supports loading settings from local (.c2pconfig) and global (\~/.config/code2prompt/.c2pconfig) TOML files, with command-line arguments overriding config file values to provide a consistent, layered configuration experience. On Linux, the tool now spawns a background clipboard daemon to ensure generated prompts remain in the system clipboard after the application exits, resolving previous issues where clipboard content was lost. Additionally, the TUI now allows users to start with all files deselected via the new --deselected flag, and the CLI provides a visual token map to display file token usage hierarchically.
crates/code2prompt/src · high confidence
Website migrated to Astro with Starlight documentation theme
The website has been rebuilt using Astro and the Starlight documentation theme, replacing the previous implementation. This change introduces a new static site generation workflow, enabling multi-language support for English, French, German, Spanish, Chinese, Japanese, and Russian. The new site includes a blog feature via the Starlight Blog plugin, mathematical rendering support, and a structured sidebar navigation for tutorials, explanations, and how-to guides. Configuration files for pnpm, TypeScript, and Astro have been added to support this new stack.
website · high confidence
Test coverage
Added comprehensive integration and unit tests for code2prompt; Added comprehensive test coverage for code2prompt-core; Initial test suite for Python bindings.
Dependencies
Initial dependency lockfiles and manifest definitions for code2prompt v4.3.0
This change introduces the initial dependency management files for the code2prompt project, establishing the v4.3.0 release baseline. It adds \Cargo.lock\ and \Cargo.toml\ files for the Rust workspace (including \code2prompt-core\, \code2prompt\, and \code2prompt-python\ crates) and \package.json\ and \pnpm-lock.yaml\ for the Astro-based website. These files define the specific versions of core dependencies such as \clap\, \ratatui\, \pyo3\, \astro\, and \tailwindcss\, ensuring reproducible builds for both the CLI tool and the documentation site.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 64 → 66 (+1.9)
- Rubric changed (rubric-2026.09.9 → rubric-2026.09.17) — scores are not directly comparable.
Lenses
- Code Health 83 → 83 (+0.0)
- Architecture 99 → 95 (-3.2)
- Maturity 68 → 68 (+0.0)
- Readiness 56 → 56 (+0.9)
- Security 63 → 70 (+7.5)
- Performance 100 (new)
Resolved (4)
- Documentation: no installation or build instructions (README.md)
- Edited copy of a member (25 corresponding lines) (crates/code2prompt-core/src/git.rs)
- Hotspot: crates/code2prompt-core/src/file_processor/ipynb.rs (crates/code2prompt-core/src/file_processor/ipynb.rs)
- Members sharing a duplicated core (4 members, 50+ identical tokens) (crates/code2prompt/src/model/mod.rs)
New (12)
- Ambiguous prompt generation flow. 'generate_prompt' likely calls 'render_prompt' internally, but both are exposed. It is unclear if 'generate_prompt' does additional processing (e.g., token counting, validation) or if they are interchangeable. This creates confusion about the correct entry point for prompt generation.
- Coverage not measured — JavaScript/TypeScript suite
- Documentation: no project overview (README.md)
- Duplicate selection logic across Session and SelectionEngine. The Session type exposes low-level selection mutation methods (select_file, deselect_file, toggle_file_selection) that directly mirror the methods on the internal SelectionEngine. This violates encapsulation and creates two entry points for the same state change.
- Edited copy of a member (25 corresponding lines) (crates/code2prompt-core/src/git.rs)
- Fragmented template loading. 'utils.load_all_templates' suggests a general utility for loading templates, while 'BuiltinTemplates' is a specific type for built-in ones. It is unclear if 'utils.load_all_templates' loads both built-in and custom templates, or just built-in, creating confusion about the source of templates.
- Inconsistent initialization paths. TemplateState can be initialized from either a Session or a Model. Since Model contains a Session, this creates redundant ways to achieve the same result. It is unclear why one would use one over the other, leading to potential state desynchronization if the underlying data differs.
- Inverted test pyramid
- Members sharing a duplicated core (4 members, 50+ identical tokens) (crates/code2prompt/src/model/mod.rs)
- Off the main sequence: code2prompt_core
- Redundant Git operations. The Session type exposes specific Git loading methods that duplicate the functionality of the git module functions. This creates a confusing API where users can either call Session.load_git_diff() or git.get_git_diff(), leading to inconsistent usage patterns.
- Test suite declares a test script but contains no test files: website/
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
mufeedvh/code2prompt was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 29 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 66585136062c04275ddd5a01c5518a4d78c4aa76 — the exact code this score is about.
- Scored under rubric-2026.09.17 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-705631bb727e.