agentleFS
spwepsspweps/claude-skills/claude-api/SKILL.md

claude-api

Skill0 starsChanged 4 months agoMITView on GitHub

Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.

104 other projects use a version of this, 22 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use academy-guide, everything-claude-code-conventions and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AnthropicSkill

    academy-guide

    Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.

    Also in 6 projects that use this

  • mryeastcodeSkill

    everything-claude-code-conventions

    Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

    Also in 7 projects that use this

  • tpavanipradeepSkill

    nextjs-turbopack

    Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.

    Also in 10 projects that use this

  • CodeWithBehnamSkill

    dmux-workflows

    Multi-agent orchestration using dmux (tmux pane manager for AI agents). Patterns for parallel agent workflows across Claude Code, Codex, OpenCode, and other harnesses. Use when running multiple agent sessions in parallel or coordinating multi-agent development workflows.

    Also in 11 projects that use this

  • tpavanipradeepSkill

    bun-runtime

    Bun as runtime, package manager, bundler, and test runner. When to choose Bun vs Node, migration notes, and Vercel support.

    Also in 10 projects that use this

  • AnthropicSkill

    discernment-nudge

    After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.

    Also in 6 projects that use this

  • +2 more from tpavanipradeep

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 3 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 98 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Model: Use claude-opus-4-6 — non-negotiable default.

    line 15
  2. Very specific:

    Thinking: Use thinking: {type: "adaptive"} for anything remotely complicated.

    line 16
  3. Very specific:

    Streaming: Default to streaming for any request with long input, long output, or high max_tokens.

    line 17
  4. Distinctive:

    Before reading code examples, determine language from project files:

    line 21
  5. Very specific:

    If ambiguous, ask. If unsupported (Rust, Swift, etc.), suggest cURL/raw HTTP from curl/.

    line 32
  6. Distinctive:

    Start simple: Default to the simplest tier that meets your needs.

    line 48
  7. Very specific:

    Older models (explicit request only): Use thinking: {type: "enabled", budget_tokens: N} where budget_tokens < max_tokens (min 1024).

    line 97
  8. Distinctive:

    After detecting language, read:

    line 117

“Common” is measured: kept by at least 6 in 10 of the 98 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Building LLM-Powered Applications with Claude

This skill helps you build LLM-powered applications with Claude. Choose the right surface based on your needs, detect the project language, then read the relevant language-specific documentation.

Defaults

Unless the user requests otherwise:

  • Model: Use claude-opus-4-6 — non-negotiable default. Do not downgrade for cost.
  • Thinking: Use thinking: {type: "adaptive"} for anything remotely complicated. budget_tokens is deprecated on Opus 4.6 and Sonnet 4.6 — never use it.
  • Streaming: Default to streaming for any request with long input, long output, or high max_tokens. Use .get_final_message() / .finalMessage() if you don't need individual stream events.

Language Detection

Before reading code examples, determine language from project files:

  • *.py, requirements.txt, pyproject.toml → Python — read from python/
  • *.ts, *.tsx, package.json, tsconfig.json → TypeScript — read from typescript/
  • *.js, *.jsx (no .ts files) → TypeScript — JS uses same SDK
  • *.java, pom.xml, build.gradle → Java — read from java/
  • *.go, go.mod → Go — read from go/
  • *.rb, Gemfile → Ruby — read from ruby/
  • *.cs, *.csproj → C# — read from csharp/
  • *.php, composer.json → PHP — read from php/

If ambiguous, ask. If unsupported (Rust, Swift, etc.), suggest cURL/raw HTTP from curl/.

Language-Specific Feature Support

LanguageTool RunnerAgent SDK
PythonYes (beta)Yes
TypeScriptYes (beta)Yes
JavaYes (beta)No
GoYes (beta)No
RubyYes (beta)No
C#NoNo
PHPNoNo

Which Surface Should I Use?

Start simple. Default to the simplest tier that meets your needs.

