modscode JA

modscode / Gallery / repo-map

repo-map

A compact, cached map of the repository for Claude: files by folder with sizes and each source file's symbols with line numbers, sized to a token budget, instead of reading files to get its bearings.

Code you can checkTerminal + desktopPaneToastBoxButtonText

What it does

  • Draws a pane, toasts
  • Adds /map
  • Watches tool calls and can refuse them
  • Hooks session.end, session.start
  • Keeps its own state between turns

Good points

  • No network calls
  • Written in TypeScript
  • Has a desktop-specific branch
  • 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 repo-map by mako-code (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/mako-code-repo-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 pane: open it with $.ui.open({ id: 'my-pane', title: "Repo map" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const rootName = '…'
    const plural = '…'
    const plural2 = '…'
    const fmtCount = '…'
    const agoText = '…'
    const note = '…'
    const name = '…'
    const fmtSize = '…'
    const syms = '…'
    const line = '…'
    return (
      <Box flexDirection="column">
        <Text wrap="wrap">
          <Text bold>
            {rootName}
          </Text>
          <Text dimColor>
            {" "}
            {"· "}
            {plural}
            {" · "}
            {plural2}
            {` · ${fmtCount} to read`}
            {" · listed "}
            {agoText}
            {" ago"}
          </Text>
        </Text>
        <Text dimColor wrap="wrap">
          Claude has not asked for the map yet this session.
        </Text>
        <Text color="yellow" wrap="wrap">
          warn
          {" "}
          {note}
        </Text>
        <Box marginTop={1} />
        <Box flexDirection="column" marginTop={1}>
          <Text dimColor>
            No files.
          </Text>
          <Box flexDirection="column">
            <Button plain label={`                  ${name}  ${fmtSize} · ${syms} sym`} />
            <Text color="cyan" wrap="truncate-end">
              {`                    ${line}`}
            </Text>
            <Text color="cyan" wrap="truncate-end">
              {`                    ${line}`}
            </Text>
            <Text color="cyan" wrap="truncate-end">
              {`                    ${line}`}
            </Text>
          </Box>
          <Box flexDirection="column">
            <Button plain label={`                  ${name}  ${fmtSize} · ${syms} sym`} />
            <Text color="cyan" wrap="truncate-end">
              {`                    ${line}`}
            </Text>
            <Text color="cyan" wrap="truncate-end">
              {`                    ${line}`}
            </Text>
            <Text color="cyan" wrap="truncate-end">
              {`                    ${line}`}
            </Text>
          </Box>
          <Box flexDirection="column">
            <Button plain label={`                  ${name}  ${fmtSize} · ${syms} sym`} />
            <Text color="cyan" wrap="truncate-end">
              {`                    ${line}`}
            </Text>
            <Text color="cyan" wrap="truncate-end">
              {`                    ${line}`}
            </Text>
            <Text color="cyan" wrap="truncate-end">
              {`                    ${line}`}
            </Text>
          </Box>
          <Text dimColor>
            … more rows: filter or collapse folders
          </Text>
        </Box>
        <Box marginTop={1} gap={1}>
          <Button hotkey="r" label="Refresh" />
          <Button hotkey="c" label="Collapse all" />
          <Button hotkey="f" label="Clear filter" />
          <Button hotkey="x" role="dismiss" label="Close" />
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const plural = '…'
    const error = '…'
    await $.ui.toast(`Listed ${plural}`)
    await $.ui.toast(`Could not list the repository: ${error}`)
    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.

mods/abilities/repo-map/hooks/register.tsx lines 575–682 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const inf = await read($, info)
    const v = await read($, view)
    const s = await read($, stats)
    const r = repo
    if (r === null || inf.version === 0) {
      if (building === null) $.clock.after(0, () => void ensureMap($, false).catch(() => undefined))
      return (
        <Box flexDirection="column">
          <Text dimColor>Building the map…</Text>
          <Box marginTop={1}>
            <Button key="close" hotkey="x" role="dismiss" label="Close" onPress={() => void $.ui.close({ id: PANE })} />
          </Box>
        </Box>
      )
    }
    const now = await $.clock.now()
    const width = Math.max(30, e.props.bodyColumns - 2)
    const all = [...r.files.values()]
    const files = v.filter.trim() === '' ? all : selectFiles(all, { query: v.filter }).map(x => x.file)
    const open = new Set(v.filter.trim() === '' ? v.open : files.flatMap(f => f.path.split('/').slice(0, -1).map((_, i, parts) => parts.slice(0, i + 1).join('/'))))
    const { rows, isCut } = treeRows(files, open, 300)
    const saved = Math.max(0, s.readTokens - s.answerTokens)
    const selected = v.selected === null ? undefined : r.files.get(v.selected)
    const nameRoom = Math.max(12, width - 34)
    const clip = (t: string) => (t.length > nameRoom ? `${t.slice(0, nameRoom - 1)}…` : t)
    let field = null
    if (e.surface !== 'mobile') {
      const { Input } = $.ui.resolve(e)
      field = (
        <Input
          key="filter"
          label="Filter "
          placeholder="path or symbol words"
          value={v.filter}
          onSubmit={value => void update($, view, (x): RepoMapView => ({ ...x, filter: value.trim(), selected: null }))}
        />
      )
    }

    return (
      <Box flexDirection="column">
        <Text wrap="wrap">
          <Text bold>{rootName(r.root)}</Text>
          <Text dimColor>
            {' '}
            · {plural(inf.files, 'file')} · {plural(inf.symbols, 'symbol')}
            {inf.pending > 0 ? ` · ${fmtCount(inf.pending)} to read` : ''} · listed {agoText(now - (inf.listedAt ?? now))} ago
          </Text>
        </Text>
        <Text dimColor wrap="wrap">
          {s.calls === 0
            ? 'Claude has not asked for the map yet this session.'
            : `${plural(s.calls, 'answer')}: ≈${fmtTokens(s.answerTokens)} tokens vs ≈${fmtTokens(s.readTokens)} to Read their files · saved ≈${fmtTokens(saved)}`}
        </Text>
        {inf.note !== null && <Text color="yellow" wrap="wrap">{glyphOf('warn', e.surface === 'terminal' ? glyphMode : 'full')} {inf.note}</Text>}
        {field !== null && <Box marginTop={1}>{field}</Box>}
        <Box flexDirection="column" marginTop={1}>
          {rows.length === 0 && <Text dimColor>{v.filter === '' ? 'No files.' : `Nothing matches "${v.filter}".`}</Text>}
          {rows.map(row => {
            const pad = '  '.repeat(row.depth)
            if (row.kind === 'dir') {
              return (
                <Button
                  key={`d:${row.path}`}
                  plain
                  label={`${pad}${row.isOpen ? '▼' : '►'} ${clip(row.name)}/  ${fmtCount(row.files)} files · ${fmtCount(row.syms)} sym`}
                  onPress={() => void toggleOpen($, row.path)}
                />
              )
            }
            const isSel = selected !== undefined && selected.path === row.path
            return (
              <Box key={`r:${row.path}`} flexDirection="column">
                <Button
                  key={`f:${row.path}`}
                  plain
                  dimColor={!isSel}
                  label={`${pad}  ${clip(row.name)}  ${fmtSize(row.size)}${row.syms > 0 ? ` · ${row.syms} sym` : ''}`}
                  onPress={() => void selectFile($, row.path)}
                />
                {isSel &&
                  (selected.syms === null || selected.syms.length === 0 ? (
                    <Text dimColor>{`${pad}    ${selected.syms === null ? 'no symbols for this kind of file' : 'no symbols found'}`}</Text>
                  ) : (
                    symbolLines(selected.syms)
                      .slice(0, 80)
                      .map((line, i) => (
                        <Text key={`s:${row.path}:${i}`} color="cyan" wrap="truncate-end">
                          {`${pad}    ${line}`}
                        </Text>
                      ))
                  ))}
              </Box>
            )
          })}
          {isCut && <Text dimColor>… more rows: filter or collapse folders</Text>}
        </Box>
        <Box marginTop={1} gap={1}>
          <Button key="refresh" hotkey="r" label="Refresh" onPress={() => void refreshNow($)} />
          <Button key="collapse" hotkey="c" label="Collapse all" onPress={() => void update($, view, (x): RepoMapView => ({ ...x, open: [], selected: null }))} />
          {v.filter !== '' && <Button key="clear" hotkey="f" label="Clear filter" onPress={() => void update($, view, (x): RepoMapView => ({ ...x, filter: '' }))} />}
          <Button key="close" hotkey="x" role="dismiss" label="Close" onPress={() => void $.ui.close({ id: PANE })} />
        </Box>
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 mako-code

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 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 ec6ea2383749 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.mods/abilities/repo-map/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.4 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)
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 mako-code/gobworks
/plugin install repo-map@gobworks

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

Search them from Claude: the MCP connector

Similar designs