Code2Prompt is a command-line tool that collects a codebase and formats it as one prompt containing source context, templates, and token information for a language model. Developers use it to prepare focused repository context for ChatGPT, Claude, coding agents, or programs that call an MCP server. The catalogue entries provide skills and an instruction for installing and using Code2Prompt to navigate repositories and gather scoped context.
Borrowing it
Nothing to install: this file belongs to mufeedvh/code2prompt. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/mufeedvh/code2prompt/main/.agents/skills/code2prompt-conventions/SKILL.mdgit clone --depth 1 https://github.com/mufeedvh/code2promptWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/mufeedvh/code2prompt/code2prompt-conventions)<a href="https://agentmods.dev/skills/mufeedvh/code2prompt/code2prompt-conventions"><img src="https://agentmods.dev/badge/skills/mufeedvh/code2prompt/code2prompt-conventions/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/mufeedvh/code2prompt/code2prompt-conventions"><img src="https://agentmods.dev/badge/skills/mufeedvh/code2prompt/code2prompt-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00020 | $0.00343 |
| Opus 5 | $0.00010 | $0.00171 |
| Sonnet 5 | $0.00004 | $0.00069 |
| Haiku 4.5 | $0.00002 | $0.00034 |
Grade A, and why
code2prompt-conventions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
code2prompt conventions
Before changing an unfamiliar area, read the target code, a nearby example, and relevant tests.
Ownership
code2prompt-core: reusable logic, configuration, files, Git, templates, tokenization, analysis, and sessions.code2prompt: CLI, config precedence, stdout/stderr, clipboard, and TUI model/views/widgets.code2prompt-python: thin PyO3 adapter overcode2prompt-core.website: site and product documentation, not product semantics.
Implement behavior once, in the lowest appropriate layer.
Code2PromptSession coordinates configuration, selection state, and loaded data.
SessionData is the source of truth for loaded codebase and Git results, not for all
session state.
Preserve
- deterministic output where order is visible;
- optional-feature behavior with and without the feature;
- intended fallbacks and useful error context;
- stdout for prompt/data output and stderr for human diagnostics;
- existing public names, defaults, serialized values, CLI behavior, and Python API unless intentionally changed.
Style
- Prefer existing abstractions and dependencies.
- Avoid unrelated refactors.
- Use
Result/?; add context at filesystem, Git, parsing, and rendering boundaries. - Avoid runtime panics for recoverable failures.
- Comments explain why, invariants, compatibility, or non-obvious algorithms.
- Put focused private Rust tests in local
#[cfg(test)] mod tests; use integration tests for public behavior.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 41 lines · 20 tokens per session scan A 0835d03c5fe9
code2prompt-conventions is a skill published in the GitHub repository mufeedvh/code2prompt (7,634 stars, last pushed yesterday), licensed MIT. It adds 20 tokens to every session and 343 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-07.
Other skills, from other repositories
find-traces
Analyze OpenTelemetry distributed traces from Axiom. Use when investigating a trace ID, finding traces by criteria (errors, latency, service), or debugging distributed system issues.
detect-anomalies
Detect anomalies in Axiom datasets using statistical analysis. Use when looking for unusual patterns, volume spikes, outliers, or new error types in observability data.
explore-dataset
Explore an Axiom dataset to understand its schema, fields, volume, and patterns. Use when discovering a new dataset, investigating data structure, or understanding what data is available.
axiom-apl
APL query language reference for Axiom. Provides operators, functions, patterns, and CLI usage. Auto-invoked by specialized Axiom skills when writing or debugging APL queries.
codebase-classification
Classify codebases before modification to choose appropriate development approach.
python-repl
Interactive Python REPL automation with common helpers and best practices.