Add Claude API behavioral guide: undocumented protocol observations from 95K+ messages#151
Open
heath-hunnicutt-ruach-tov wants to merge 1 commit intoandrewyng:mainfrom
Conversation
Community contribution documenting undocumented behaviors, edge cases, and protocol nuances for the Claude Messages API. Based on 95,000+ messages processed through a multi-agent conversation engine. Covers: - Message structure constraints (tool_result ordering, role alternation) - Token counting and context management edge cases - Streaming protocol undocumented behaviors - Tool use protocol subtleties - Error handling and rate limiting patterns - System prompt behavioral effects - Context window management strategies Complements the existing claude-api SDK usage doc with practical operational knowledge that prevents subtle bugs. Source: Ruach Tov (ruachtov.ai) - open research collective for human-AI collaboration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Community-contributed documentation of undocumented behaviors, edge cases, and protocol nuances for the Claude Messages API.
Why
The existing
content/anthropic/docs/claude-apientry covers SDK usage (initialization, basic inference, tool use syntax). This new entry complements it with operational knowledge — the things you only learn after processing tens of thousands of messages through the API.These observations prevent subtle bugs that waste developer time and API credits.
Content Summary (351 lines, under 500-line limit)
Source
Ruach Tov — An open research collective for human-AI collaboration. These observations come from building and operating
dibbur, a multi-agent conversation engine (6+ AI agents, multiple model providers).Placement
content/anthropic/docs/claude-api-behavioral/DOC.md— alongside the existingclaude-apiSDK doc, with a distinct name reflecting its focus on behavioral observations rather than SDK usage.Checklist
community