CLAUDE LABJP
PRICING — September 1 was the scheduled date for the Sonnet 5 price increase, and it did not happen. The introductory $2/$10 per MTok now stands as the regular pricePARTNER — Salesforce and Anthropic announced Claudeforce, an expanded partnership. The Salesforce in Claude plugin ships with 37 prebuilt sales skills, from meeting prep to pipeline managementTRUST — Claudeforce serves Claude through Amazon Bedrock inside the Salesforce Trust Boundary, so data and inference never leave the security perimeter — an answer aimed squarely at regulated industriesBETA — Salesforce in Claude is with select pilot customers for now, with an open beta expected during SeptemberLIMITS — The 50% weekly-limit boost runs through September 13. From September 14 the permanent level is 25% above the pre-promotion baseline, roughly a 17% cut from todayRELEASE — Claude Code has shipped nothing since v2.1.251 on August 28. Against a pace of one release every 0.8 days, a four-day gap is among the longest yetPRICING — September 1 was the scheduled date for the Sonnet 5 price increase, and it did not happen. The introductory $2/$10 per MTok now stands as the regular pricePARTNER — Salesforce and Anthropic announced Claudeforce, an expanded partnership. The Salesforce in Claude plugin ships with 37 prebuilt sales skills, from meeting prep to pipeline managementTRUST — Claudeforce serves Claude through Amazon Bedrock inside the Salesforce Trust Boundary, so data and inference never leave the security perimeter — an answer aimed squarely at regulated industriesBETA — Salesforce in Claude is with select pilot customers for now, with an open beta expected during SeptemberLIMITS — The 50% weekly-limit boost runs through September 13. From September 14 the permanent level is 25% above the pre-promotion baseline, roughly a 17% cut from todayRELEASE — Claude Code has shipped nothing since v2.1.251 on August 28. Against a pace of one release every 0.8 days, a four-day gap is among the longest yet
Articles/Claude Code
Claude Code/2026-05-22Intermediate

Why Claude Code Breaks Your MDX Frontmatter With YAML Errors (and How to Fix It)

If you have ever let Claude Code mass-produce MDX articles, sooner or later your build dies with a cryptic YAML error. Nested double quotes, stray colons, comma-joined tag entries — here is what is actually happening and the five patterns I trust in production.

Claude Code243MDXYAMLNext.js8Troubleshooting14

If you have ever let Claude Code generate a few dozen MDX articles in a row, you have probably seen this: the first thirty pieces ship cleanly, and then one day npm run build dies with YAMLException: end of the stream or a document separator is expected. You re-read the body of the article a dozen times before noticing that the real culprit is sitting up in the frontmatter.

I lost half a day to this when I first wired Claude Code into the auto-publishing pipeline behind Dolice Labs, the four AI blogs (Claude Lab, Gemini Lab, Antigravity Lab, Rork Lab) I run as an indie developer. After more than ten years building wallpaper and relaxation apps for the App Store and Google Play — Dolice's apps have crossed 50 million cumulative downloads since 2014, mostly monetized through AdMob — I am used to environment-specific failures, but the way YAML parsers react to LLM output is in a category of its own.

The symptom — your build dies on "YAML parse failed"

On a Next.js + MDX + gray-matter style stack, you tend to see something like this:

[Error: YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key
 at line 4, column 1:
    description: "Run Claude Code in "Plan mode" to preview…"
    ^]

Sometimes the wording is unexpected end of the stream, sometimes tag suffix cannot contain flow indicator characters. None of it looks broken in the editor, so the first instinct is to blame the build environment. In practice, almost every occurrence comes down to one thing: there is a character in the frontmatter that the YAML parser cannot interpret the way Claude assumed it would.

When it bites — three patterns Claude steps on the most

These are the three failure modes I have actually seen in production. Claude Code reaches for quotation marks when it wants to sound natural, and that is where the trouble lives.

Pattern 1: a double-quoted value with a double quote inside

description: "Run Claude Code in "Plan mode" before applying changes…"

Syntactically the parser stops at the second ", then treats the rest as a stray key. To embed a literal " inside a double-quoted YAML scalar you have to write \". Claude rarely escapes proactively because, linguistically, it is just writing the next sensible sentence.

Pattern 2: a bare colon followed by a space, mid-value

title: "Claude Code 3.0: Release Highlights"

The quoting saves you here, but the moment Claude forgets the outer quotes — for example writing title: 3.0: Highlights — the parser sees two key: value pairs and falls over. Long descriptions with mismatched quotes amplify the problem because the parser keeps consuming downstream lines looking for the missing closing quote.

Pattern 3: a tag array element that contains a comma

tags: ["Claude Code, Cowork", "TypeScript"]

This is technically valid YAML, but it silently breaks any downstream tags.includes("Claude Code") filter. No build error, no warning — just a tag page that mysteriously refuses to list the article. That is the worst kind of bug because no log will ever tell you about it.