Use CaseSurface
Classification, summarization, extraction, Q&AClaude API — single call
Batch processing or embeddingsClaude API — specialized endpoints
Multi-step pipelines with code-controlled logicClaude API + tool use
Custom agent with your own toolsClaude API + tool use (manual loop)
AI agent with file/web/terminal accessAgent SDK
Want built-in permissions and guardrailsAgent SDK

Decision tree:

Single LLM call? → Claude API
Claude needs to discover/access files, web, shell itself? → Agent SDK
Multi-step, code-orchestrated, your own tools? → Claude API + tool use
Open-ended agent, model controls trajectory? → Claude API agentic loop

Agent checklist before choosing agent tier: Complexity (multi-step, hard to specify)? Value (outcome justifies cost/latency)? Viability (Claude capable)? Error cost (recoverable)? If any answer is no, stay simpler.

Architecture

Everything goes through POST /v1/messages. Tools and output constraints are features of this single endpoint.

  • User-defined tools — define tools; SDK handles the loop
  • Server-side tools — Anthropic-hosted (code execution, computer use)
  • Structured outputs — use output_config: {format: {...}} (not deprecated output_format)
  • Supporting endpoints — Batches, Files, Token Counting, Models API

Current Models

ModelIDContextInput $/1MOutput $/1M
Claude Opus 4.6claude-opus-4-6200K (1M beta)$5.00$25.00
Claude Sonnet 4.6claude-sonnet-4-6200K (1M beta)$3.00$15.00
Claude Haiku 4.5claude-haiku-4-5200K$1.00$5.00

Use exact model ID strings as-is. Do not append date suffixes.

For live capability lookup: client.models.retrieve(id) — see shared/models.md.

Thinking & Effort

Adaptive thinking (Opus 4.6, recommended): thinking: {type: "adaptive"}. No budget_tokens. When user asks for "extended thinking" or a "thinking budget" — use adaptive thinking on Opus 4.6, do not switch to older models.

Effort parameter (GA): output_config: {effort: "low"|"medium"|"high"|"max"}. Default high. max is Opus 4.6 only. Works on Opus 4.5, Opus 4.6, Sonnet 4.6. Errors on Sonnet 4.5 / Haiku 4.5.

Older models (explicit request only): Use thinking: {type: "enabled", budget_tokens: N} where budget_tokens < max_tokens (min 1024).

Compaction

Beta, Opus 4.6 and Sonnet 4.6. Header: compact-2026-01-12. Auto-summarizes context near 150K tokens.

Critical: Append response.content (not just text) on every turn. Compaction blocks must be preserved in the message array or the state is lost silently.

Common Pitfalls

  • budget_tokens deprecated on 4.6 — use adaptive thinking instead; throws error if used
  • Opus 4.6 prefill removed — assistant message prefills return 400; use output_config.format instead
  • max_tokens defaults — non-streaming: ~16000; streaming: ~64000; don't lowball
  • 128K output tokens — requires streaming on Opus 4.6
  • Structured outputs — use output_config: {format: {...}} not output_format (deprecated)
  • Tool input JSON — always json.loads() / JSON.parse(); never raw string match on tool inputs
  • Don't reimplement SDK — use stream.finalMessage(), typed exceptions, SDK types

Reading Guide

After detecting language, read:

  • Single call: {lang}/claude-api/README.md
  • Streaming: + {lang}/claude-api/streaming.md
  • Tool use / agents: + shared/tool-use-concepts.md + {lang}/claude-api/tool-use.md
  • Batch: + {lang}/claude-api/batches.md
  • File uploads: + {lang}/claude-api/files-api.md
  • Agent SDK (Python/TypeScript only): {lang}/agent-sdk/README.md + {lang}/agent-sdk/patterns.md
  • Error handling: shared/error-codes.md
  • Live docs: shared/live-sources.md

Security Audit

Source: https://github.com/anthropics/skills — Anthropic first-party. Audit: PASS.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.