cpp

cpp is a skill for Claude Code, Codex from G1Joshi/Agent-Skills. It costs 28 tokens per session (997 once invoked), scanned A, original, MIT.

A modern C++ programming guide covering C++17, C++20, and C++23, the standard library, memory ownership, and performance-focused code.

In plain words
What is it for?
Use it when working on .cpp or .hpp files, systems and embedded software, Unreal Engine games, or other performance-critical applications.
Why use it?
It helps avoid common memory-management errors and shows current ways to write C++ safely and efficiently.

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/g1joshi/agent-skills/cpp
Any agent
npx skills add G1Joshi/Agent-Skills --skill cpp
Clone the repo
git clone --depth 1 https://github.com/G1Joshi/Agent-Skills

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/g1joshi/agent-skills/cpp.svg)](https://agentmods.dev/skills/g1joshi/agent-skills/cpp)
Your own site
<a href="https://agentmods.dev/skills/g1joshi/agent-skills/cpp"><img src="https://agentmods.dev/badge/skills/g1joshi/agent-skills/cpp.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 997 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.00028 $0.00997
Opus 5 $0.00014 $0.00498
Sonnet 5 $0.00006 $0.00199
Haiku 4.5 $0.00003 $0.00100

Measured yesterday against content hash 45310abdf065, 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/languages/cpp/SKILL.md · 177 lines

How it starts

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

C++

Modern C++ development with smart pointers, RAII, and performance optimization.

When to Use

  • Working with .cpp or .hpp files
  • Systems programming and embedded
  • Game development with Unreal Engine
  • Performance-critical applications

Quick Start

#include <memory>
#include <string>
#include <vector>

class User {
public:
    User(std::string name, std::string email)
        : name_(std::move(name)), email_(std::move(email)) {}

    const std::string& name() const { return name_; }
    const std::string& email() const { return email_; }

private:
    std::string name_;
    std::string email_;
};

auto user = std::make_unique<User>("John", "[email protected]");

Core Concepts

Smart Pointers

// unique_ptr - exclusive ownership
auto user = std::make_unique<User>("John");

// shared_ptr - shared ownership
auto shared = std::make_shared<Resource>();
auto copy = shared;  // ref count increases

// weak_ptr - non-owning observer
std::weak_ptr<Resource> observer = shared;
if (auto locked = observer.lock()) {
    // safe to use
}

// Never use raw new/delete for ownership

Move Semantics

class Buffer {
public:
    Buffer(size_t size) : data_(new char[size]), size_(size) {}

    // Move constructor
    Buffer(Buffer&& other) noexcept
        : data_(other.data_), size_(other.size_) {
        other.data_ = nullptr;
        other.size_ = 0;
    }

    // Move assignment
    Buffer& operator=(Buffer&& other) noexcept {
        if (this != &other) {
            delete[] data_;
            data_ = other.data_;
            size_ = other.size_;
            other.data_ = nullptr;
            other.size_ = 0;
        }
        return *this;
    }

    ~Buffer() { delete[] data_; }

private:
    char* data_;
    size_t size_;
};

Common Patterns

Modern C++ Features

// Structured bindings (C++17)
auto [name, age] = std::make_pair("John", 25);
for (const auto& [key, value] : map) { /* ... */ }

// std::optional (C++17)
std::optional<User> findUser(int id) {
    if (exists) return User{...};
    return std::nullopt;
}

// Concepts (C++20)
template<typename T>
concept Numeric = std::is_arithmetic_v<T>;

template<Numeric T>
T add(T a, T b) { return a + b; }

// Ranges (C++20)
auto result = numbers
    | std::views::filter([](int n) { return n % 2 == 0; })
    | std::views::transform([](int n) { return n * 2; });

Read the full file on GitHub · 177 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. yesterday First seen · 177 lines · 28 tokens per session scan A 45310abdf065

Subscribe to this mod's changes

cpp is a skill published in the GitHub repository G1Joshi/Agent-Skills (12 stars, last pushed 6mo ago), licensed MIT. It adds 28 tokens to every session and 997 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-03.

Related

Other skills, from other repositories

unreal-engine-cpp-blueprints

Production guidance for Unreal Engine C++ and Blueprints hybrid architecture, UObject memory management, Unreal Smart Pointers, Gameplay Ability System (GAS), Subsystems, Task Graph multithreading, and performance optimization.

hamzabellouch/agent-skills · 50 tokens

unreal-cpp-gameplay

Write Unreal Engine 5 C++ gameplay code: the UCLASS/UPROPERTY/UFUNCTION reflection macros, the Gameplay Framework (GameMode, Pawn, Character, PlayerController, Actor components), and the module Build.cs. Use when writing or debugging UE C++, deriving from AActor/ACharacter/ AGameModeBase, exposing properties to the…

gamedev-skills/awesome-gamedev-agent-skills · 105 tokens

unreal-live-coding

Trigger Live Coding compilation via UCP. Use when the user asks to recompile C++ code, trigger live coding, hot reload C++ changes, or check compilation status in Unreal Engine.

Italink/UnrealClientProtocol · 44 tokens

unity-csharp-architecture-and-ecs

Architectural patterns, Data-Oriented Technology Stack (DOTS), Unity ECS, Burst Compiler, C# Job System, memory management, zero-allocation C# patterns, and frame-budget optimization for high-performance Unity game development.

hamzabellouch/agent-skills · 54 tokens

esp32-arduino-embedded-c

Guidance for production-grade ESP32 Arduino and Embedded C/C++ development. Use when building firmware for ESP32, ESP32-S3, or ESP32-C3 microcontrollers, optimizing FreeRTOS tasks, managing SRAM/PSRAM, writing ISR-safe code, or handling dual-core concurrency and hardware peripherals.

hamzabellouch/agent-skills · 71 tokens

godot-gdscript-patterns

Enterprise architecture patterns for Godot Engine 4.x using GDScript and C#, Node tree composition, Custom Resources, Signal Bus patterns, Direct Server APIs (PhysicsServer, RenderingServer), memory management, and performance profiling.

hamzabellouch/agent-skills · 53 tokens