CLAUDE LABJP
MODEL — Claude Opus 4.8 and Haiku 4.5 arrive in the Messages API for coding and agentic workCODE — Claude Code adds /rewind to resume before /clear, with steadier MCP reliability and OAuth retriesCODE — CPU use during streaming drops about 37%, improving stability on long-running sessionsCLOUD — Claude is generally available in Microsoft Foundry on Azure with Azure-native accessSECURITY — Static API keys can now be replaced with WIF short-lived, scoped credentialsPOLICY — The US government clears Anthropic to release Mythos 5 to about 100 firms and agenciesMODEL — Claude Opus 4.8 and Haiku 4.5 arrive in the Messages API for coding and agentic workCODE — Claude Code adds /rewind to resume before /clear, with steadier MCP reliability and OAuth retriesCODE — CPU use during streaming drops about 37%, improving stability on long-running sessionsCLOUD — Claude is generally available in Microsoft Foundry on Azure with Azure-native accessSECURITY — Static API keys can now be replaced with WIF short-lived, scoped credentialsPOLICY — The US government clears Anthropic to release Mythos 5 to about 100 firms and agencies
TAG

Token Optimization

3 articles
Back to all tags
Related:
Claude API3Agent SDK1MCP1Context Management1tool use1vision1tool_result1context editing1memory tool1agents1
API & SDK/2026-06-30Advanced

When a Tool Result Is Too Big and Melts Your Context Window: Designing Cursor-Based Pagination

When a list tool returns hundreds of rows at once, an agent's context can collapse in a single call. Here is a cursor-based pagination design that keeps tool output small and protects your token budget, with working code.

API & SDK/2026-06-29Advanced

Let Claude Actually See the Images Your Tools Return — Use Image Blocks in tool_result and Cut Tokens by Roughly 10x

Stuffing a base64 string into a tool_result makes the same image cost roughly 10–20x more tokens. Here is how to return it as an image content block instead, with SDK code, a token-cost estimate, and the gotchas I hit in production.

API & SDK/2026-06-16Advanced

Taming Token Bloat in Long-Running Agents with Context Editing and the Memory Tool

For long-running agents whose input tokens balloon as tool results pile up, here is how to pair context editing with the memory tool and measure the savings with count_tokens, including a working backend implementation.