[FEATURE] Expose openMarkdownPreview as a standalone tool for skills and custom workflows

Resolved 💬 3 comments Opened Mar 24, 2026 by khitish-agrawalla Closed May 9, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

The plan preview with commenting UI (webview panel with text selection → inline comments → numbered badges) is only triggered through the ExitPlanMode tool, which requires being in plan mode.

This means custom skills that manage their own planning workflows cannot use the preview. For example, we have a /r-plan skill that writes plans to package-level .plans/ directories (e.g., packages/auth/.plans/add-sso.md). It can't use plan mode because plan mode restricts available tools (no Write, Edit, Bash, Agent), and the skill needs those tools for codebase exploration before writing the plan.

The only way to get the commenting UI today is EnterPlanModeExitPlanMode, but that's not usable by skills that need unrestricted tool access during planning.

Proposed Solution

Expose a new tool (e.g., OpenPreview) that triggers the same plan preview webview panel without requiring plan mode:

OpenPreview(filePath: string, commentsEnabled?: boolean)
  • Reads the markdown file at filePath
  • Opens the same preview webview (with "Ready for review" banner, text selection, commenting)
  • Comments flow back to the conversation context (same as plan mode comments)
  • Works independently of plan mode — no need to call EnterPlanMode first

Alternative Solutions

  1. Enter plan mode briefly just to exit — Call EnterPlanMode after the skill finishes its work, immediately call ExitPlanMode to trigger the preview. Works but clunky: requires user consent, and plan mode restricts tools so all exploration must happen beforehand.
  2. File watcher on plansDirectory — Auto-open preview for any .md written there. Doesn't generalize to arbitrary paths and adds filesystem watcher complexity.
  3. Separate VS Code extension — Replicate the webview UI in a standalone extension. Fragile, duplicates code, and comments can't flow back to Claude's conversation.

Priority

Medium - Would be very helpful

Feature Category

Developer tools/SDK

Use Case Example

  1. User invokes /custom-plan skill to plan a new feature
  2. The skill explores the codebase using Agent/Grep/Read tools (needs unrestricted tool access — can't be in plan mode)
  3. Skill writes the plan to packages/my-feature/.plans/design.md
  4. Skill calls OpenPreview("packages/my-feature/.plans/design.md", commentsEnabled: true)
  5. VS Code opens the same preview panel with the commenting UI
  6. User selects text, adds inline comments (e.g., "consider using X instead")
  7. Comments flow back to the skill's conversation context
  8. Skill incorporates feedback and updates the plan

Other use cases: design doc review, RFC feedback, code review summary commenting.

Additional Context

  • The plansDirectory setting already supports relocating plans (verified in CLI source). This proposal decouples the preview UI from the plan mode workflow.
  • The openMarkdownPreview RPC already exists internally — this would expose it as a first-class tool rather than an internal-only mechanism.
  • The webview implementation (HTML sanitization, comment storage, mark elements with numbered badges) wouldn't need changes — only the triggering mechanism needs a new entry point.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