modscode JA

modscode / Gallery / shot-view

shot-view

收集 Claude 截下或查看的 PNG,ctrl+x s 在侧边面板里看图;n/p 翻页,按住 o 在终端里放大、松开收起,轻按 o 用快速查看打开;看过的按 r 标为已读就不再出现(u 撤销)

Code you can checkTerminal + desktopPaneBandBoxButtonText

What it does

  • Draws a band above the prompt, a pane
  • Adds /shots
  • Watches tool calls
  • Hooks session.start
  • Starts processes

Good points

  • No network calls
  • Written in TypeScript
  • Has a desktop-specific branch
  • Writes no files

Code to start from

Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.

Starter (register.tsx)

register.tsx
import type { Register } from 'claude-code'

// Drawn like shot-view by Bearisbug (pane, band), as modscode read it from the mod's code:
// https://modscode.com/gallery/bearisbug-shot-view/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
  // the band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Text } = $.ui.resolve(e)
    const head = '…'
    const tail = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" gap={1}>
          <Box flexShrink={0}>
            <Text color="ide" bold>
              ▍截图
            </Text>
          </Box>
          <Text wrap="truncate-end">
            {head}
          </Text>
          <Text dimColor wrap="truncate-end">
            {tail}
          </Text>
        </Box>
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "截图" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const basename = '…'
    const at = '…'
    const length = '…'
    const readCount = '…'
    const via = '…'
    const width = '…'
    const height = '…'
    const path = '…'
    const gone = '…'
    const alt = '…'
    return (
      <Box flexDirection="column" paddingX={1}>
        <Box flexDirection="row" gap={1}>
          <Text bold>
            {basename}
          </Text>
          <Text color="suggestion">
            {"未读 "}
            {`${at}1`}
            /
            {length}
          </Text>
          <Text dimColor>
            {"已读 "}
            {readCount}
          </Text>
          <Text dimColor>
            刚刚
            {" · "}
            {via}
            {" · "}
            {width}
            ×
            {height}
          </Text>
        </Box>
        <Text dimColor wrap="wrap">
          {path}
        </Text>
        <Text dimColor>
          {"另有 "}
          {gone}
          {" 张截图的文件已不在(被删除或移走),不再显示"}
        </Text>
        <Text dimColor>
          {alt}
        </Text>
        <Box flexDirection="row" gap={2}>
          <Button plain hotkey="n">
            下一张
          </Button>
          <Button plain hotkey="p">
            上一张
          </Button>
          <Button plain hotkey="r">
            标为已读
          </Button>
          <Button plain hotkey="u">
            撤销已读
          </Button>
        </Box>
        <Box flexDirection="row" gap={2}>
          <Button plain hotkey="o">
            按住放大 · 轻按快速查看
          </Button>
          <Button plain hotkey="f">
            Finder
          </Button>
          <Button plain hotkey="y">
            复制路径
          </Button>
        </Box>
        <Text dimColor>
          从最新一张开始,n 往后看更早的;看过、不需要再看了就按 r,它不会再出现,只是翻过不算已读
        </Text>
        <Text dimColor>
          Esc 或 ctrl+x s 关闭(面板开着时 Esc 只关面板,不会中断 Claude)
        </Text>
      </Box>
    )
  })
}

The mod's own code

Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.

shot-view/hooks/register.tsx lines 283–312 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const below = await next(e)
    if (!hint) return below
    const unread = unreadOf(await read($, shots))
    const live = await present($, unread)
    drawn = keyOf(live)
    // 提示的那张不在了就换成还在的最新一张;一张都不在了就不再提示
    if (!live.has(hint)) hint = unread.find(s => live.has(s.path))?.path ?? null
    if (!hint || e.props.hasSurvey) return below
    const { Box, Text } = $.ui.resolve(e)
    const line = bandLine(basename(hint), live.size, e.props.bodyColumns)
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" gap={1}>
          <Box flexShrink={0}>
            <Text color="ide" bold>
              {BAND_LABEL}
            </Text>
          </Box>
          <Text wrap="truncate-end">{line.head}</Text>
          {line.tail !== '' && (
            <Text dimColor wrap="truncate-end">
              {line.tail}
            </Text>
          )}
        </Box>
        {below}
      </Box>
    )
  })
