modscode JA

modscode / Gallery / touch-map

touch-map

See which files Claude has listed, read, partially read, edited, created or deleted, as a tree and an activity map in a pane.

Code you can checkTerminal + desktopPaneBandToastBoxButtonInputText

What it does

  • Draws a band above the prompt, a pane, toasts
  • Adds /touch-map
  • Watches tool calls
  • Hooks classic.InstructionsLoaded, classic.SessionStart, session.append, session.end and 3 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Written in TypeScript
  • Handles errors

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 touch-map by y-hirakaw (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/y-hirakaw-touch-map/
// 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, Button } = $.ui.resolve(e)
    const text = '…'
    const text2 = '…'
    const text3 = '…'
    const fmt = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" gap={1}>
          <Text dimColor>
            Touch map
          </Text>
          <Text>
            <Text>
              {text}
            </Text>
            <Text>
              {text2}
            </Text>
            <Text>
              {text3}
            </Text>
          </Text>
          <Text>
            <Text bold>
              {fmt}
            </Text>
            <Text dimColor>
              {`/${fmt}`}
            </Text>
          </Text>
          <Button label="open" />
        </Box>
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "Touch map" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const label = '…'
    const elapsed = '…'
    const fmt = '…'
    const text = '…'
    const text2 = '…'
    const text3 = '…'
    const path = '…'
    const note = '…'
    const text4 = '…'
    const text5 = '…'
    const text6 = '…'
    const text7 = '…'
    const count = '…'
    const text8 = '…'
    const text9 = '…'
    const text10 = '…'
    const text11 = '…'
    const count2 = '…'
    const text12 = '…'
    const text13 = '…'
    const text14 = '…'
    const text15 = '…'
    const count3 = '…'
    const auto = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" gap={1} paddingRight={2}>
          <Box flexGrow={1} flexShrink={1} minWidth={0}>
            <Text bold wrap="truncate-end">
              {label}
            </Text>
          </Box>
          <Text dimColor>
            {elapsed}
          </Text>
          <Button variant="primary" label="save" />
          <Button label="discard" />
        </Box>
        <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
          <Text>
            <Text bold>
              {fmt}
            </Text>
            <Text dimColor>
              {`/${fmt}`}
            </Text>
          </Text>
          <Text>
            {text}
          </Text>
          <Text>
            {text2}
          </Text>
          <Text>
            {text3}
          </Text>
          <Text color="#f87171" />
        </Box>
        <Box flexDirection="row" gap={1}>
          <Text dimColor>
            now
          </Text>
          <Box flexShrink={1} minWidth={0}>
            <Text wrap="truncate-start">
              {path}
            </Text>
          </Box>
        </Box>
        <Text dimColor wrap="truncate-end">
          {note}
        </Text>
        <Text color="#3f4654">
          ────────
        </Text>
        <Text dimColor>
          nothing touched yet
        </Text>
        <Box flexDirection="column">
          <Box flexDirection="row" backgroundColor="#1d2029">
            <Box flexShrink={0} flexDirection="row">
              <Text>
                {"                "}
              </Text>
              <Text>
                {" "}
              </Text>
              <Text>
                {" "}
              </Text>
            </Box>
            <Box flexGrow={1} flexShrink={1} minWidth={0}>
              <Text wrap="truncate-end">
                {text4}
              </Text>
            </Box>
            <Box flexShrink={0} justifyContent="flex-end">
              <Text>
                <Text>
                  {text5}
                </Text>
                <Text>
                  {text6}
                </Text>
                <Text>
                  {text7}
                </Text>
              </Text>
            </Box>
            <Box width={10} flexShrink={0} justifyContent="flex-end">
              <Text dimColor>
                {count}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row" backgroundColor="#1d2029">
            <Box flexShrink={0} flexDirection="row">
              <Text>
                {"                "}
              </Text>
              <Text>
                {" "}
              </Text>
              <Text>
                {" "}
              </Text>
            </Box>
            <Box flexGrow={1} flexShrink={1} minWidth={0}>
              <Text wrap="truncate-end">
                {text8}
              </Text>
            </Box>
            <Box flexShrink={0} justifyContent="flex-end">
              <Text>
                <Text>
                  {text9}
                </Text>
                <Text>
                  {text10}
                </Text>
                <Text>
                  {text11}
                </Text>
              </Text>
            </Box>
            <Box width={10} flexShrink={0} justifyContent="flex-end">
              <Text dimColor>
                {count2}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row" backgroundColor="#1d2029">
            <Box flexShrink={0} flexDirection="row">
              <Text>
                {"                "}
              </Text>
              <Text>
                {" "}
              </Text>
              <Text>
                {" "}
              </Text>
            </Box>
            <Box flexGrow={1} flexShrink={1} minWidth={0}>
              <Text wrap="truncate-end">
                {text12}
              </Text>
            </Box>
            <Box flexShrink={0} justifyContent="flex-end">
              <Text>
                <Text>
                  {text13}
                </Text>
                <Text>
                  {text14}
                </Text>
                <Text>
                  {text15}
                </Text>
              </Text>
            </Box>
            <Box width={10} flexShrink={0} justifyContent="flex-end">
              <Text dimColor>
                {count3}
              </Text>
            </Box>
          </Box>
          <Text dimColor>
            {`  … ${fmt} more rows`}
          </Text>
        </Box>
        <Text color="#7dd3fc" wrap="truncate-end">
          {`◆ ${auto}`}
        </Text>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    await $.ui.toast(`Touch map: the terminal is too narrow to open the pane here. Run /touch-map to open it.`)
    await $.ui.toast(`Touch map: discarded`)
    return next(e)
  })
}

