Ask a coding agent for a custom Gutenberg block the React way and it has a lot to get right: an edit.js, a save or render, the block's attributes, the build config, and markup that has to match in two places. It often works, but it's slow to check and easy to break.
With Gutenberg Control Blocks (GCB), a block is three plain files: block.json, a block.fields.json listing its fields, and a render.php template. That's a format Claude Code can read and write reliably, and there's nothing to build before you can see the result.
Give it the docs
Every page of the GCB docs is published for models as well as people:
llms.txtlists every page.llms-full.txtis all of them in one plain-text file, including the full field reference.
Point Claude Code at one of them before it writes a block. Something like this, in your theme's folder:
Read https://gutenbergcontrolblocks.com/llms-full.txt, then make a GCB blockin blocks/team-member: a photo, a name, a role and up to three social links.The name and role should be editable on the page. Match the theme's styles.What it writes
Claude Code writes the block folder like any other code:
block.json: WordPress's standard block metadata.block.fields.json: the fields, each a known type, likeimage,text, or arepeaterof links with amaxof 3.render.php: the template, withdata-gcb-fieldon the parts your client edits on the page.
Refresh the editor and the block is in the inserter. If something's wrong, you can see it straight away, and so can Claude Code if you give it a screenshot. The files are short enough to read in a review.
Why it works well with agents
- Fields are typed. A field is one of 42 documented types, each with a known value shape. The agent picks a type from the reference instead of inventing a control.
- One template. The editor and the page use the same
render.php, so there's no second copy of the markup to drift. - Rules live in the files. Validation, list limits and allowed blocks are written in
block.fields.jsonand the template, so your client can't save a page that breaks them, whoever wrote the block. - No build. No npm install or webpack to set up or break.
- Scaffolding from a spec. An agent can also pipe a JSON spec to WP-CLI and get the same files as the admin's + New button. See CLI scaffolding.
Your clients still get the real editor
What Claude Code builds is a standard WordPress block. Your client edits it in the block editor they already know: typing on the page, swapping photos with a focal point, and filling fields that only offer your theme's colours and spacing.
More in the docs: Using GCB with AI agents and the Quickstart.