Table of Contents
Key Takeaways
- Put the capture ID in the subagent prompt. Eight characters of text, and the subagent calls
get_captureto pull the app, window title, URL, accessibility tree, cursor position, and your annotation shapes. - Subagents inherit MCP tools, and background subagents keep all of them. Claude Code runs subagents in the background by default as of v2.1.198, and a background subagent loses most built-in tools while keeping every MCP tool.
- A 4K screenshot costs 4,784 visual tokens. Anthropic prices that at roughly $23.92 per thousand images at Claude Opus 5 input rates. Five agents reading the same capture pay it five times.
- Claude does not receive image metadata. Anthropic's vision docs say so directly, which is why XMP inside a pasted PNG is invisible and the banner has to be composited into pixels.
- A
tools:allowlist silently drops MCP tools. UsedisallowedToolswhen you want to restrict a subagent without cutting it off from your captures. - The ID is stable, the sensitive fields are not. Accessibility trees and dev context purge 24 hours after capture by default, adjustable from one hour to never.
- Nothing leaves the Mac. The Stash MCP server listens on a Unix domain socket, so the agent asking for a capture is talking to your machine.
Paste the ID
Every Stash screenshot carries an eight-character capture ID in its banner. Something like #7F3A9C21. Put that string in the prompt you hand a subagent and the subagent resolves it over MCP:
Review the layout in Stash capture #7F3A9C21 against
docs/design/spec.md. Call mcp__stash__get_capture first.
The subagent gets the app name, the bundle ID, the window title, the browser URL if there was one, the macOS version, the display resolution and scale factor, the light or dark appearance, the active file path and cursor position if it was an editor, the full accessibility tree of that window, and the arrows and rectangles you drew as geometric shapes rather than baked pixels. None of it enters your main conversation. You paste 40 characters, not a megabyte.
This is worth doing because of what a subagent actually is.
What a Subagent Inherits
The Claude Code documentation is specific:
"Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions."
Its own context window. So the screenshot you pasted three turns ago upstream is not in it. The subagent starts with the prompt text you hand it and nothing else from your conversation.
Tools work differently. Per the same docs, subagents inherit the built-in tools and MCP tools from the main conversation, then two filters narrow that pool. The second filter is the interesting one for anyone shipping visual work to agents:
"Apart from
AgentandExitPlanMode, which follow the first filter's conditions wherever the subagent runs, a background subagent keeps every MCP tool but only these built-in tools:Read,Grep,Glob,Bash,PowerShell,Edit,Write,NotebookEdit,WebFetch,WebSearch,TodoWrite,Skill,ToolSearch,EnterWorktree,ExitWorktree,Monitor,TaskStop,SendMessage, andArtifact."
Background is the default as of Claude Code v2.1.198. So the tool channel that survives the trimming, unchanged, is MCP. That is the channel to build on.
| Carried into a subagent | Status |
|---|---|
| Your main conversation history | No. Separate context window. |
| An image you pasted upstream | No. It lived in the window the subagent does not share. |
| Built-in tools | Partly. Background subagents keep a fixed subset. |
| MCP tools | Yes. Background subagents keep every one of them. |
| An eight-character ID in the prompt | Yes. It is just text. |
The same reasoning applies one level up. Claude Code now ships background agents and agent teams, where several sessions run at once and report to one place. Every one of those has its own window too.
The Token Math on Re-Pasting
Re-pasting the image into each subagent works. It is just expensive, and the cost is documented precisely. Claude views images in 28x28 pixel patches, so an image costs ⌈width / 28⌉ × ⌈height / 28⌉ visual tokens. Anthropic publishes the table:
| Capture size | Downscaled to | Visual tokens |
|---|---|---|
| 1000x1000 px | Not resized | 1,296 |
| 1920x1080 px | Not resized | 2,691 |
| 2000x1500 px | Not resized | 3,888 |
| 3840x2160 px | 2576x1449 px | 4,784 |
Those are the high-resolution tier numbers, which apply to Claude 4.7 and later models. Anthropic's own note: "High-resolution images can use up to roughly three times more visual tokens than the same image on a standard-tier model." At Claude Opus 5's $5 per million input tokens, the docs put a 4K image at about $23.92 per thousand.
Now fan out. Five subagents reviewing one 4K capture is 23,920 visual tokens spent before any of them has reasoned about anything. Run that loop thirty times in a day and you are paying for 3.6 million visual tokens of the same handful of screens.
A Stash accessibility tree for a typical app window runs 1 to 5 KB of structured text, roughly 250 to 1,200 tokens. It carries pristine button labels, text field contents, and menu items instead of an OCR guess at them. Ten of those cost less than one 4K image, and they are the part the model was going to try to extract from the pixels anyway.
The image is still there if an agent wants it. get_capture and get_bundle return absolute file paths, so a subagent pulls the actual picture into context only when it decides it needs to look.
Claude Does Not Read Image Metadata
From the FAQ in Anthropic's vision documentation, verbatim:
Does Claude read image metadata? "No, Claude does not parse or receive any metadata from images passed to it."
That one line settles a design question. You cannot embed context in a PNG and expect a pasted image to carry it. EXIF, XMP, sidecars, all of it is dropped at the door.
So Stash does two things instead. The context banner is composited into the pixels, where the model reads it as ordinary text in the image. And the structured payload, the XMP fields and the accessibility tree and the dev context, is served over MCP where it is text from the start and never had to survive an upload.
The capture ID is the hinge between the two. It is printed in the banner, so an agent looking at the pasted picture can read the ID and then go fetch everything the picture could not carry. A human reading the same screenshot in Slack can do it too.
What Comes Back
Stash exposes five MCP tools on a local server. They are built to be called in that order: triage cheap, fetch once.
| Tool | Returns | Rough cost |
|---|---|---|
list_recent(n) |
Newest-first summaries of the last N captures, up to 500 | ~100 tokens per capture |
search(query) |
Substring match across app name, window title, bookmark name, text content, browser URL | IDs and snippets only |
get_capture(id) |
Full screenshot dossier: app, window, URL, OS, display, appearance, annotation shapes, accessibility tree, dev context | Scales with the tree |
get_bundle(id) |
Video bundle: report markdown, per-frame metadata with app and window transitions, absolute paths to every asset | ~6K tokens for a 5:30 session |
render_plain(id) |
Plain-text rendering for inline paste | Smallest of the five |
A screen recording is where the gap gets wide. No model reads an MP4. A Stash recording ships a markdown report of the session instead: every click with pixel coordinates, drag endpoints, scroll bursts aggregated so 2,000 raw events collapse into about 20 lines, keyboard input with modifiers, every clipboard copy with the literal text you copied, app and window focus transitions, voice transcript inline with timestamps, and up to 30 interaction-anchored key frames with their own timestamps. A 5:30 session with 2,222 interactions produces a roughly 22 KB report. That is a subagent's entire view of a bug reproduction for about 6,000 tokens, plus whatever frames it chooses to open.
Wiring It Up
The installer at yourstash.ai/install-claude.sh configures Claude Code, Claude Desktop, and Cursor in one command. Other MCP clients work through the same stdio bridge pointed at their config file.
Once the server is in your session config, every subagent that inherits MCP tools can reach it. To scope it to one subagent instead, use the mcpServers frontmatter field:
---
name: ui-reviewer
description: Reviews Stash captures against the design spec
disallowedTools: Write, Edit
mcpServers:
- stash
---
Resolve the capture ID in the prompt with get_capture before
looking at anything else. Read the accessibility tree for
element labels rather than guessing from the image. Only open
the screenshot file if the tree leaves something ambiguous.
Note the disallowedTools there. That is deliberate. The tools field is an allowlist, and Anthropic's own example spells out the consequence: a subagent limited to Read, Grep, Glob, and Bash "can't edit files, write files, or use any MCP tools." If you restrict with tools and forget to list your MCP entries, the capture ID in your prompt becomes a string the subagent cannot resolve, and it will happily reason without it. disallowedTools subtracts instead, and keeps the rest of the pool.
Both fields take server-level patterns, so mcp__stash grants or removes every Stash tool at once depending on which field it lands in.
Where This Breaks
Four honest limits.
Plugin subagents ignore the field. The docs state that plugin subagents do not support hooks, mcpServers, or permissionMode, and those fields are dropped when the agent loads. Copy the agent file into .claude/agents/ if you need them.
The socket is local, and that cuts both ways. Stash listens on a Unix domain socket at ~/Library/Application Support/Stash/mcp.sock. Nothing goes over the network, which is the point. It also means an agent running on another machine or in a cloud session cannot resolve a capture ID. IDs are good on the Mac that made them.
Sensitive fields expire. Accessibility trees, selected text, file paths, git branches, and terminal working directories purge 24 hours after capture by default. You can set that anywhere from one hour to never. An ID from last week still resolves to the screenshot and its basic metadata, but the tree may be gone, and a subagent will tell you it got a thinner payload than you expected.
Only approved clients connect. The server enforces a peer-auth allowlist configured in Settings. A new MCP client is not automatically trusted, which is correct and occasionally annoying the first time.
One more thing that is not a limit so much as a direction of travel. The Model Context Protocol shipped revision 2026-07-28 on July 28, which removes the initialize handshake and makes the protocol core stateless. Stateless means each connection carries no memory of the last one. A stable, addressable identifier for the thing you want stops being a convenience at that point and starts being the mechanism.
The Bottom Line
Screenshots are the wrong unit of exchange between you and a fleet of agents. They are expensive per read, they carry no metadata across the API boundary, and they do not cross a context window without being paid for again. An ID is cheap, it is text, it survives every filter Claude Code applies to a background subagent, and it resolves to more information than the picture ever held.
Capture with ⌘⌃S, read the eight characters off the banner, and hand those to whichever agent needs to see what you saw. Download Stash for free and the MCP server is wired into Claude Code and Cursor in one command.
Frequently Asked Questions
Do Claude Code subagents inherit MCP tools?
Yes. The docs state that subagents inherit the built-in tools and MCP tools available in the main conversation, narrowed by two filters. The second filter applies to background subagents, and it keeps every MCP tool while stripping most built-in ones. Since subagents run in the background by default as of v2.1.198, MCP is the tool channel you can count on.
Can a subagent see a screenshot I pasted into the main conversation?
No. Each subagent runs in its own context window, so the image you pasted upstream is not in it. The subagent starts with the prompt you hand it. Either paste the image again into that prompt or give it an identifier it can resolve on its own.
How many tokens does a screenshot cost in an agent session?
A 1920x1080 capture costs 2,691 visual tokens on the high-resolution tier. Claude views images in 28x28 pixel patches, so the cost is ⌈width / 28⌉ × ⌈height / 28⌉. A 3840x2160 capture is downscaled to 2576x1449 and hits the 4,784 token cap, which Anthropic puts at about $23.92 per thousand images at Claude Opus 5 input rates.
Does Claude read XMP or EXIF metadata inside a pasted image?
No. Anthropic's vision docs say Claude does not parse or receive any metadata from images passed to it. That is why Stash composites its context banner into the pixels, where the model reads it as text, and delivers the structured XMP payload separately over MCP.
Where do I find a Stash capture ID?
In the context banner at the bottom of every Stash screenshot, written as #XXXXXXXX. The same ID comes back from list_recent and search. Every capture also carries a stash://bundle/<uuid> URI that resolves across sessions, conversations, and tool restarts.
Does the Stash MCP server send my captures to the cloud?
No. It listens on a Unix domain socket at ~/Library/Application Support/Stash/mcp.sock, so there is no network traffic and no relay. An agent asking for a capture is talking to your Mac, and only MCP clients on your approved list can connect at all.
Will a capture ID still resolve a week later?
The capture resolves, but some fields will be gone. Accessibility trees, selected text, file paths, git branches, and terminal working directories purge 24 hours after capture by default, adjustable from one hour to never in Settings. The screenshot, app, window title, and basic metadata follow your normal history retention.
References
- Create custom subagents, Claude Code documentation. Context windows, tool inheritance filters, background defaults,
mcpServersfrontmatter. - Vision, Claude Platform documentation. Patch tokenization, resolution tiers, token and cost tables, image metadata FAQ.
- Model Context Protocol specification, revision 2026-07-28.
- The 2026-07-28 Specification, Model Context Protocol blog, July 28, 2026.