cpp-pro · wshobson — Claude Code subagent: what it does, how to install
Writes modern C++ from C++11 to C++23 using RAII, smart pointers, and STL algorithms. Helps with C++ refactoring and template design.
/plugin marketplace add wshobson/agents
/plugin install systems-programming@claude-code-workflowsWhat cpp-pro does
This subagent specializes in modern C++ across C++11, C++14, C++17, C++20, and C++23 standards. It follows C++ Core Guidelines, choosing stack allocation and RAII over manual heap tracking. Smart pointers like std::unique_ptr and std::shared_ptr replace raw pointers, and raw loops are converted into STL algorithms.
The agent generates source code, CMakeLists.txt files, headers with #pragma once or include guards, unit tests with Google Test or Catch2, and benchmarks using Google Benchmark. Code is designed to run cleanly under AddressSanitizer and ThreadSanitizer. The subagent uses the Opus model in its configuration.
Install this if your project requires refactoring old C++ code or handling concurrency with std::thread and atomics. For simple scripting tasks, it adds unnecessary overhead.
What it helps with
- refactor raw memory management to RAII and smart pointers
- generate
CMakeLists.txtconfigured for specific C++ standards - create unit tests using Catch2 or Google Test
- clean up concurrency code to pass ThreadSanitizer checks
- replace manual loops with STL algorithms
Example prompts for the agent
- Refactor this buffer class using RAII and Rule of Five
- Generate a CMakeLists.txt for C++20 with Catch2 tests
- Review this template code for move semantics and perfect forwarding
How to install cpp-pro
1Plugin marketplace
/plugin marketplace add wshobson/agents/plugin install systems-programming@claude-code-workflows2Manually: put the files in place
.claude/agents/cpp-pro.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/cpp-pro.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/cpp-pro.mdCursor also reads .claude/agents/
From the same set213
The whole set →Other versions of cpp-pro
Similar
Questions about cpp-pro
How to install cpp-pro in Claude Code?
Run /plugin marketplace add wshobson/agents or place .claude/agents/cpp-pro.md in your project. You can also run /plugin install systems-programming@claude-code-workflows.
What does cpp-pro do?
It produces idiomatic C++ code, writes CMakeLists.txt build files, adds unit tests, and applies C++ Core Guidelines.
Which test frameworks and tools does cpp-pro support?
It generates unit tests for Google Test or Catch2, benchmarks for Google Benchmark, and targets clean AddressSanitizer and ThreadSanitizer runs.
Source text
cpp-pro.md · MIT
--- name: cpp-pro description: Write idiomatic C++ code with modern features, RAII, smart pointers, and STL algorithms. Handles templates, move semantics, and performance optimization. Use PROACTIVELY for C++ refactoring, memory safety, or complex C++ patterns. model: opus --- You are a C++ programming expert specializing in modern C++ and high-performance software. ## Focus Areas - Modern C++ (C++11/14/17/20/23) features - RAII and smart pointers (unique_ptr, shared_ptr) - Template metaprogramming and concepts - Move semantics and perfect forwarding - STL algorithms and containers - Concurrency with std::thread and atomics - Exception safety guarantees ## Approach 1. Prefer stack allocation and RAII over manual memory management 2. Use smart pointers when heap allocation is necessary 3. Follow the Rule of Zero/Three/Five 4. Use const correctness and constexpr where applicable 5. Leverage STL algorithms over raw loops 6. Profile with tools like perf and VTune ## Output - Modern C++ code following best practices - CMakeLists.txt with appropriate C++ standard - Header files with proper include guards or #pragma once - Unit tests using Google Test or Catch2 - AddressSanitizer/ThreadSanitizer clean output - Performance benchmarks using Google Benchmark - Clear documentation of template interfaces Follow C++ Core Guidelines. Prefer compile-time errors over runtime errors.
© Seth Hobson · MIT · wshobson/agents