The mod's own code

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

touch-map/hooks/register.tsx lines 1273–1294 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    if (!(await read($, minimized))) return next(e)
    const { Box, Text, Button } = $.ui.resolve(e)
    const all: Record<string, Touch> = await read($, touches)
    const touched = Object.keys(all).length
    return (
      <Box flexDirection="row" gap={1}>
        <Text dimColor>Touch map</Text>
        <Text>
          {shareBar(counts(all), files.size, BAR).map(s => (
            <Text color={s.color}>{s.text}</Text>
          ))}
        </Text>
        <Text>
          <Text bold>{fmt(touched)}</Text>
          <Text dimColor>{`/${fmt(files.size)}`}</Text>
        </Text>
        {/* 開く処理は下の ui.press のフックで行う。ここで描いたときの $ で開くと、人の操作として扱われない */}
        <Button key="open" label="open" onPress={() => undefined} />
      </Box>
    )
  })
touch-map/hooks/register.tsx lines 1388–1520 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const started = await $.clock.now()
    const ui = $.ui.resolve(e)
    const { Box, Text, Button } = ui
    const Input = 'Input' in ui ? ui.Input : undefined
    const Raster = 'Raster' in ui ? ui.Raster : undefined
    const all: Record<string, Touch> = await read($, touches)
    const seg: Segment = await read($, segment)
    const showMap: boolean = await read($, mapAtom)
    const loaded: Loaded = await read($, loadedAtom)
    const now: Now | null = await read($, nowAtom)
    const rows = toRows(all, await read($, folds), now)
    const c = counts(all)
    const gone = goneCount(all)
    const auto = Object.keys(loaded)
    const cols = e.props.bodyColumns ?? e.viewport?.columns ?? 60
    // ペインの本体は高さを超えると Claude Code がスクロールさせるので、行は全部渡す(重くならないよう上限だけ置く)
    const shown = rows.slice(0, 400)
    const header = 3 + (now ? 1 : 0) + (seg.note !== '' ? 1 : 0) + (Object.keys(all).length === 0 ? 1 : 0)
    paneRows = Math.max(0, (e.props.scroll?.bodyRows ?? 0) - header)
    const legend = [
      ...DEEP_FIRST.filter(i => (c[i] ?? 0) > 0).map(i => ({ text: `■${LEVELS[i]} ${fmt(c[i] ?? 0)}`, color: COLORS[i] as string })),
      ...(gone > 0 ? [{ text: `✕deleted ${fmt(gone)}`, color: GONE }] : []),
      ...(auto.length > 0 ? [{ text: `◆auto ${auto.length}`, color: AUTO }] : []),
    ]
    const tree = (
      <Box flexDirection="column">
        {shown.map(row => {
          const nameColor =
            row.kind === 'dir' ? (row.stat ? undefined : TRACK)
              : row.kind === 'file' ? (row.touch?.d ? GONE : row.touch ? COLORS[row.touch.s] : TRACK)
                : TRACK
          const bar =
            row.kind === 'dir' ? shareBar(row.stat?.c ?? [], row.total, BAR)
              : row.kind === 'file' && row.touch ? fileBar(row.touch) : []
          const count =
            row.kind === 'dir' ? `${fmt(row.stat?.touched ?? 0)}/${fmt(row.total)}`
              : row.kind === 'file' && row.touch ? rangeOf(row.touch) : ''
          return (
            <Box key={`row:${row.kind}:${row.key}`} flexDirection="row" backgroundColor={row.kind === 'file' && row.now ? NOW_BG : undefined}>
              {/* 字下げと行頭の記号は、幅が足りなくても縮めない */}
              <Box flexShrink={0} flexDirection="row">
                <Text>{'  '.repeat(row.indent)}</Text>
                {row.kind === 'file' ? (
                  <Text> </Text>
                ) : (
                  <Button key={`go:${row.kind}:${row.key}`} plain dimColor label={glyphOf(row)} onPress={() => void toggle($, row.key, row.open)} />
                )}
                <Text> </Text>
              </Box>
              <Box flexGrow={1} flexShrink={1} minWidth={0}>
                <Text
                  wrap="truncate-end"
                  color={nameColor}
                  bold={row.kind === 'dir' && row.stat !== undefined || (row.kind === 'file' && row.now)}
                  strikethrough={row.kind === 'file' && row.touch?.d === true}
                >
                  {'text' in row ? row.text : row.name}
                </Text>
              </Box>
              {(row.kind === 'dir' || row.kind === 'file') && (
                <Box width={BAR + 1} flexShrink={0} justifyContent="flex-end">
                  <Text>
                    {bar.map(s => (
                      <Text color={s.color}>{s.text}</Text>
                    ))}
                  </Text>
                </Box>
              )}
              {(row.kind === 'dir' || row.kind === 'file') && (
                <Box width={10} flexShrink={0} justifyContent="flex-end">
                  <Text dimColor>{count}</Text>
                </Box>
              )}
            </Box>
          )
        })}
        {rows.length > shown.length && <Text dimColor>{`  … ${fmt(rows.length - shown.length)} more rows`}</Text>}
      </Box>
    )
    renderMs = (await $.clock.now()) - started

    return (
      <Box flexDirection="column">
        <Box flexDirection="row" gap={1} paddingRight={2}>
          <Box flexGrow={1} flexShrink={1} minWidth={0}>
            {Input ? (
              <Input key="label" placeholder="task name" value={seg.label} submitLabel="set" onSubmit={(value: string) => void setLabel($, value)} />
            ) : (
              <Text bold wrap="truncate-end">{seg.label}</Text>
            )}
          </Box>
          <Text dimColor>{elapsed(seg.startedAt, await $.clock.now())}</Text>
          <Button key="save" variant="primary" label="save" onPress={() => void save($, true)} />
          {/* 最小化はペイン右上の × でできるので、ボタンは置かない */}
          <Button key="discard" label="discard" onPress={() => void save($, false)} />
        </Box>
        {/* 狭いペインでは、項目の途中で切らずに項目の切れ目で折り返す */}
        <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
          <Text>
            <Text bold>{fmt(Object.keys(all).length)}</Text>
            <Text dimColor>{`/${fmt(files.size)}`}</Text>
          </Text>
          {legend.map(l => (
            <Text color={l.color}>{l.text}</Text>
          ))}
          {fileNote.includes('cut') && <Text color={GONE}>{fileNote}</Text>}
        </Box>
        {now && (
          <Box flexDirection="row" gap={1}>
            <Text dimColor>now</Text>
            <Box flexShrink={1} minWidth={0}>
              <Text wrap="truncate-start" color={COLORS[now.level]}>{now.path}</Text>
            </Box>
          </Box>
        )}
        {seg.note !== '' && <Text dimColor wrap="truncate-end">{seg.note}</Text>}
        {Raster && showMap && files.size > 0 && (() => {
          // ペインの幅いっぱいまでマスを並べる(Raster の上限 512 桁まで)。ファイルが少なくて余るときは中央に寄せる
          const layout = layoutOf(Math.max(8, Math.min(256, Math.floor((cols + 1) / 2))))
          return (
            <Box flexDirection="row" justifyContent="center">
              <Raster key="map" columns={layout.width * 2 - 1} rows={MAP_ROWS} cells={mapCells(all, layout, started)} />
            </Box>
          )
        })()}
        <Text color={TRACK}>{'─'.repeat(Math.max(10, cols))}</Text>
        {Object.keys(all).length === 0 && <Text dimColor>nothing touched yet</Text>}
        {tree}
        {auto.length > 0 && <Text color={AUTO} wrap="truncate-end">{`◆ ${auto.join('  ')}`}</Text>}
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 y-hirakaw

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 programswrites filestool callsremembers

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 4b4336bb0740 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.touch-map/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).runs no program a Windows PC lacks
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.git (reaches the network), printenv
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads 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 y-hirakaw/claude-code-mods
/plugin install touch-map@y-hirakaw-mods

This installs the marketplace's latest commit, which may not be the one read here (4b4336bb0740). 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 "y-hirakaw-touch-map" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs