#Claude
10 posts tagged Claude. All posts
What Changed in Claude Code in 2026Claude Code's 2026 releases, from Opus 4.6 to Fable 5.2: agent teams, background sessions, workflows, plugins and skills, auto mode and new usage limits.
AI in Fall 2026: Gated Frontier Models, Computer Use and a Stateless MCPAnthropic, OpenAI and Google all shipped new model generations from September to November 2026. What changed, what got cheaper, and what it means for builders.
Processing thousands of prompts with the Claude Message Batches APIWhen the Message Batches API fits, and a script that submits a batch with custom IDs, polls it, reads the results and resubmits errored or expired requests.
Handling LLM API rate limits: retries, backoff and concurrency capsTell 429s from 529s and 5xx errors, use the Anthropic SDK's built-in retries, add backoff with jitter, and cap concurrency and input tokens with asyncio.
Streaming LLM responses to the browser with server-sent eventsRelay a streamed Claude response through a FastAPI endpoint as server-sent events, read it in the browser with fetch, and handle proxy buffering and cancellation.
Cutting LLM costs with prompt caching in the Claude APIHow prefix caching works, where to put cache_control breakpoints, minimum lengths and TTLs, and how to read the cache usage fields to confirm you are getting hits.
A small eval runner for LLM features in PythonBuild a 160-line eval runner for an LLM feature: JSONL test cases, exact, regex and LLM-as-judge graders, concurrent runs and scores tracked per prompt version.
Writing a tool-use loop for the Claude API by handBuild the tool-calling loop for Claude yourself in Python: JSON Schema tools, the stop_reason loop, tool_result blocks, errors with is_error and a turn limit.
Retrieval-augmented generation from scratch with SQLiteBuild RAG in about 130 lines of Python: chunk Markdown, embed it locally, store vectors in SQLite, search by cosine similarity and get cited answers from Claude.
Getting reliable JSON from an LLM: schemas, structured outputs and validationThree ways to get JSON out of Claude in Python: prompting, a forced tool call and the structured outputs beta, with Pydantic validation, retries and stop reasons.
© 2026 David Li · Home · Blog · RSS ·Classic site · Built with Astro, Starlight and three.js · Logos:Font Awesome Free (CC BY 4.0)