shot-view/hooks/register.tsx lines 314–434 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const list = await read($, shots)
    const unreadAll = unreadOf(list)
    const live = await present($, unreadAll)
    drawn = keyOf(live)
    const unread = unreadAll.filter(s => live.has(s.path))
    const gone = unreadAll.length - unread.length
    const readCount = list.length - unreadAll.length
    const at = Math.min(await read($, index), Math.max(0, unread.length - 1))
    const shot = unread[at]
    const undo = (
      <Button key="undo" plain hotkey="u" onPress={() => void undoRead($)}>
        撤销已读
      </Button>
    )
    const closeHint = <Text dimColor>Esc 或 ctrl+x s 关闭(面板开着时 Esc 只关面板,不会中断 Claude)</Text>
    const goneNote = gone > 0 && <Text dimColor>另有 {gone} 张截图的文件已不在(被删除或移走),不再显示</Text>
    if (list.length === 0) {
      return (
        <Box paddingX={1}>
          <Text dimColor>还没有截图。Claude 截图或查看 PNG 后会出现在这里。</Text>
        </Box>
      )
    }
    if (!shot) {
      return (
        <Box flexDirection="column" paddingX={1}>
          <Box flexDirection="row" gap={1}>
            <Text color="success">✓</Text>
            <Text bold>{readCount === 0 ? '没有可看的截图' : '截图都看完了'}</Text>
            {readCount > 0 && <Text dimColor>已读 {readCount} 张</Text>}
          </Box>
          {goneNote}
          {readCount > 0 && undo}
          {closeHint}
        </Box>
      )
    }

    const visibleRows = Math.min(e.props.scroll.bodyRows, e.viewport?.rows ?? e.props.scroll.bodyRows)
    const alt = `${basename(shot.path)}(终端没有开启图片显示,轻按 o 用快速查看打开)`
    const pictureOf = (size: { columns: number; rows: number }) =>
      e.surface === 'terminal' ? (
        (() => {
          const { Image } = $.ui.resolve(e)
          return (
            <Image
              key="shot"
              source={{ file: shot.path, format: 'png', generation: live.get(shot.path) ?? 0 }}
              columns={size.columns}
              rows={size.rows}
              alt={alt}
            />
          )
        })()
      ) : (
        <Text dimColor>{alt}</Text>
      )

    // 按住 o 的放大视图:只留图和一行提示,图铺满面板。
    // 提示行本身就是绑着 o 的按键:按住时终端补发的重复按键要有地方接,否则会被当成已经松开
    if (isPeeking) {
      return (
        <Box flexDirection="column">
          {pictureOf(fit(shot, Math.max(10, e.props.bodyColumns), Math.max(4, visibleRows - 1)))}
          <Button key="peek" plain hotkey="o" dimColor onPress={() => void pressPeek($, shot.path)}>
            {`放大查看 ${basename(shot.path)} · 松开 o 回到列表`}
          </Button>
        </Box>
      )
    }

    // 普通视图按面板真正能显示的高度缩图:标题、路径、两排按键和两行说明约占 8 行,图片太高会把按键挤出去
    const picture = pictureOf(fit(shot, Math.max(10, e.props.bodyColumns - 2), Math.max(4, visibleRows - 8 - (gone > 0 ? 1 : 0))))

    return (
      <Box flexDirection="column" paddingX={1}>
        <Box flexDirection="row" gap={1}>
          <Text bold>{basename(shot.path)}</Text>
          <Text color="suggestion">
            未读 {at + 1}/{unread.length}
          </Text>
          {readCount > 0 && <Text dimColor>已读 {readCount}</Text>}
          <Text dimColor>
            {ago(shot.at)} · {shot.via} · {shot.width}×{shot.height}
          </Text>
        </Box>
        <Text dimColor wrap="wrap">
          {shot.path}
        </Text>
        {goneNote}
        {picture}
        <Box flexDirection="row" gap={2}>
          <Button key="next" plain hotkey="n" onPress={() => void update($, index, n => Math.min(n + 1, unread.length - 1))}>
            下一张
          </Button>
          <Button key="prev" plain hotkey="p" onPress={() => void update($, index, n => Math.max(n - 1, 0))}>
            上一张
          </Button>
          <Button key="read" plain hotkey="r" onPress={() => void markRead($, shot.path)}>
            标为已读
          </Button>
          {readCount > 0 && undo}
        </Box>
        <Box flexDirection="row" gap={2}>
          <Button key="peek" plain hotkey="o" onPress={() => void pressPeek($, shot.path)}>
            按住放大 · 轻按快速查看
          </Button>
          <Button key="reveal" plain hotkey="f" onPress={() => void $.process.run(['open', '-R', shot.path])}>
            Finder
          </Button>
          <Button key="copy" plain hotkey="y" onPress={press => void $.ui.copy({ text: shot.path, surface: press.surface })}>
            复制路径
          </Button>
        </Box>
        <Text dimColor>从最新一张开始,n 往后看更早的;看过、不需要再看了就按 r,它不会再出现,只是翻过不算已读</Text>
        {closeHint}
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 Bearisbug

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

What its code calls

runs programsreads filesenv varstool calls

The design, read from code

Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.

What its code shows

Read from the source at commit cd2be78744da on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.

Decides the listing: code you can check
Entry readEvery module hooks/hooks.json names was read.shot-view/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.1 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs
Calls in the openNetwork and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open
For you to weigh before installing
Where it drawsThe terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both
Install lineWhether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).shot-view/hooks/register.tsx:423 open (not on Windows)
NetworkWhether every fetch names its https host in the code.no network
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.sips, qlmanage, open (reaches the network)
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads environment variables and files and reaches the network
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT

This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen

Install it

Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:

/plugin marketplace add Bearisbug/cc-mods
/plugin install shot-view@cc-mods

This installs the marketplace's latest commit, which may not be the one read here (cd2be78744da). Compare them before you install.

Ask Claude about it

With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:

Read the modscode design "bearisbug-shot-view" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs