claude-sdk-integration

claude-sdk-integration is a skill for Claude Code, Codex from kouroshez/coding-os. It costs 130 tokens per session (1,620 once invoked), scanned A, original, Apache-2.0.

Guidance for writing Python code that connects to Anthropic's Claude services and starts Claude Code sub-sessions. It covers both direct API calls and the higher-level agent SDK.

In plain words
What is it for?
Use it when changing the Claude adapter, the code that launches Claude sub-sessions, or the pipeline that builds and runs agent workflows.
Why use it?
It helps keep Claude interactions compatible with the project's dispatcher, while handling tool calls, sessions, model choices, and prompt reuse consistently.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; mentions Codex.

Good fit Use it when changing the Claude adapter, the code that launches Claude sub-sessions, or the pipeline that builds and runs agent workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kouroshez/coding-os/claude-sdk-integration
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.

Any agent
npx skills add kouroshez/coding-os --skill claude-sdk-integration
Clone the repo
git clone --depth 1 https://github.com/kouroshez/coding-os

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 claude-sdk-integration

README.md
[![agentmods](https://agentmods.dev/badge/skills/kouroshez/coding-os/claude-sdk-integration/github.svg)](https://agentmods.dev/skills/kouroshez/coding-os/claude-sdk-integration)
Your own site
<a href="https://agentmods.dev/skills/kouroshez/coding-os/claude-sdk-integration"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/claude-sdk-integration/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.

agentmods 80×15 button for claude-sdk-integration

Your own site · 80×15
<a href="https://agentmods.dev/skills/kouroshez/coding-os/claude-sdk-integration"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/claude-sdk-integration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 130 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,620 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00130 $0.01620
Opus 5 $0.00065 $0.00810
Sonnet 5 $0.00026 $0.00324
Haiku 4.5 $0.00013 $0.00162

Measured 5d ago against content hash 28bd1ebfc390, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

claude-sdk-integration 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 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/check_model_ids.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

src/templates/meta/skills/claude-sdk-integration/SKILL.md · 164 lines

How it starts

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

claude-sdk-integration

Purpose: Make every interaction with Anthropic's Python SDKs robust, cache-friendly, and contract-compliant. The meta-repo dispatches Claude sub-sessions via claude-agent-sdk; agents editing this surface must preserve the protocol that src/core/thinking_os/dispatcher.py defines.

Read when: editing any of:

  • src/adapters/claude/sdk_dispatcher.py — the SDK dispatcher.
  • src/adapters/claude/install.sh — adapter scaffold (when changing SDK options).
  • src/core/thinking_os/dispatcher.py — the protocol the dispatcher implements.
  • src/core/thinking_os/formula_composer.py — when changing how chains spawn sub-sessions.
  • src/core/thinking_os/cognition.py — when wiring cos_dispatch_formula_run.

Skip when: editing tests under tests/test_*sdk*, mock fixtures.

Two libraries, two scopes

anthropic       — raw Claude API (Messages, tool use, streaming)
claude-agent-sdk — high-level: spawns a Claude Code sub-session as a
                   coroutine, handles tool-use loop, session lifecycle

src/adapters/claude/sdk_dispatcher.py uses claude-agent-sdk (high level). For raw API work (cognition tools that build prompts), use anthropic.

Dispatcher protocol contract

src/core/thinking_os/dispatcher.py defines:

class AgentDispatcher(Protocol):
    def available(self) -> bool: ...
    async def dispatch(self, request: DispatchRequest) -> DispatchResult: ...

Any adapter dispatcher (Claude, Codex, …) MUST implement this. Breaking the signature breaks every cognition flow.

Hard rules

1. Prompt caching (SDK + raw)

Cache markers on stable prefixes:

messages = [
    {"role": "user", "content": [
        {"type": "text", "text": SYSTEM_PROMPT, "cache_control": {"type": "ephemeral"}},
        {"type": "text", "text": dynamic_question},
    ]}
]

Goal: ≥80% cache hit rate on repeated dispatches. The dispatcher should keep the system prompt + tool list + role context BEFORE the question — never interleave dynamic content into the cached prefix.

Read the full file on GitHub · 164 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. 5d ago First seen · 164 lines · 130 tokens per session scan A 28bd1ebfc390

Subscribe to this mod's changes

claude-sdk-integration is a skill published in the GitHub repository kouroshez/coding-os (6 stars, last pushed yesterday), licensed Apache-2.0. It adds 130 tokens to every session and 1,620 once invoked, about $0.0006 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.