cpp

cpp is a skill for Claude Code, Codex from nimadorostkar/Claude-Skills-collection. It costs 38 tokens per session (959 once invoked), scanned A, original, MIT.

A guide for writing modern C++ using versions 17, 20, or 23. It focuses on clear resource ownership, safe memory use, and current language features.

In plain words
What is it for?
Use it when writing or reviewing C++, modernising older code, designing value types, debugging memory problems, or optimising performance-sensitive code.
Why use it?
It helps find memory leaks, invalid memory access, data races, and unclear ownership caused by manual cleanup or unsafe pointer use.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when writing or reviewing C++, modernising older code, designing value types, debugging memory problems, or optimising performance-sensitive code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nimadorostkar/claude-skills-collection/cpp
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 nimadorostkar/Claude-Skills-collection --skill cpp
Clone the repo
git clone --depth 1 https://github.com/nimadorostkar/Claude-Skills-collection

Made for: Claude Code, Codex.

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 cpp

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/cpp"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/cpp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 959 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00038 $0.00959
Opus 5 $0.00019 $0.00479
Sonnet 5 $0.00008 $0.00192
Haiku 4.5 $0.00004 $0.00096

Measured 5d ago against content hash aa6fe2e0eaf8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

cpp 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 5d 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/languages/cpp/SKILL.md · 108 lines

How it starts

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

C++

Purpose

Write C++ where resources are owned by objects, ownership is visible in the type, and undefined behavior is actively hunted with tooling rather than hoped away.

When to Use

  • Writing or reviewing C++17 and later.
  • Modernizing code that uses raw new/delete or manual resource cleanup.
  • Diagnosing memory corruption, leaks, or data races.
  • Designing value types with correct copy/move semantics.
  • Optimizing hot paths where allocation or copying dominates.

Capabilities

  • RAII and ownership modeling with unique_ptr, shared_ptr, and value semantics.
  • Move semantics, the rule of zero/five, and copy elision.
  • Ranges, views, and algorithm composition.
  • Concepts for constrained templates and readable errors.
  • Sanitizer-driven debugging: ASan, UBSan, TSan.

Inputs

  • Source, build system (CMake preferred), and target standard.
  • Platform and toolchain constraints.
  • Performance budget for hot paths.

Outputs

  • Code with no raw owning pointers and no manual delete.
  • A CMake configuration with warnings-as-errors and sanitizer build types.
  • Benchmarks for any change justified on performance grounds.

Workflow

  1. Establish ownership — Every resource has exactly one owner. Express it in the type: value, unique_ptr, or a documented non-owning T*/span.
  2. Apply the rule of zero — If a class needs a destructor, it probably should not also hold business logic.
  3. Constrain templates — Use concepts; unconstrained templates produce unreadable errors and accept nonsense.
  4. Sanitize — Build and run the test suite under ASan+UBSan, then TSan separately.
  5. Measure before optimizing — Profile, change one thing, benchmark again.

Best Practices

  • Prefer values and references. Reach for shared_ptr only when ownership is genuinely shared — it is not a default.
  • Pass by const& for large read-only inputs; pass by value and std::move when you intend to store.
  • Never return a reference or string_view to a temporary. This is the most common lifetime bug in modern C++.
  • Compile with -Wall -Wextra -Wpedantic -Werror. Warnings in C++ are usually latent bugs.
  • Use std::span instead of pointer+length parameter pairs.
  • Mark single-argument constructors explicit unless implicit conversion is genuinely desired.

Read the full file on GitHub · 108 lines

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. 5d ago First seen · 108 lines · 38 tokens per session scan A aa6fe2e0eaf8

Subscribe to this mod's changes

cpp is a skill published in the GitHub repository nimadorostkar/Claude-Skills-collection (26 stars, last pushed 21d ago), licensed MIT. It adds 38 tokens to every session and 959 once invoked, about $0.0002 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-03.

Related

Other skills, from other repositories

cpp-pro

Writes, optimizes, and debugs C++ applications using modern C++20/23 features, template metaprogramming, and high-performance systems techniques. Use when building or refactoring C++ code requiring concepts, ranges, coroutines, SIMD optimization, or careful memory management — or when addressing performance…

Jeffallan/claude-skills · 79 tokens

cpp-sanitizers

Use in C/C++ projects for crashes, hangs, UB, data races, memory errors. ASan/UBSan/TSan runtime checks. Build sanitizer config separately.

Redtropig/harness-anchor · 40 tokens

go-logging

Use when choosing a Go logger, configuring slog, writing structured log statements, picking log levels, or attaching request-scoped fields. Apply proactively whenever code calls log/fmt to emit operational information, migrates off log/logrus/zap/zerolog, or sets up production logging. Covers structured logging only …

muratmirgun/gophers · 83 tokens

gdb

Debug and trace C/C++/Rust programs with the GNU Debugger (GDB) without blocking the agent. Use when you need to set tracepoints, inspect variables, or monitor a running process while staying responsive to the user.

betab0t/skills · 50 tokens

dotnet-pinvoke

Correctly call native (C/C++) libraries from .NET using P/Invoke and LibraryImport. Covers function signatures, string marshalling, memory lifetime, SafeHandle, and cross-platform patterns. USE FOR: writing new P/Invoke or LibraryImport declarations, reviewing or debugging existing native interop code, wrapping a C or…

managedcode/dotnet-skills · 119 tokens

asm-performance

Assembly performance optimization workflow: collect compiler-emitted ASM, classify bottlenecks with TMA, audit for codegen issues (bounds checks, register spills, dependency chains, missed vectorization, memory traffic, bad instruction selection, store-forwarding stalls, frontend pressure, data layout), apply one…

AeonDave/malskill · 81 tokens