AI SDK CPP is a C++20 library that gives applications one interface for sending requests to AI model providers such as OpenAI and Anthropic. C++ developers use it to build AI applications and agents with features including streaming responses, multi-turn conversations, tool calls, and asynchronous tools. The catalogue entries provide rules for projects using the library.
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.
git clone --depth 1 https://github.com/ClickHouse/ai-sdk-cppWrote 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.
[](https://agentmods.dev/rules/clickhouse/ai-sdk-cpp/cpp)<a href="https://agentmods.dev/rules/clickhouse/ai-sdk-cpp/cpp"><img src="https://agentmods.dev/badge/rules/clickhouse/ai-sdk-cpp/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.
<a href="https://agentmods.dev/rules/clickhouse/ai-sdk-cpp/cpp"><img src="https://agentmods.dev/badge/rules/clickhouse/ai-sdk-cpp/cpp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00312 | $0.00312 |
| Opus 5.5 | $0.00125 | $0.00125 |
| Sonnet 5.5 | $0.00062 | $0.00062 |
| Haiku 4.5 | $0.00031 | $0.00031 |
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 13d 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.
What it actually says
- prefer one class per file.
- use Google C++ coding styles.
- make classes immutable as much as possible.
- follow guidelines of effective modern c++.
Name methods (casing, etc) like "is_valid", "stream_text"
Lean on auto. Let the compiler deduce obvious types and keep code DRY.
Use nullptr, never 0 or NULL. A unique keyword prevents overload ambiguities and makes pointer intent explicit.
Express ownership with smart-pointers (std::unique_ptr, std::shared_ptr, std::weak_ptr). Raw pointers say nothing about lifetime.
Move more, copy less. Pass/return by value when cheap-to-move; use std::move to convey transfer of resources.
Mark intent with keywords (const, constexpr, noexcept, override, delete). They document guarantees and enable optimisations.
Prefer brace initialisation. It prevents narrowing, works with std::initializer_list, and unifies syntax.
Capture carefully in lambdas; avoid default capture ([=], [&]). Explicit captures beat accidental lifetime bugs.
Think tasks, not threads. Launch work with std::async, std::future, or std::packaged_task; join or detach thoughtfully.
Use std::atomic for inter-thread data, not volatile. Atomics give ordering guarantees; volatile is for hardware registers.
Emplace instead of insert / push_back. Construct elements in place to avoid extra moves or copies.
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.
- 13d ago First seen · 34 lines · 312 tokens per session scan A 36a7f1d80827
cpp is a cursor rule published in the GitHub repository ClickHouse/ai-sdk-cpp (188 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 312 tokens to every session, about $0.0012 per session on Opus 5.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-10-02.
Other cursor rules, from other repositories
05-web-development
Use the following format for code blocks.
00-persona
Senior TypeScript / React front-end persona & base behaviour.
main-rule
You are an expert in Python, FastAPI, and scalable API development.
c-files
Cursor rule "c-files" from MairwunNx/xi, covering c source and header files rules 🔧, core principles, coding style, naming and formatting.
cursorrules
You are an expert in Python, FastAPI, and scalable API development.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.