preview

preview is a command for Claude Code from jamditis/claude-skills-journalism. It costs 6 tokens per session (1,442 once invoked), scanned C, original, MIT.

An interactive browser preview command for editing a document's design in a local web page. It serves the document and opens controls for trying visual changes.

In plain words
What is it for?
Use it to preview an HTML document, test design changes, and take screenshots during document editing.
Why use it?
It lets you inspect and adjust a document's appearance in a browser while you work.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the pdf-playground plugin — 1 skill, 8 commands shipped together

Good fit Use it to preview an HTML document, test design changes, and take screenshots during document editing.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add jamditis/claude-skills-journalism
Claude Code
/plugin install pdf-playground

Made for: Claude Code.

Or install pdf-playground, the plugin that ships this one along with the rest of its 1 skill, 8 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for preview

README.md
[![agentmods](https://agentmods.dev/badge/commands/jamditis/claude-skills-journalism/preview/github.svg)](https://agentmods.dev/commands/jamditis/claude-skills-journalism/preview)
Your own site
<a href="https://agentmods.dev/commands/jamditis/claude-skills-journalism/preview"><img src="https://agentmods.dev/badge/commands/jamditis/claude-skills-journalism/preview/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for preview

Your own site · 80×15
<a href="https://agentmods.dev/commands/jamditis/claude-skills-journalism/preview"><img src="https://agentmods.dev/badge/commands/jamditis/claude-skills-journalism/preview.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,442 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00006 $0.01442
Opus 5 $0.00003 $0.00721
Sonnet 5 $0.00001 $0.00288
Haiku 4.5 $0.00001 $0.00144

Measured 9d ago against content hash 06a0d38f5617, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

preview scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf <html-dir>/playground-controls <html-dir>/playground-wrapper.html
pdf-playground/commands/preview.md · 172 lines

How it starts

The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Launch an interactive preview session for iterating on a document design.

Setup

  1. Read the document-design skill for guidance
  2. Resolve the HTML file path (see "File path" below)
  3. Start a local HTTP server to serve the file
  4. Set up the playground wrapper and controls
  5. Open the wrapper in the Playwright browser

Pre-flight check

Before proceeding, verify the control panel files exist:

  1. Check if the controls directory exists:
    ls "${CLAUDE_PLUGIN_ROOT}/controls/control-panel.js" 2>/dev/null && echo "OK" || echo "MISSING"
    
  2. If MISSING, tell the user:

    Your PDF Playground plugin is outdated and missing the interactive control panel. Run this command to update, then restart Claude Code:

    claude plugin update pdf-playground@claude-skills-journalism
    
    Then STOP, do not continue with the preview workflow.

Preview workflow

Step 1: Start local server

The Playwright browser cannot open file:// URLs. Start a local HTTP server instead:

  1. Determine the directory containing the HTML file
  2. Check if port 8787 is available:
    python -c "import socket; s=socket.socket(); s.settimeout(1); result=s.connect_ex(('127.0.0.1',8787)); s.close(); print('free' if result!=0 else 'busy')"
    
  3. If port 8787 is busy, try 8788, 8789, etc. until one is free
  4. Start the server in the background:
    cd <directory-containing-html> && python -m http.server <port>
    
    Run this with run_in_background: true
  5. Wait 1 second for the server to start

Step 2: Set up the playground wrapper

The playground uses an iframe-based architecture: the document lives in an iframe, and the control panel sits alongside it as a sidebar. This keeps the document HTML clean for PDF export while providing interactive design controls.

  1. Create a playground-controls/ directory in the same directory as the HTML file
  2. Copy the control files from the plugin:
    mkdir -p <html-dir>/playground-controls/template-maps
    cp ${CLAUDE_PLUGIN_ROOT}/controls/control-panel.css <html-dir>/playground-controls/
    cp ${CLAUDE_PLUGIN_ROOT}/controls/control-panel.js <html-dir>/playground-controls/
    cp ${CLAUDE_PLUGIN_ROOT}/controls/prompt-generator.js <html-dir>/playground-controls/
    
  3. Detect which template is being previewed and copy the matching template map:
    cp ${CLAUDE_PLUGIN_ROOT}/controls/template-maps/<template-name>.js <html-dir>/playground-controls/template-maps/
    
  4. Copy the wrapper HTML to the same directory as the HTML file:
    cp ${CLAUDE_PLUGIN_ROOT}/controls/playground-wrapper.html <html-dir>/
    

Read the full file on GitHub · 172 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 172 lines · 6 tokens per session scan C 06a0d38f5617

Subscribe to this mod's changes

preview is a command published in the GitHub repository jamditis/claude-skills-journalism (389 stars, last pushed yesterday), licensed MIT. It adds 6 tokens to every session and 1,442 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.