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/Claude Code
Claude Code/2026-05-28Advanced

The Morning I Hit Cloudflare Workers' 62 MiB Limit, and the Content Split Architecture I Rebuilt for 5,000 Articles

One morning, an indie developer running 4 AI tech blogs on Cloudflare Workers + Next.js woke up to a deployment that had stopped because articles.json grew large enough to push the Worker bundle past the 62 MiB limit. This is the concrete implementation walkthrough of splitting metadata from HTML, with the build-time and bundle-size numbers observed across the first month.

Cloudflare Workers14Next.js7Content Splitindie developer19production111OpenNext

Premium Article

One morning, one out of the four AI tech blogs I was running in parallel suddenly stopped deploying. The log did not say Script startup exceeded CPU time limit like I half-expected, but instead carried a line I had never seen before: Your Worker exceeded the size limit of 62 MiB. The previous day's push had deployed without issues, so the cause had to be hiding somewhere in the four MDX files I had added the day before.

I have been shipping indie iOS and Android apps continuously since 2014, twelve years now, and my wallpaper and relaxation apps have together passed 50 million downloads. Alongside that app business I run 4 AI tech blogs in parallel on Cloudflare Workers + Next.js (OpenNext), and that very morning the combined article count had just crossed 4,500. "Hitting the wall without seeing it coming" is the right phrase, because the article count had been quietly stacking up.

From my two grandfathers, who were both miyadaiku (traditional Japanese temple carpenters), I picked up something close to a principle: building carefully means drawing guide lines for whoever comes back to touch the work later. The 62 MiB ceiling was proof that my own guide lines for future-me had quietly worn thin. What follows is the concrete sequence I walked through to rebuild the architecture around a clean split between metadata and HTML content.

The triage I ran the morning the limit hit

The 62 MiB ceiling on Cloudflare Workers applies to the bundled (post-Brotli) Worker size. With OpenNext, Next.js Server Components, middleware and route handlers all collapse into a single Worker bundle, so it is not only your code that counts against the cap. Anything that is treated as a bundled static asset rides along, too.

The first thing I did was run a local build and look at the actual on-disk size.

cd /tmp/repos/claudelab.net
npm run build
ls -lh .open-next/worker.js
# -rw-r--r--  1 user  staff   18M  May  3 09:14 worker.js

The 18 MB number is pre-Brotli, but a quick du -sh confirmed that almost all of it was the JSON-ified MDX content for 4,500 articles. The file src/generated/articles.json alone was over 18 MB.

ls -lh src/generated/articles.json
# -rw-r--r--  1 user  staff   18M  May  3 09:14 articles.json

That was the moment it became obvious that piling both metadata and rendered HTML into a single articles.json had been the slow-acting poison. Even at roughly 4 KB per article, 4,500 articles compounds to 18 MB. With four new articles landing per day, leaving the design alone would push it past 25 MB in three months and over 30 MB by six months. Brotli compression does not help nearly as much as one might hope, because there is very little repetition across distinct article bodies; the compressed size grew almost linearly.

What had quietly broken about the original design

The original generator was simple. At build time, generate-content.mjs would read every MDX file, render to HTML, and concatenate metadata plus body into one big articles.json. The appeal was that any Server Component could just import articles from "@/generated/articles.json" and have the whole catalog in memory.

// Old generate-content.mjs (abbreviated)
const articles = [];
for (const file of allMdxFiles) {
  const { data, content } = matter(fs.readFileSync(file));
  const html = await mdxToHtml(content);
  articles.push({ ...data, slug, html });
}
fs.writeFileSync("src/generated/articles.json", JSON.stringify(articles));

This was lovely at 100 articles. At 500, still fine. Around 1,000 articles I noticed local builds getting noticeably slower. Around 2,000 the fs.readFileSync cost became visible. At 3,500 my editor's autoimport started to lag on the JSON. At 4,500 the 62 MiB wall arrived. The guide lines for future-me had been wearing thin every step of the way and I had not been watching.

The line I needed to redraw was a single, physical one: separate metadata and body into different files.

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
Step-by-step triage of how I confirmed the 18 MB articles.json was driving the Worker bundle past Cloudflare's 62 MiB cap
Working code for the two-stage output in generate-content.mjs (metadata JSON + per-article HTML in public/content/) and the getArticleContent() helper that fetches via the ASSETS binding
Before/after numbers observed across 4,500 articles: Worker bundle 18 MB → 2.4 MB, build time 78 s → 62 s, 30-day deploy success rate 100%
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

Claude Code2026-04-21
Running Next.js on Cloudflare Workers in Production with Claude Code — Every Build Crisis, Cache Bug, and Automation Pattern We Solved
Running Next.js on Cloudflare Workers is not the same as Vercel. The 62 MiB bundle limit, ASSETS binding quirks, and edge cache personalization conflicts are real production hazards. Here's how Claude Code helped us solve each one.
Claude Code2026-06-17
It Says '500' in the Browser but curl Returns 200 — When a Next.js Error Boundary Misreads a ChunkLoadError
A production Next.js article page shows '500 Internal Server Error' in the browser, yet curl returns 200. The culprit was not the server but a ChunkLoadError surfacing through error.tsx. Here is the diagnosis and a fix with built-in auto-reload.
Claude Code2026-04-06
Claude Code × Next.js 15 App Router Production: RSC, Server Actions, Auth, Testing & Deployment
The practical guide to production Next.js 15 App Router development with Claude Code. Covers RSC architecture decisions, Server Actions patterns, Auth.js v5, Vitest testing, and Cloudflare Workers deployment with practical code examples.
📚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 →