Agent skill

Clade Known Pitfalls

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Common mistakes when building with the Anthropic API and how to avoid them.

MITAuto-check passedAI & LLM Engineering

Install Clade Known Pitfalls

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill clade-known-pitfalls -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace clade-known-pitfalls --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/clade-known-pitfalls .claude/skills/clade-known-pitfalls && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
clade-known-pitfalls
GitHub stars
2.8k
Token cost
~1.3k tokens
SKILL.md length
428 words
Files
2 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Common mistakes when building with the Anthropic API and how to avoid them.

  • Works in 10 steps: Forgetting max_tokens → System Prompt in Messages Array → Non-Alternating Messages → …
  • Working with known-pitfalls patterns
  • SKILL.md covers Overview, 1. Forgetting max_tokens, 2. System Prompt in Messages… and 3. Non-Alternating Messages, plus 14 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Clade Known Pitfalls is an agent skill from jeremylongshore/tons-of-skills-marketplace. Common mistakes when building with the Anthropic API and how to avoid them. Use when working with known-pitfalls patterns. Trigger with "anthropic mistakes", "claude pitfalls", "anthropic gotchas", "common claude errors", "anthropic anti-patterns".

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/one-pager.md`). Compatibility notes: Designed for Claude Code

It sits in AI & LLM Engineering. It works with Anthropic API. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Working with known-pitfalls patterns
  • With anthropic mistakes
  • Claude pitfalls
  • Anthropic gotchas

Example prompts

  • “anthropic mistakes”
  • “claude pitfalls”
  • “anthropic gotchas”
  • “/clade-known-pitfalls”

Requirements

  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. Forgetting max_tokens
  2. System Prompt in Messages Array
  3. Non-Alternating Messages
  4. Not Checking stop_reason
  5. Creating Client Per Request
  6. No Error Handling for 529
  7. Hardcoding Model IDs
  8. Ignoring Token Costs
  9. No Streaming for User-Facing Apps
  10. Sending PII Unnecessarily

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • platform.claude.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Clade Known Pitfalls loads about 1.3k tokens when it runs, and up to ~1.7k if it reads all its reference files. Until then it costs about 67 tokens; SKILL.md has 428 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 428 words, ~1,304 tokens.

Download SKILL.mdSave it as .claude/skills/clade-known-pitfalls/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
clade-known-pitfalls
description
Common mistakes when building with the Anthropic API and how to avoid them. Use when working with known-pitfalls patterns. Trigger with "anthropic mistakes", "claude pitfalls", "anthropic gotchas", "common claude errors", "anthropic anti-patterns".
allowed-tools
Read, Write, Edit
compatibility
Designed for Claude Code
version
1.1.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, anthropic, claude, pitfalls, best-practices

Anthropic Known Pitfalls

Overview

Ten common mistakes when building with the Anthropic API and how to avoid them: forgetting max_tokens (required), system prompt in messages array (wrong), non-alternating messages, unchecked stop_reason, creating client per request, no 529 handling, hardcoded model IDs, expensive output tokens, no streaming, and unnecessary PII.

1. Forgetting max_tokens

Unlike OpenAI, max_tokens is required. Omitting it returns a 400 error.

typescript
// BAD
await client.messages.create({ model: 'claude-sonnet-4-20250514', messages });

// GOOD
await client.messages.create({ model: 'claude-sonnet-4-20250514', max_tokens: 1024, messages });

2. System Prompt in Messages Array

Claude uses a top-level system parameter, not a system message in the array.

typescript
// BAD — this sends "system" as a user message role, which will error
messages: [{ role: 'system', content: '...' }, { role: 'user', content: '...' }]

// GOOD
system: 'You are helpful.',
messages: [{ role: 'user', content: '...' }]

3. Non-Alternating Messages

Messages must strictly alternate between user and assistant.

typescript
// BAD — two user messages in a row
messages: [
  { role: 'user', content: 'Hello' },
  { role: 'user', content: 'How are you?' }, // ERROR
]

// GOOD — combine into one or add assistant between
messages: [
  { role: 'user', content: 'Hello. How are you?' },
]

4. Not Checking stop_reason

If stop_reason === 'max_tokens', the response was truncated.

typescript
if (message.stop_reason === 'max_tokens') {
  // Response is incomplete — increase max_tokens or handle truncation
}

5. Creating Client Per Request

Each new Anthropic() creates a new connection pool. In serverless, this adds latency.

typescript
// BAD — new client every request
app.post('/chat', async (req, res) => {
  const client = new Anthropic(); // Cold connection every time
});

// GOOD — reuse across requests
const client = new Anthropic();
app.post('/chat', async (req, res) => {
  await client.messages.create({ ... });
});

6. No Error Handling for 529

529 (overloaded) is common during peak hours. The SDK retries automatically, but you should handle it for critical paths.

7. Hardcoding Model IDs

Model IDs change with new versions. Use environment variables.

typescript
const MODEL = process.env.CLAUDE_MODEL || 'claude-sonnet-4-20250514';

8. Ignoring Token Costs

Output tokens cost 5x more than input tokens. A 4096 max_tokens response on Opus costs ~$0.30. Use the smallest max_tokens that works.

9. No Streaming for User-Facing Apps

Without streaming, users stare at a blank screen for 5-30 seconds. Always stream for interactive use.

10. Sending PII Unnecessarily

Don't include user PII in prompts unless the task requires it. Redact before sending.

Quick Reference

PitfallFix
Missing max_tokensAlways include it
System in messagesUse top-level system param
Non-alternating messagesCombine or interleave
Unchecked stop_reasonCheck for max_tokens truncation
Client per requestModule-level singleton
No 529 handlingSDK retries + fallback model
Hardcoded model IDsEnvironment variable
Expensive outputMinimize max_tokens
No streamingAlways stream for UI
Unnecessary PIIRedact before sending
Show full SKILL.md (143 more words)Show less

Output

  • All ten pitfalls checked against your codebase
  • max_tokens present on every messages.create call
  • System prompt using top-level system parameter
  • Messages strictly alternating user/assistant
  • stop_reason checked for truncation
  • Client instance reused across requests

Error Handling

ErrorCauseSolution
API ErrorCheck error type and status codeSee clade-common-errors

Examples

See ten numbered pitfall sections above, each with BAD/GOOD code comparisons. Quick Reference table at the end summarizes all fixes.

Resources

Prerequisites

  • Familiarity with the Anthropic Messages API
  • Active Claude integration to audit
  • Access to codebase for pattern review

Instructions

Step 1: Review the patterns below

Each section contains production-ready code examples. Copy and adapt them to your use case.

Step 2: Apply to your codebase

Integrate the patterns that match your requirements. Test each change individually.

Step 3: Verify

Run your test suite to confirm the integration works correctly.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/.curated/clade-known-pitfalls of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/one-pager.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Clade Known Pitfalls next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Clade Known Pitfalls compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clade Known Pitfalls this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.3kAutomated safety check: PassMIT
Bidirectional Differentialjszmajda/lid107—~2.9kAutomated safety check: PassMIT
Provider Healthnyldn/claude-octopus4.2k1 repos~491Automated safety check: PassMIT
Claude APIterrense/LilBot-agent121—~155Automated safety check: PassNone
Darwinian EvolverLuciole-Studio/Misaka-Agent1712 repos~2.1kAutomated safety check: WarnMIT
Token Optimizationcwinvestments/memstack423—~1.4kAutomated safety check: PassProprietary

Similar skills

  • Audit coherence across an arrow of intent by running two parallel fresh Claude sessions — one reconstructs code from a single EARS, the other reconstructs the EARS from stripped code — then…

    107 GitHub stars~2.9k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Provider Health

    nyldn/claude-octopus

    Starter: one-screen provider health summary — availability, auth method, version drift, and cost posture for every seatable provider

    4.2k GitHub starsUsed in 1 repo~491 tokens
    AI & LLM EngineeringAuto-check passed
  • Claude API

    terrense/LilBot-agent

    Help with Claude/LLM API usage, models, and integration patterns.

    121 GitHub stars~155 tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Darwinian Evolver

    Luciole-Studio/Misaka-Agent

    Evolve prompts/regex/SQL/code with Imbue's evolution loop. An agent skill from Luciole-Studio/Misaka-Agent.

    171 GitHub starsUsed in 2 repos~2.1k tokens
    AI & LLM EngineeringAuto-check: warnings
  • Token Optimization

    cwinvestments/memstack

    A skill your agent uses when the user says 'token optimization', 'save tokens', 'context window', 'reduce tokens', 'token stack', or 'TokenStack', or asks about extending context window capacity.

    423 GitHub stars~1.4k tokensUpdated 14 days ago
    AI & LLM EngineeringAuto-check passed
  • Reference SDK

    parcadei/Continuous-Claude-v3

    Check reference SDK implementations using btca ask. An agent skill from parcadei/Continuous-Claude-v3.

    3.9k GitHub starsUsed in 1 repo~376 tokens
    AI & LLM EngineeringAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Questions about Clade Known Pitfalls

What does Clade Known Pitfalls do?

Common mistakes when building with the Anthropic API and how to avoid them. Clade Known Pitfalls is an agent skill from jeremylongshore/tons-of-skills-marketplace. Common mistakes when building with the Anthropic API and how to avoid them.

When should I use Clade Known Pitfalls?

Clade Known Pitfalls fits situations like: working with known-pitfalls patterns; with anthropic mistakes; Claude pitfalls; anthropic gotchas.

How do I install Clade Known Pitfalls in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clade-known-pitfalls -a claude-code`. Or copy the skill folder (skills/.curated/clade-known-pitfalls in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/clade-known-pitfalls in your project. Claude Code loads it when a task matches its description.

How do I install Clade Known Pitfalls in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clade-known-pitfalls -a codex`. Or copy the skill folder (skills/.curated/clade-known-pitfalls in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/clade-known-pitfalls in your project. Codex loads it when a task matches its description.

Can I use Clade Known Pitfalls in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clade-known-pitfalls -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/clade-known-pitfalls, .gemini/skills/clade-known-pitfalls, .github/skills/clade-known-pitfalls and .opencode/skills/clade-known-pitfalls in your project.

What does Clade Known Pitfalls need to run?

SKILL.md names no scripts, command-line tools or credentials: Clade Known Pitfalls is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit. Compatibility (from SKILL.md): Designed for Claude Code.

Does Clade Known Pitfalls access the network?

SKILL.md names 1 domain. As links in the text: platform.claude.com. This is read from the text; nothing was executed.

Is Clade Known Pitfalls safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Clade Known Pitfalls use?

Clade Known Pitfalls is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Clade Known Pitfalls use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 430 tokens, read only when the agent opens those files.

What are the alternatives to Clade Known Pitfalls?

Skills that share tags, products or a category with Clade Known Pitfalls: Bidirectional Differential (jszmajda/lid, 107 stars), Provider Health (nyldn/claude-octopus, 4.2k stars), Claude API (terrense/LilBot-agent, 121 stars) and Darwinian Evolver (Luciole-Studio/Misaka-Agent, 171 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clade Known Pitfalls?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.