Overview
Define a project subagent in Claude Code that takes a blog post title and writes a branded HTML cover page with a button that saves the cover as a PNG image.
Problem or Objective
- Which agents can create images by running image-generation models or workflows for you?
- How do teams design the context, tools and memory of their own AI agents?
More in Content and Media
AI Agents and Models
Tools and Integrations
- Tools
- Claude Code
- Prerequisites
- Claude Code with access to your blog repository, your brand fonts and logo files, and a browser to open the HTML covers and export PNGs.
How It Works
In your blog repository, ask Claude Code to create a project subagent in .claude/agents and show you the file for review before saving it, or write the Markdown file yourself. In its frontmatter give it a name, a description that says it makes cover layouts from post titles, and only the file reading and writing tools it needs. In the system prompt, set your brand rules: canvas size, colours, fonts, logo file and where the title sits. Tell it to write one self-contained HTML file per post in a covers folder, with a button that renders the cover area to a PNG file in the browser using a client-side library you choose. Then ask Claude Code to use the subagent for a new post title, open the HTML file in your browser, check the layout and click the button to save the PNG. Review the generated file before committing it.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Claude Code.
- Connect the toolsConnect the tools this workflow relies on: Claude Code.
- Check the prerequisitesClaude Code with access to your blog repository, your brand fonts and logo files, and a browser to open the HTML covers and export PNGs.
- Gather your detailsCollect what the prompt asks for: Subagent name, Folder for cover files, Cover size in pixels, Brand colours, Font, Logo file, First post title.
- Run the starter promptPaste the starter prompt below into Claude Code and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at code.claude.com before you rely on it.
Practical Starter Prompt: Create a cover layout subagent
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
Create a project subagent named [Subagent name] that turns a blog post title into a cover. It writes one self-contained HTML file per post in [Folder for cover files], sized [Cover size in pixels], using colours [Brand colours], the font [Font] and the logo at [Logo file]. The page has a button that saves the cover area as a PNG named after the post slug. Give it only file reading and writing tools. Show me the subagent file for review before saving it, then run it for the title [First post title].Run this in Claude Code inside your blog repository. Read the subagent file before you save it, open each generated HTML file in a browser to check it, and commit covers only after you have looked at the exported PNG.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. The Claude Code pages document project subagents as Markdown files with a custom system prompt and limited tools, and Claude Code reading and editing files in a codebase. No cited page shows a cover layout or a PNG export, so the quality of the layouts and whether the export works in your browser are untested here.
Limitations and Considerations
No cited page covers PNG export, so check the client-side library you choose and test the export button in the browsers you use before relying on it. A subagent also sends its own requests, which count toward the same usage limits as your main conversation. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Official Website
The official site of the main tool or project in this use case.
Visit Website (opens in a new tab)code.claude.com
Related Videos
About anthropics/claude-code
The SECRET Claude Code Upgrade That Has Everyone Going Nuts (Full Guide) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)About anthropics/claude-code
The only Claude Code guide you'll ever need (Opus 4.5) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- Create custom subagents - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 26 Nov 2026, 23:47 UTC
What this source supports
- Subagents are Markdown files with YAML frontmatter.
- Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions.
- Project subagents ( .claude/agents/ ) are ideal for subagents specific to a codebase.
- Overview - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 11:57 UTC
What this source supports
- Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools.

