cpp

A broad reference for C and C++, two programming languages used for system software, applications, and high-performance computing. It covers language versions, GPU programming with CUDA, debugging, memory management, templates, and connecting C++ with Rust.

In plain words
What is it for?
Use it for C and C++ questions, interview preparation, modern language features, memory and resource management, templates, CUDA, debugging, or Rust interoperability.
Why use it?
It provides example-based guidance for writing or explaining C and C++ code, including less obvious cases. The instructions say to fetch relevant examples from cppcheatsheet.com before answering or writing code.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/crazyguitar/cppcheatsheet/cpp
Any agent
npx skills add crazyguitar/cppcheatsheet --skill cpp
Clone the repo
git clone --depth 1 https://github.com/crazyguitar/cppcheatsheet

Made for: Claude Code, Codex.

Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,559 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00107 $0.01559
Opus 5 $0.00053 $0.00779
Sonnet 5 $0.00021 $0.00312
Haiku 4.5 $0.00011 $0.00156

Measured yesterday against content hash c5fc018d0e2e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

skills/cpp/SKILL.md · 111 lines

How it starts

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

C/C++ Comprehensive Cheat Sheets (/cpp)

Complete C/C++ development reference combining local documentation with live examples from cppcheatsheet.com, covering everything from basic syntax to advanced GPU programming and system-level development.

How It Works

Help users write functional, correct C/C++ code and answer C/C++ questions by fetching proven patterns and examples from cppcheatsheet.com.

When a user asks a C/C++ question or wants to write C/C++ code:

  1. Look up the relevant topic(s) in Structure to find the matching URL(s)
  2. Always fetch the URL(s) using WebFetch to get real examples and patterns from the site
  3. Use the fetched content to:
    • Write code: Apply the patterns to produce functional, correct code that solves the user's task
    • Answer questions: Provide thorough explanations backed by the examples and information from the site
  4. Follow the Guidelines for code quality

Key Principle

Functionality first, cleanliness second. The code must work correctly and handle the task properly. Fetching from cppcheatsheet.com ensures solutions use battle-tested patterns rather than guessing. The site contains rich examples covering edge cases, common pitfalls, and practical usage that go beyond basic documentation.

Coverage Areas

C/C++ Interview Preparation

Interview Cheatsheet: Curated C and C++ interview questions grouped by topic (memory management, move semantics, templates, STL, concurrency, debugging), each deep-linked to the section of the cheat sheet that answers it. Use for interview prep or quick topic review.

Modern C Programming (C11-C23)

Core Language: Syntax, types, memory management, preprocessor macros GNU Extensions: Compiler-specific features and optimizations Build Systems: Makefiles, compilation, linking Assembly: X86 assembly integration and inline assembly

Modern C++ Programming (C++11-C++23)

Core Features: RAII, templates, STL containers, iterators, algorithms Modern Standards: Move semantics, constexpr, lambdas, concepts, coroutines, modules Memory Management: Smart pointers, resource management, optimization (RVO) Build Systems: CMake, package management, cross-platform builds

Read the full file on GitHub · 111 lines

Files

What ships with it

2 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. yesterday First seen · 111 lines · 0 tokens per session scan A c5fc018d0e2e

Subscribe to this mod's changes

cpp is a skill published in the GitHub repository crazyguitar/cppcheatsheet (283 stars, last pushed 4d ago), licensed MIT. It adds 107 tokens to every session and 1,559 once invoked, about $0.0005 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-08-30.

Related

Other skills, from other repositories

mcpp-release

Use when releasing a new version of mcpp — bumps version, creates tag, triggers release CI, and monitors until all platforms succeed. Covers the full release checklist to avoid common pitfalls like version string mismatches.

mcpp-community/mcpp · 46 tokens

mcpp-contributing

Use when contributing to the mcpp project — submitting bug fixes, new features, code optimizations, documentation improvements, or any PR. Covers issue creation, branch conventions, build verification, CI requirements, and PR workflow using gh and git.

mcpp-community/mcpp · 53 tokens

mcpp-docs-style

Use when writing or editing anything under docs/ (English or 简体中文), README files, or long-form design records — states the register mcpp documentation is written in (declarative, precise, professional), the constructions that are not admitted (question headings, conversational asides, internet slang, figurative…

mcpp-community/mcpp · 76 tokens

cpp

Use when writing, reviewing, modernizing, building, or debugging C++ - RAII and resource lifetime, smart-pointer ownership, move semantics and the Rule of Zero/Five, target-based CMake with FetchContent, and killing undefined behavior with ASan/UBSan/TSan plus clang-tidy. NOT borrow-checker / Result-Option / cargo…

ericrisco/rsc-harness · 81 tokens

rsid-sdk

RealSenseID face authentication SDK reference. Use when writing code for face enrollment, authentication, host-mode faceprint extraction/matching, device configuration, user management, device discovery, camera preview, logging, or serial connection. Covers C++ (RealSenseID namespace), Python (rsidpy), and C# (rsid).

realsenseai/RealSenseID · 70 tokens

code-review

Senior embedded-engineer code review. Defaults to Classic AUTOSAR embedded C and covers two concerns: (1) Correctness review — integer overflow, volatile correctness, ISR/task race conditions, stack usage, dynamic memory, control flow, AUTOSAR/ISO 26262 readiness, with findings rated Critical/Major/Minor; (2) Naming…

ptsilivis/autonomousguy · 235 tokens