Skip to content

Add md-view: read Markdown files in a side pane - #4

Merged
scoobynko merged 14 commits into
mainfrom
feat/md-view-mod
Oct 2, 2026
Merged

scoobynko merged 14 commits into
mainfrom
feat/md-view-mod

Conversation

@scoobynko

Copy link
Copy Markdown
Owner

What

A new mod, md-view, for reading Markdown files without leaving Claude Code.

  • Click: a .md path Claude mentions in a reply becomes a link. A single click opens the file rendered in a pane docked on the right. Ctrl- or alt-click keeps the terminal's own behaviour.
  • /md-view: lists every Markdown file that has come up in the session, newest first. Arrows and Enter pick one; the last file viewed is marked and holds the focus.
  • /md-view <path>: previews that file directly.
  • The open preview updates when Claude edits the file.

Replies that mention no Markdown file are left to the engine and look exactly as before.

How

  • hooks/register.tsx: the hooks. Files are collected from each model step (Claude's text, tool inputs, shell commands) and after Write, Edit and Bash calls. Two render hooks read that state: AssistantMessage redraws a reply with pressable file:// links, Pane draws the list or the file.
  • hooks/paths.ts: finds .md paths in text and rewrites them into links, leaving code fences, code spans, URLs and unknown files alone.
  • hooks/document.ts: prepares a file for the pane: caps it at 60,000 characters, turns front matter into a yaml block, stacks tables wider than the pane, sets fenced code blocks apart under their language, and splits the text into pieces the Markdown element accepts.

Limits

  • Clicks reach the mod in the fullscreen terminal; elsewhere the paths are ordinary file:// links and /md-view still works.
  • Links appear when a reply block finishes, and only in the block that opens a reply.
  • macOS and Linux paths only.
  • Other surfaces (desktop, VS Code) are covered by tests but were not tried live.

Checks

  • claude plugin validate plugins/md-view
  • claude plugin test plugins/md-view: 66 pass
  • tsc -p plugins/md-view --noEmit: clean
  • image-preview (76) and clawd-spinner (8) tests still pass after merging main
  • Tried live in a fullscreen terminal: click, list, direct path, refresh on edit, large file, narrow terminal

🤖 Generated with Claude Code

scoobynko and others added 14 commits October 2, 2026 20:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scoobynko
scoobynko merged commit ffae17d into main Oct 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant