CLAUDE LABJP
FORK — Claude Code 2.1.212 changes what /fork does: it copies your conversation into a new background session with its own row in claude agents, so you can keep working. The old in-session subagent is now /subtaskLIMITS — WebSearch calls are now capped at 200 per session by default, and subagent spawns get the same 200 ceiling, so a runaway search or delegation loop stops on its ownMCPBG — MCP tool calls running past two minutes now move to the background automatically, keeping the session usable. Tune the threshold with CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSPLANFIX — Fixed plan mode auto-running file-modifying Bash commands such as touch and rm without a permission prompt or an SDK canUseTool callbackSONNET5 — Claude Sonnet 5 is running on introductory pricing of $2 per million input tokens and $10 per million output. After August 31 it moves to $3 and $15IPO — Bankers are reportedly lining up investor meetings for Anthropic ahead of a possible public listing as soon as OctoberFORK — Claude Code 2.1.212 changes what /fork does: it copies your conversation into a new background session with its own row in claude agents, so you can keep working. The old in-session subagent is now /subtaskLIMITS — WebSearch calls are now capped at 200 per session by default, and subagent spawns get the same 200 ceiling, so a runaway search or delegation loop stops on its ownMCPBG — MCP tool calls running past two minutes now move to the background automatically, keeping the session usable. Tune the threshold with CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSPLANFIX — Fixed plan mode auto-running file-modifying Bash commands such as touch and rm without a permission prompt or an SDK canUseTool callbackSONNET5 — Claude Sonnet 5 is running on introductory pricing of $2 per million input tokens and $10 per million output. After August 31 it moves to $3 and $15IPO — Bankers are reportedly lining up investor meetings for Anthropic ahead of a possible public listing as soon as October
Articles/API & SDK
API & SDK/2026-03-24Intermediate

Claude Files API Guide — Upload Once, Reference Anywhere in Your API Calls

Learn how to use the Claude Files API to upload PDFs, images, and text once and reference them across calls. Includes Python and TypeScript examples, a production-grade retry helper, real token cost estimates, and hard-won operational tips.

files-api3api38python22typescript11pdf3document-processing

Premium Article

What Is the Claude Files API? — Upload Once, Use Everywhere

If you've been building with the Claude API, chances are you've run into a common pain point: re-uploading the same document every time you make a request. The Files API solves this by letting you upload a file once to Anthropic's secure storage and reference it by a unique file_id in any subsequent API call.

Here's why that matters for your workflow:

  • Lower bandwidth costs: No more sending the same 50-page PDF with every request
  • Cleaner code: Skip the Base64 encoding and multipart form data juggling
  • Team-friendly: Any API key in the same workspace can reference uploaded files

The Files API is currently in beta. To use it, include the header anthropic-beta: files-api-2025-04-14 with your requests.

As an indie developer, while organizing support replies for one of my apps, I noticed I was re-attaching the same bug-report screenshot to every request — sending the identical image over and over. After switching to the Files API, I could upload it once and reuse the same file_id for both classification and drafting a reply. It's a small change, but those small wins are what keep an operation stable over time.

Supported File Types and Size Limits

The Files API supports different file types, each mapped to a specific content block type:

File TypeMIME TypeContent BlockUse Case
PDFapplication/pdfdocumentDocument analysis, summarization, citation extraction
Plain texttext/plaindocumentText processing and analysis
Images (JPEG, PNG, GIF, WebP)image/jpeg, etc.imageVisual analysis, UI review, OCR
Datasets and othersVariouscontainer_uploadData analysis and visualization (with Code Execution Tool)

Size limits are generous:

  • Per file: Up to 500 MB
  • Total organization storage: Up to 500 GB

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A production-quality, idempotent upload helper (full working Python) that retries on failure and never double-registers a file
How to estimate the real cost savings from the Files API by working backward from per-page PDF token usage
Undocumented behavior — no server-side dedup, orphan file buildup — plus a use-case-by-use-case design guide
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

API & SDK2026-06-27
When Claude API Streaming Stops Without an Error: Detecting Silent Stalls and Resuming Mid-Stream
How to catch the 'silent stall' where Claude API streaming stops with no exception at all, using a content-level watchdog that times the gap between tokens, plus a resume path that carries received text forward as an assistant prefill, and a four-layer timeout budget for long-running automation.
API & SDK2026-06-12
Handing Monthly Revenue CSVs to the Claude API Code Execution Tool — Files API Wiring, Container Reuse, and Billing Traps
How I moved monthly revenue-CSV reconciliation for four apps into the Claude API Code Execution tool — Files API integration, container reuse, the 5-minute billing minimum, and the file-preload charge that surprises almost everyone.
API & SDK2026-05-16
Debugging Claude API Tool Use Schema Errors: 3 Patterns I've Hit and How to Fix Them
A practical guide to diagnosing Claude API Tool Use errors—from schema definition mistakes to invalid_tool_use blocks and Claude ignoring your tools entirely. Based on real implementation experience.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →