Pencil for Claude Code
Pencil opens and edits opaque .pen documents using the real hosted editor at https://app.pen.dev. Version 0.7.1 makes the persistent renderer the default under the existing Pencil plugin identity (pencil@pencil). The previous implementation remains on Git branch archive/pre-persistent-pencil-2026-11-17.
The Codex plugin is maintained in its separate repository. This Claude plugin retains its selection context, read-only calls, persistent local document catalog, coordinated saves and per-conversation default scope.
How it works
A supervised Node.js service owns one headless Chrome browser. Every design session gets its own browser context, page and Pen engine. Agents and views work on that same engine. Opening a view does not start a second editor.
- Closing a browser pane disconnects its view; agents can continue editing in the background.
pencil_end releases one agent's participation and keeps the session available.
pencil_close saves, closes the session's views and releases its editor context. It requires the sole remaining participant and no pending work. A failed Save keeps the editor available; an uncertain disposal is blocked rather than reported as success. Success consumes the final lease, so do not call pencil_end afterward.
- A durable closure marker prevents stale automatic recovery from restarting a completed editor. Explicitly open the same document to resume; document contents and node IDs remain persisted, while session and renderer IDs change.
- The shared service and other sessions remain available after a session closes.
Claude Code does not render the plugin's MCP App view. pencil_open returns a private loopback viewUrl: in the Claude desktop app, open it in the built-in Browser pane; in a terminal session, use a browser on the same machine. Unlike the older implementation, keeping that pane visible is not required for engine startup or agent work. A compatible MCP Apps host can also use the packaged view resource.
Installation and service
Install the plugin through Claude Code's supported marketplace flow:
claude plugin marketplace add julien-m/pencil-claude
claude plugin install pencil@pencil
The plugin's stdio entrypoint is dist/pencil.mjs. It does not start or stop services. Its connection defaults to ~/Library/Application Support/Pencil/claude/connection.json; set PENCIL_CONNECTION to use another supervised runtime. The connection is reread on each call, allowing service credential rotation without replaying failed operations. Discovery and the packaged MCP App remain available while the service is offline.
The service requires Node.js 22+, Chrome and playwright-core. On a source installation, use Bun to install dependencies and build, then register the following executable and arguments with Localhost Supervisor:
node /absolute/path/pencil/dist/persistent-service.mjs <port> <chrome-executable> <private-runtime-directory>
Use ~/Library/Application Support/Pencil/claude as the normal private runtime. The installed plugin package needs no compiler or development dependencies; the separately supervised service runs from the canonical checkout with its dependencies. Manage this service as permanent with autostart and restart on failure. Never publish its connection token or private view URLs.
The engine is hosted and requires network access; it is not redistributed and does not work offline. PENCIL_EDITOR_WAIT_MS configures the service's readiness wait (20 seconds by default).
Tools and collaboration