Print from Claude Code: a skill for AI agents and agents.md
Let Claude Code, Codex or another AI agent print PDFs: with a printer API URL, as a Claude Code skill or through AGENTS.md. Works for ChatGPT output too.
حُدّث في 22 أكتوبر 2026
AI agents like Claude Code read files, call APIs and write documents on their own. What they cannot do is reach the printer in your office. With Sealed Print you give the agent one secret URL. Everything it sends there becomes a print job: a PDF it downloaded from another system, or a report it created itself. This article shows the setup for Claude Code step by step, then for Codex CLI, Antigravity CLI, GitHub Copilot and Cursor, and explains why chat assistants like ChatGPT need a detour.
How an AI agent prints with Sealed Print
Coding agents such as Claude Code have a shell. They can run curl, and that is all printing takes:
- In Sealed Print you create an API endpoint. It has a secret URL, the endpoint URL, and a target: a printer, a group of printers, or no target at all.
- You give the agent that URL, best as an environment variable.
- The agent sends a PDF, JPEG or PNG to the URL with an HTTP POST. Sealed Print puts it into the queue and delivers it to the printer, for example through the relay client on a computer in the office.
The agent never needs network access to the printer, no driver and no VPN. It only needs to reach
www.sealedprint.com over HTTPS. The URL itself is the key: it can submit documents, nothing else. It cannot read
your queue, change settings or see other documents.
Prerequisites
- A Sealed Print account. The Free plan is enough to try it; see pricing.
- A printer that Sealed Print reaches, for example through the relay client on a Windows, macOS or Linux computer in the same network as the printer.
- The inbound channel REST API is switched on under Settings → Inbound channels. It is on for new organizations.
- An agent that can run shell commands with network access: Claude Code, Codex CLI, Antigravity CLI, GitHub Copilot agent mode, Cursor or similar.
Step 1: Create an API endpoint for the agent
- Go to Sources → API endpoints and select New API endpoint.
- Enter a Name, for example "Claude Code".
- Choose the Target:
- a printer, if the agent should print directly;
- No target – keep in Sealed Print, if you want to check every document before it prints. The job waits in the queue until you send it. For a first test with an agent this is the safest choice.
- Select Create and copy the Endpoint URL. It looks like
https://www.sealedprint.com/api/print/sp_ep_….
Give each agent its own endpoint. Then Last used shows which agent printed, and you can replace one URL with Generate new URL without touching the others. Details are in the guide API endpoints.
Step 2: Print from Claude Code
Give Claude Code the URL
Do not paste the URL into a file that ends up in Git. Put it into an environment variable before you start Claude Code:
export SEALEDPRINT_PRINT_URL="https://www.sealedprint.com/api/print/sp_ep_…"
claude
Or store it in .claude/settings.local.json in your project, which stays on your computer and out of the repository:
{
"env": {
"SEALEDPRINT_PRINT_URL": "https://www.sealedprint.com/api/print/sp_ep_…"
}
}
Tell Claude Code how to print
Add a short section to the CLAUDE.md of your project, so Claude Code knows the convention in every session:
## Printing
To print a document, send the PDF to the Sealed Print URL in $SEALEDPRINT_PRINT_URL:
curl -sf -X POST "$SEALEDPRINT_PRINT_URL" -F "file=@document.pdf" -F "name=<short title>"
Optional form fields: copies, sides (one-sided, two-sided-long-edge), colorMode (color, monochrome).
The response is the job as JSON; report its number and state.
That is all. Now you can ask in plain language:
- "Download the invoice PDF from our ERP export folder and print it twice."
- "Write a one-page summary of today's test failures as a PDF and print it."
- "Print the delivery notes for all orders in
orders.csv."
Claude Code fetches or creates the PDF with the tools it has, for example a script, a converter such as Pandoc, a
headless browser or an MCP server for your document storage, and then runs the curl command. The answer from Sealed
Print contains the job with its number and state, so Claude Code can tell you what happened.
As a Claude Code skill: /print
Instead of CLAUDE.md you can package printing as a skill. Claude Code loads a skill on its own when your request
matches its description, and you can call it with /print. Create .claude/skills/print/SKILL.md in the project, or
~/.claude/skills/print/SKILL.md to have the skill in every project:
---
name: print
description: Prints PDFs, images or documents you create through Sealed Print. Use when the user wants something printed.
allowed-tools: Bash(curl -sf -X POST *)
---
1. If the document is not a PDF, JPEG or PNG, create a PDF first.
2. Send it to the URL in $SEALEDPRINT_PRINT_URL:
curl -sf -X POST "$SEALEDPRINT_PRINT_URL" -F "file=@<file>" -F "name=<short title>"
3. Optional form fields: copies, sides (one-sided, two-sided-long-edge), colorMode (color, monochrome).
4. Report the job number and state from the JSON response.
allowed-tools lets exactly this curl call run without a prompt while the skill is active. A team shares the skill
through the repository; the URL still stays in each person's own environment variable.
Permissions and sandbox
- Permission prompt: Claude Code asks before it runs a shell command. Choose "Yes, and don't ask again" for the
curlcommand, or add an allow rule such asBash(curl -sf -X POST *)to your settings. A narrow rule is safer than allowing every command. - Sandbox: if you switched on the Claude Code sandbox, shell commands only reach domains on your list. Add
www.sealedprint.comundersandbox.network.allowedDomains, or approve the domain when Claude Code asks the first time. - Not the same thing:
claude -porclaude --printruns Claude Code without the interactive interface. It prints the answer to the terminal, not on paper.
Step 3: Other AI agents
The same URL works with every agent that can send an HTTP request with a file. What differs is where you put the instructions and how you allow network access.
| Agent | Where the instructions go | What to allow |
|---|---|---|
| Claude Code | CLAUDE.md or a skill | curl, and www.sealedprint.com if the sandbox is on |
| OpenAI Codex CLI | AGENTS.md | network access in the sandbox |
| Antigravity CLI (formerly Gemini CLI) | project instructions (Gemini CLI used GEMINI.md) | approve the shell command |
| GitHub Copilot agent mode | AGENTS.md or .github/copilot-instructions.md | approve the terminal command |
| Cursor | AGENTS.md or project rules | approve the terminal command |
| ChatGPT, Claude.ai, Gemini (chat) | not directly, see below | – |
One instruction for all agents: AGENTS.md
AGENTS.md is an open standard for instructions to coding agents. Codex reads it, and so do Cursor, GitHub Copilot and
many other tools. If you work with several agents, write the printing section once into the project's AGENTS.md.
Claude Code reads CLAUDE.md instead; the line @AGENTS.md there imports the file. That keeps the instruction in one
place, which answers the usual question of CLAUDE.md vs AGENTS.md: use both, with one source.
OpenAI Codex CLI
Codex CLI reads instructions from AGENTS.md in the project, so the printing section from above goes there. In its
default sandbox, workspace-write, network access is off. Switch it on in ~/.codex/config.toml:
[sandbox_workspace_write]
network_access = true
Then export SEALEDPRINT_PRINT_URL before starting codex. Codex asks for approval when a command needs more than
the sandbox allows; approve the curl command.
Antigravity CLI (formerly Gemini CLI)
Google moved Gemini CLI into the Antigravity CLI (agy) in 2026; it still reads its configuration from ~/.gemini/.
Put the printing section into the project instructions (Gemini CLI read them from GEMINI.md; check /config in the
version you use) and export the URL. By default the
CLI pauses before shell commands; approve the curl call once. If you run it in a sandbox, allow
www.sealedprint.com there as well.
GitHub Copilot agent mode and Cursor
Both run commands in the integrated terminal and ask before they do. In VS Code you can allow a command prefix with
the setting chat.tools.terminal.autoApprove; in Cursor you approve or allowlist commands in the agent settings. The
instructions go into .github/copilot-instructions.md or the Cursor project rules. Set SEALEDPRINT_PRINT_URL in
your shell profile or the terminal environment of the editor, not in a committed file.
ChatGPT, Claude.ai and other chat assistants
Chat assistants in the browser have no shell on your computer. Their code sandboxes usually block outgoing
connections, and custom actions in ChatGPT send files as short-lived download links in JSON instead of as an upload,
which the Sealed Print endpoint does not accept. On Claude Team and Enterprise, admins can allow extra domains for
code execution under Organization settings → Capabilities; whether a request to www.sealedprint.com gets
through depends on that setting.
Two reliable ways remain:
- Use the coding agent of the same company: Codex instead of ChatGPT, Claude Code instead of Claude.ai.
- Put an automation tool in between. In n8n an AI Agent node can call the HTTP Request node as a tool, with any model from OpenAI, Anthropic or Google. Make and Zapier work the same way.
Print ChatGPT answers and documents
Often the point is not that the AI prints by itself, but a result from the chat: a letter, a table, a summary. On a computer the browser prints the page with Ctrl+P or Cmd+P, but that prints the whole conversation. A cleaner way:
- Ask ChatGPT, Claude or Gemini to create the result as a PDF and download the file.
- Print the PDF through Sealed Print, also from your phone to the printer in the office:
- on a computer through the Sealed Print printer URL, like from any program,
- in the web app with Add document in the queue,
- on Android with Share and then Sealed Print, straight from the app,
- on an iPhone by forwarding the file to your Sealed Print email address or uploading it in the web app.
The guide Upload and share explains printing from a phone in detail.
Advanced: an API token for complex scenarios
For most setups one endpoint per agent is enough. If an agent should organize printing on its own, for example create a separate endpoint per project, choose among printers by name and follow each job until it is printed, give it an API token instead:
- Go to Settings → API tokens and select New token.
- Choose the Permissions User and an Expiration, for example 30 days.
- Store the token as
SEALEDPRINT_API_TOKENand describe the API to the agent. The API reference has an OpenAPI description that agents read well.
With the token the agent can list the printers it may use, create its own endpoints and check jobs:
curl -s "https://www.sealedprint.com/api/destinations" \
-H "Authorization: Bearer $SEALEDPRINT_API_TOKEN"
curl -s -X POST "https://www.sealedprint.com/api/api-endpoints" \
-H "Authorization: Bearer $SEALEDPRINT_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Project Alpha","noTarget":true}'
The token itself never submits documents; printing always goes through an endpoint URL. A token acts with your rights, so give it the role User and an expiration date. Do this only when the scenario needs it.
Safety checklist
- Start with No target – keep in Sealed Print, so you see every document before it prints. Switch to a printer once you trust the setup.
- Agents that read emails or web pages can be tricked by text in those sources. A fixed target and the queue limit what such a prompt could do.
- Keep the URL in an environment variable or local settings, never in a repository.
- If the URL ends up somewhere it should not be, select Generate new URL; the old one stops working at once.
Frequently asked questions
Can Claude Code print directly to my office printer?
Not on its own: Claude Code runs on your computer or in the cloud and has no driver for your office printer. With a Sealed Print endpoint URL it sends the PDF over HTTPS, and Sealed Print delivers it to the printer through the relay client or directly.
Does this work with ChatGPT?
Not directly in the chat, because ChatGPT cannot upload a file to an external URL from the conversation. Use Codex, OpenAI's coding agent, or let an n8n workflow with an AI Agent node do the printing.
How do I print a ChatGPT conversation or answer?
Ask ChatGPT to put the answer into a PDF, download it and print it. With Sealed Print that works from your phone to the office printer too, by upload in the web app or by email to your Sealed Print address.
Do I need an MCP server to print from Claude Code?
No. One curl call to the endpoint URL is enough. MCP servers do help the agent fetch documents, for example from
Google Drive, a document management system or a mailbox, which it then prints.
Which file types can the agent print?
PDF, JPEG and PNG. Agents usually create a PDF first, for example from Markdown, HTML or with a script, and send that.
Does claude --print print a document?
No. The flag runs Claude Code without the interactive interface and writes the answer to the terminal. Printing on paper needs a printer URL such as a Sealed Print endpoint.
What does it cost?
Creating API endpoints and API tokens is included in every plan. Each document delivered to a printer counts as a delivery of your plan; details are on the pricing page.