Why this happens — quoting rules YAML inherited from C

In YAML 1.2, a double-quoted scalar uses C-style escaping. To embed a literal " you must write \". Single-quoted scalars use a different convention: you escape a single quote by doubling it ('') and everything else is taken literally. Claude has both rules in its training data, but it cannot reliably tell which convention applies at the moment it is writing the next token, so it defaults to whatever sounds natural in prose.

The fix is not to make Claude obey YAML escaping. The fix is to narrow the surface where it can possibly go wrong.

Five patterns I trust in production

In Dolice Labs I publish multiple articles per site per day across four sites, fully driven by Claude Code. After getting burned a few times, I settled on these five conventions, ordered from most reliable to most flexible.

Fix 1: never use straight double quotes inside a quoted scalar

For Japanese articles I instruct Claude to substitute 「」 (full-width corner brackets) whenever it wants to quote something inside a frontmatter value. For English I tell it to swap straight double quotes for curly quotes (" ") or single quotes. Either way the parser never sees an ambiguous " inside another ".

description: "Run Claude Code in 'Plan mode' before applying changes"

Fix 2: switch the outer wrapper to single quotes

If you genuinely need straight double quotes in the value, wrap the entire scalar in single quotes.

description: 'Run Claude Code in "Plan mode" before applying changes'

To include a literal ' inside, double it (''). For a site like ours with parallel Japanese and English versions, the simplest rule is "JA uses corner brackets, EN uses single-quoted outer scalar." That keeps the convention consistent across translators.

Fix 3: use a block scalar (| or >)

When a description is long, or includes multiple quoted phrases, block scalars are the cleanest option:

description: >
  Run Claude Code in "Plan mode" to dry-run the change.
  This is why the official docs keep repeating that the
  Edit tool is destructive.

> folds line breaks into spaces; | preserves them. For Open Graph descriptions I prefer > because the final value ends up on one line in the HTML head.

Fix 4: avoid colon + space mid-value

When you want a colon-like break in a title or description, prefer an em dash or a full-width colon over : followed by a space.

# Risky
title: "Claude Code 3.0: Release Highlights"
# Safer
title: "Claude Code 3.0 — Release Highlights"

Fix 5: no commas inside a tag value

One tag, one concept. Resist the temptation to write "Claude Code, Cowork" as a single tag for the sake of brevity. Split them, and let your filter handle the OR condition.

tags: ["Claude Code", "Cowork", "TypeScript"]

Prevention — validate the frontmatter before push

At Dolice Labs we run a tiny Python script over every staged MDX before git push. It carves out the frontmatter and feeds it to yaml.safe_load. If anything throws, the push aborts long before Cloudflare ever sees the commit.

import re
import sys
import yaml
from pathlib import Path
 
def check(path):
    text = Path(path).read_text(encoding="utf-8")
    m = re.match(r"^---\n(.*?)\n---\n", text, re.DOTALL)
    if not m:
        return f"{path}: no frontmatter"
    try:
        yaml.safe_load(m.group(1))
    except yaml.YAMLError as e:
        return f"{path}: {e}"
    return None
 
errors = [e for e in (check(p) for p in sys.argv[1:]) if e]
if errors:
    print("\n".join(errors))
    sys.exit(1)

Wire this into your push step (python3 yaml_check.py content/articles/**/*.mdx) and the failure mode collapses from "Cloudflare build error fifteen minutes later" into "line and column printed locally in under a second."

The lesson — narrow the surface, do not police the LLM

What I learned, after several Cloudflare builds died in a row, is that asking an LLM to follow YAML escaping rules perfectly is the wrong battle. It is far cheaper to narrow the set of characters Claude is allowed to use in frontmatter values, and validate mechanically before push. Corner brackets instead of double quotes, em dashes instead of colons, no commas inside tags — those three rules, plus a 30-line Python validator, ended the issue for me across all four Dolice Labs sites. Thanks for reading.

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 $15 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

Claude Code2026-09-01
Drop the quotes on a heredoc and the prices in your log quietly change
An unquoted heredoc runs the variables and backticks inside its body. Here are the four ways my log got rewritten, how the three quoting forms compare, a safe placeholder-and-sed pattern, and a small script for auditing what you already have.
Claude Code2026-08-19
Fixing the Code Doesn't Evict a Broken Page From the Edge Cache
I shipped a fix and the broken page kept serving. The problem was not the code but the edge cache, which had stored a broken HTML response because the store decision looked only at the status code. Here is the integrity guard I now run before every cache write, and the thresholds I had to tune in production.
Claude Code2026-08-16
A Runaway Build Dies Very Differently Under cgroup Than Under ulimit
Claude Code v2.1.233 added opt-in memory cgroup support for Bash tool commands on Linux. Capping virtual address space with ulimit -v and capping physical memory with a cgroup produce completely different failures — and only one of them lets your Node build start at all.
📚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 →