c-cpp-analyzer

c-cpp-analyzer is a skill for Claude Code from JuanMarchetto/agent-skills. It costs 62 tokens per session (939 once invoked), scanned A, original, MIT.

A C and C++ code analyzer for planning a move to Rust. It classifies functions by difficulty and identifies pointers, macros, manual memory management, and other migration risks.

In plain words
What is it for?
Use it to inspect C or C++ functions, detect migration obstacles, and map patterns such as error codes, null checks, and malloc/free to possible Rust equivalents.
Why use it?
It shows which parts of an older codebase may be easy, moderate, or hard to migrate, helping teams estimate effort and find unsafe patterns early.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the c-cpp-analyzer plugin — 1 skill shipped together

Good fit Use it to inspect C or C++ functions, detect migration obstacles, and map patterns such as error codes, null checks, and malloc/free to possible Rust equivalents.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/juanmarchetto/agent-skills/c-cpp-analyzer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add JuanMarchetto/agent-skills --skill c-cpp-analyzer
Clone the repo
git clone --depth 1 https://github.com/JuanMarchetto/agent-skills

Made for: Claude Code.

Or install c-cpp-analyzer, the plugin that ships this one along with the rest of its 1 skill.

Wrote 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.

agentmods badge for c-cpp-analyzer

README.md
[![agentmods](https://agentmods.dev/badge/skills/juanmarchetto/agent-skills/c-cpp-analyzer/github.svg)](https://agentmods.dev/skills/juanmarchetto/agent-skills/c-cpp-analyzer)
Your own site
<a href="https://agentmods.dev/skills/juanmarchetto/agent-skills/c-cpp-analyzer"><img src="https://agentmods.dev/badge/skills/juanmarchetto/agent-skills/c-cpp-analyzer/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.

agentmods 80×15 button for c-cpp-analyzer

Your own site · 80×15
<a href="https://agentmods.dev/skills/juanmarchetto/agent-skills/c-cpp-analyzer"><img src="https://agentmods.dev/badge/skills/juanmarchetto/agent-skills/c-cpp-analyzer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 939 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.00939
Opus 5.5 $0.00025 $0.00376
Sonnet 5.5 $0.00012 $0.00188
Haiku 4.5 $0.00006 $0.00094

Measured 1mo ago against content hash 419e40f7248e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

c-cpp-analyzer 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 1mo ago.

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.

skills/c-cpp-analyzer/SKILL.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

C/C++ Analysis for Migration

Difficulty Classification

Uses tree-sitter AST analysis with regex fallback:

  • Easy: Pure functions, simple arithmetic, no pointers, <30 lines
  • Medium: Pointer parameters, simple structs, bounded arrays, malloc with clear ownership
  • Hard: void*, function pointers, unions, goto, complex lifetimes, macro-heavy, coroutines

Hard signals (any 1 → Hard):

  • goto statements
  • union types
  • void* pointers
  • Function pointer callbacks
  • Coroutine patterns (Duff's device, switch-based state machines)
  • setjmp/longjmp

Medium signals (1+ with >30 lines → Medium):

  • Pointer declarations
  • Cast expressions
  • malloc/calloc usage

Pattern Detection

C Pattern Rust Equivalent Difficulty
ptr + len pairs &[T] slices Medium
Error code returns Result<T, E> Easy
NULL checks Option<T> Easy
malloc/free Vec<T>, Box<T> Medium
char* strings &str, String Medium
Manual iteration with pointers .iter(), .enumerate() Medium
goto cleanup Drop trait, ? operator Hard
Global mutable state Function parameters, OnceLock Hard
Bit manipulation Same ops with explicit types Medium
union enum with variants Hard
Function pointers / callbacks Enum dispatch (preferred) or Fn traits Hard
Linked lists (next/prev) Vec<T> (flatten) Medium
Type tag + union (tagged union) enum with data variants Medium-Hard
Recursive data structures enum + Box<T> Medium
Coroutine via switch/case Explicit state machine (match loop) Hard
Printf format strings format!() / println!() macros Easy-Medium
strdup/strcpy .to_string(), .clone() Easy

Size-Based Strategy

LOC Range Strategy Chunking Repair Iters
<800 Single-pass translation No Full (5)
800-2000 Chunked (400 LOC target) Structural (data model first) Full (8 for chunked)
2000+ Chunked (500 LOC target) Structural Reduced (2)
4000+ Consider per-module split split_into_modules() Reduced (2)

Read the full file on GitHub · 81 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 1mo ago First seen · 81 lines · 62 tokens per session scan A 419e40f7248e

Subscribe to this mod's changes

c-cpp-analyzer is a skill published in the GitHub repository JuanMarchetto/agent-skills (5 stars, last pushed 6mo ago), licensed MIT. It adds 62 tokens to every session and 939 once invoked, about $0.0002 per session on Opus 5.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-08-31.

Related

Other skills, from other repositories

omh-rust

This is an OMH rust workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).

rlaope/oh-my-hermes · 74 tokens

rust-learner

Learn Rust language features and crate updates. Use when user asks about Rust version changelog, what's new in Rust, crate updates, Cargo.toml dependencies, tokio/serde/axum features, or any Rust ecosystem questions.

actionbook/actionbook · 51 tokens

memory-safety-patterns

Implement memory-safe programming with RAII, ownership, smart pointers, and resource management across Rust, C++, and C. Use when writing safe systems code, managing resources, or preventing memory bugs.

rmyndharis/antigravity-skills · 45 tokens

Agent Browser Automation

Fast Rust-based headless browser automation CLI with Node.js fallback for AI agents, featuring navigation, clicking, typing, snapshots, and structured commands optimized for agent workflows.

PramodDutta/qaskills · 37 tokens

rust-systems

Build and upgrade Rust services, CLI and systems components with explicit error, async and resource contracts. Use when working on Rust ownership, concurrency, serialization or unsafe boundaries; preserve MSRV and edition compatibility unless their migration is requested.

WrongStack/WrongStack · 49 tokens

agent-rust-expert

Specialist subagent: Rust ownership/borrowing, async Rust, Axum/Actix web frameworks, and WASM specialist. Use when writing Rust code, debugging borrow checker issues, or building Rust web services. Trigger phrases: Rust, borrow checker, ownership, lifetime, Axum, Actix, tokio, async Rust, WASM, wasm-bindgen, cargo…

travisjneuman/.claude · 85 tokens