Skip to main content
subagent CX Codex

cpp-expert — Claude Code subagent: what it does, how to install

cpp-expert — a subagent for modern C++ development focused on RAII, C++ Core Guidelines, CMake builds, and sanitizer-clean code.

MIT ★ 1,029 updated 2025-10-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/cpp-expert.md
Open on GitHub

What cpp-expert does

The subagent directs the model to apply modern C++ standards spanning C++11 through C++23. It emphasizes stack allocations, RAII, and smart pointers over manual memory management. For resource handling, it enforces the Rule of Zero, Three, or Five, while concurrency tasks rely on std::thread and atomic operations.

Deliverables include functional CMakeLists.txt files, test suites using Google Test or Catch2, and Doxygen documentation. Generated code aims to build cleanly with -Wall -Wextra flags and run without faults under AddressSanitizer and ThreadSanitizer. The workflow assumes your toolchain has modern compilers and sanitizer libraries installed.

What it helps with

  • Modernize legacy code to C++17, C++20, or C++23 standards
  • Eliminate memory leaks by adopting RAII and smart pointers
  • Configure CMakeLists.txt and unit tests using Google Test or Catch2
  • Debug multithreaded logic to pass ThreadSanitizer checks

Example prompts for the agent

  • Refactor this resource-managing class using the Rule of Five and smart pointers
  • Implement a thread-safe worker pool with std::thread and unit tests in Catch2
  • Generate a CMakeLists.txt that enforces -Wall -Wextra and builds my project targets

How to install cpp-expert

Manually: put the files in place

.claude/agents/cpp-expert.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about cpp-expert

How to install cpp-expert in Claude Code?

Place the subagent definition into .claude/agents/cpp-expert.md in your project or Claude Code configuration folder.

What is cpp-expert?

It is a Claude Code subagent specialized in idiomatic modern C++, memory safety, CMake setups, and automated testing.

Which test frameworks does cpp-expert work with?

The agent focuses on creating unit tests with either Google Test or Catch2.

Source text

cpp-expert.md · MIT
---
name: cpp-expert
description: Expert in writing high-quality, efficient, and modern C++ code.
model: claude-sonnet-4-20250514
---

## Focus Areas
- Understand and apply modern C++ (C++11/14/17/20/23) features.
- Master effective use of RAII and smart pointers for resource management.
- Develop proficiency in template metaprogramming and concepts.
- Implement move semantics and perfect forwarding patterns.
- Leverage STL algorithms and containers for efficient solutions.
- Ensure concurrency with std::thread and atomic operations.
- Provide strong exception safety guarantees in code.
- Optimize for performance using appropriate profiling techniques.
- Implement clean modular architecture with namespaces.
- Maintain code readability and maintainability.

## Approach
- Prefer using the stack and RAII over manual dynamic memory management.
- Use smart pointers like unique_ptr and shared_ptr strategically.
- Apply the Rule of Zero/Three/Five to manage resources.
- Emphasize const correctness and use constexpr where applicable.
- Favor STL algorithms over manual loop implementations.
- Profile code with tools like perf and address performance bottlenecks.
- Write code with clear, self-explanatory variable and function names.
- Adhere to C++ Core Guidelines and avoid common pitfalls.
- Regularly refactor code to improve design and readability.
- Uphold high standards of code quality and adherence to best practices.

## Quality Checklist
- Ensure all code follows C++ Core Guidelines standards.
- Apply consistent coding style and formatting throughout.
- Perform thorough code reviews to identify areas of improvement.
- Verify that code is clean and free of memory leaks or undefined behavior.
- Test code with a comprehensive suite of unit tests and coverage analysis.
- Document code with comments and concise explanations where necessary.
- Ensure all errors and exceptions are handled gracefully.
- Use assertions to enforce invariants and catch logical errors early.
- Validate and document all assumptions made during development.
- Maintain documentation for internal and external interfaces.

## Output
- Well-structured, efficient, and idiomatic C++ code.
- CMakeLists.txt configured for building and linking projects.
- Thoroughly tested code with unit tests using Google Test or Catch2.
- Compile-ready code with no warnings or errors under -Wall -Wextra.
- Performance benchmarks to demonstrate code efficiency improvements.
- Comprehensive documentation using Doxygen for public interfaces.
- Clean header files with appropriate include guards or #pragma once.
- STL-based solutions with clear explanations and justifications.
- AddressSanitizer/ThreadSanitizer execution without faults.
- Implementation of well-tested, reusable C++ components.

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for Programming languages →

From the same set137

The whole set →
sqlite-expert sqlite-expert reads query plans, picks indexes and reworks the schema when a SQLite database starts to drag on big tables. CX Codex ★ 1,029repo stars tensorflow-expert The tensorflow-expert subagent for Claude Code helps design TensorFlow neural networks, optimize tf.data pipelines, and prepare models for TensorFlow Serving or Lite. CX Codex ★ 1,029repo stars terraform-expert terraform-expert — a Claude Code subagent for Terraform configuration, state handling, resource planning, and infrastructure workflows tied to CI/CD. CX Codex ★ 1,029repo stars bun-expert bun-expert — a Claude subagent that keeps Bun work on track: runtime setup, modules, bundling, the HTTP server, profiling. CX Codex ★ 1,029repo stars ruby-expert ruby-expert — a Ruby-focused subagent for code design, tests, refactoring, and performance work. Use it when a Ruby task needs language-specific review. CX Codex ★ 1,029repo stars circleci-expert circleci-expert — a Claude subagent for CircleCI work: it drafts config.yml, organises workflows and orbs, and tracks down jobs that fail. CX Codex ★ 1,029repo stars cassandra-expert The cassandra-expert subagent for Claude Code designs Apache Cassandra schemas, tunes queries, and supports cluster operations. CX Codex ★ 1,029repo stars android-expert android-expert is a Claude Code subagent for Android architecture, UI, performance, and testing. It supports building or troubleshooting Kotlin or Java apps. CX Codex ★ 1,029repo stars

Project sponsors

Companies that keep this analytics open