modscode JA

modscode / Gallery / compass

compass

A live map of your Claude Code session: a git-style flow chart, a live feed of every tool call, a drag-and-drop task board, async grill questions, agent chat, stats and recap, in a pane you can steer from.

Code you can checkTerminal + desktopPaneStatus lineToastBoxButtonClientText

What it does

  • Draws a pane, toasts
  • Adds /compass, /btw
  • Watches ListAgents calls and can refuse them
  • Hooks prompt.compose, prompt.submit, session.end, session.receive and 6 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Starts no processes
  • Written in TypeScript
  • Has a desktop-specific branch

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 compass by gil2abir (pane, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/gil2abir-compass/
// 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: "🧭 compass" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Client, Button } = $.ui.resolve(e)
    const text = '…'
    const span = '…'
    const detail = '…'
    const lastError = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="column">
          <Box flexDirection="column">
            <Box justifyContent="space-between">
              <Box flexShrink={1}>
                <Text bold wrap="wrap">
                  <Text color="#E8B53A">
                    {"◈ "}
                  </Text>
                  <Text color="#e6e6e6">
                    compass
                  </Text>
                </Text>
              </Box>
              <Box flexShrink={0} columnGap={1}>
                <Box flexShrink={0}>
                  <Client module="./pill.tsx" />
                </Box>
                <Button plain dimColor label="✕" role="dismiss" />
              </Box>
            </Box>
            <Box flexWrap="wrap" marginTop={1}>
              <Box marginRight={1}>
                <Box flexShrink={0}>
                  <Client module="./pill.tsx" />
                </Box>
                <Box flexShrink={0}>
                  <Text color="#f0d27a" backgroundColor="#3e381d">
                    {` ${text} `}
                  </Text>
                </Box>
                <Text color="#86d4ab">
                  ●
                </Text>
              </Box>
              <Box marginRight={1}>
                <Box flexShrink={0}>
                  <Client module="./pill.tsx" />
                </Box>
                <Box flexShrink={0}>
                  <Text color="#f0d27a" backgroundColor="#3e381d">
                    {` ${text} `}
                  </Text>
                </Box>
                <Text color="#86d4ab">
                  ●
                </Text>
              </Box>
              <Box marginRight={1}>
                <Box flexShrink={0}>
                  <Client module="./pill.tsx" />
                </Box>
                <Box flexShrink={0}>
                  <Text color="#f0d27a" backgroundColor="#3e381d">
                    {` ${text} `}
                  </Text>
                </Box>
                <Text color="#86d4ab">
                  ●
                </Text>
              </Box>
            </Box>
          </Box>
          <Box marginTop={1} marginBottom={1}>
            <Box flexShrink={0}>
              <Text>
                {` ${text} `}
              </Text>
            </Box>
            <Box flexShrink={0}>
              <Text dimColor>
                {` ◷ ${span}`}
              </Text>
            </Box>
            <Box flexGrow={1} flexShrink={1}>
              <Text dimColor wrap="wrap">
                {"  "}
                {detail}
              </Text>
            </Box>
            <Box flexShrink={0}>
              <Client module="./pill.tsx" />
            </Box>
          </Box>
          <Text color="yellow" dimColor>
            {"△ "}
            {lastError}
          </Text>
        </Box>
        <Box position="absolute" left={0} flexDirection="column" overflow="hidden" backgroundColor="#2b2c31" />
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const label = '…'
    const reason = '…'
    await $.ui.toast(`↗ sent into the running turn · ${label}`)
    await $.ui.toast(`✗ rejected · ${label} · ${reason} · rolled back`)
    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.

hooks/register.tsx lines 1767–1926 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const els = $.ui.resolve(e)
    const { Box, Text, Button } = els
    const Input = 'Input' in els ? els.Input : null
    const width = Math.max(28, e.props.bodyColumns)
    paneCols = e.props.placement === 'dock' ? e.props.bodyColumns + 2 : 0
    const [stored, grill, round, confirm, actions, userTasks, steers, btw, stats, tab, selected, unfolded, isRefreshing, isBusy, lastError] =
      await Promise.all([
        read($, mapA),
        read($, grillA),
        read($, grillRoundA),
        read($, grillConfirmA),
        read($, actionsA),
        read($, userTasksA),
        read($, steersA),
        read($, btwA),
        read($, statsA),
        read($, tabA),
        read($, selectedA),
        read($, unfoldedA),
        read($, refreshingA),
        read($, busyA),
        read($, errorA),
      ])
    const [peers, peersAt, selfName, isRemote, chat, incoming, chatSeen] = await Promise.all([read($, peersA), read($, peersAtA), read($, selfNameA), read($, remoteA), read($, chatA), read($, incomingA), read($, chatSeenA)])
    const live = await read($, liveA)
    const contract = { report: await read($, reportA), brief: await read($, briefA), sent: await read($, briefSentA) }
    const openPeer = tab === 'chat' && selected?.startsWith('p:') ? selected.slice(2) : null
    const unreadOf = (name: string) => (name === openPeer ? 0 : chat.filter(m => m.peer === name && m.dir === 'in' && m.at > (chatSeen[name] ?? 0)).length)
    const unreadAll = [...new Set(chat.map(m => m.peer))].reduce((n, p) => n + unreadOf(p), 0)
    // a Client (a region one of the surface modules draws) exists on the terminal and desktop; elsewhere Buttons stand in
    const hasClient = e.surface === 'terminal' || e.surface === 'desktop'
    const map = isCurrent(stored) ? stored : null
    const now = await $.clock.now()
    const board = boardOf(map, userTasks)
    const front = frontierOf(grill)
    const isOpen = (key: string) => unfolded.includes(key)
    const select = (id: string) => () => update($, selectedA, s => (s === id ? null : id))
    const rule = <Text dimColor>{'─'.repeat(width)}</Text>

    const art = (t: CompassTab, hint: string) => (
      <Box flexDirection="column" key={`art:${t}`}>
        {ART[t].map(line => (
          <Text color="cyan" dimColor>
            {line}
          </Text>
        ))}
        <Text dimColor>{hint}</Text>
      </Box>
    )

    const input = (key: string, placeholder: string, submitLabel: string, onSubmit: (v: string) => void) =>
      Input && (
        <Box key={`in:${key}`} marginTop={1}>
          <Input key={key} placeholder={placeholder} submitLabel={submitLabel} onSubmit={(v: string) => onSubmit(v)} />
        </Box>
      )

    const fold = (key: string, label: string) => (
      <Button key={`fold:${key}`} plain dimColor label={`${isOpen(key) ? '▾' : '▸'} ${label}`} onPress={() => toggleIn($, key)} />
    )

    // indicators: a tinted pill, a level bar, a pill button (a Client, so it keeps its colours)
    const pill = (key: string, text: string, tone: Tone, bold = false) => (
      <Box key={key} flexShrink={0}>
        <Text color={TONE[tone].fg} backgroundColor={TONE[tone].bg} bold={bold}>
          {` ${text} `}
        </Text>
      </Box>
    )
    const meter = (key: string, frac: number, cells: number, tone: Tone) => (
      <Text key={key} color={TONE[tone].fg} backgroundColor={TRACK}>
        {barText(frac, cells)}
      </Text>
    )
    const pillBtn = (key: string, label: string, tone: Tone, onPress: () => unknown, isOn = false) => {
      presses.set(key, onPress)
      return hasClient ? (
        <Box key={`${key}:box`} flexShrink={0}>
          {h('Client', { module: './pill.tsx', key, props: { label, fg: TONE[tone].fg, bg: TONE[tone].bg, isOn } })}
        </Box>
      ) : (
        <Button key={key} plain dimColor={!isOn} label={label} onPress={() => void onPress()} />
      )
    }
    const spin = SPIN[Math.floor(now / 120) % SPIN.length]!

    // is the chart caught up with the session? one line, always on top
    const behind = map && typeof map.turns === 'number' ? Math.max(0, stats.turns - map.turns) : 0
    const unseen = map ? actions.filter(a => a.status === 'sent' && a.at > Math.max(map.at, map.reconciledAt ?? 0)).length : 0
    // what is going on with the chart, and whether you need to do anything: one answer for the
    // sync line and the sea chart alike
    const syncLine = ((): { tone: Tone; glyph: string; text: string; detail: string; canRefresh: boolean } => {
      const update = { canRefresh: true }
      const wait = { canRefresh: false }
      if (isQuickCharting) return { tone: 'cyan', glyph: spin, text: quickWhat || 'checking the course', detail: 'a few seconds · nothing to do', ...wait }
      if (isRefreshing) return { tone: 'cyan', glyph: spin, text: 'charting now', detail: 'nothing to do', ...wait }
      if (isReconciling) return { tone: 'cyan', glyph: spin, text: 'applying your changes', detail: 'a few seconds · nothing to do', ...wait }
      if (!map && stats.turns === 0 && !isBusy) return { tone: 'dim', glyph: '◌', text: 'waiting for your first prompt', detail: 'the chart starts seconds after you send one', ...wait }
      if (!map && isBusy) return { tone: 'cyan', glyph: '◌', text: 'chart coming', detail: 'drawn in a few seconds · nothing to do', ...wait }
      if (!map) return { tone: 'yellow', glyph: '◌', text: 'no chart yet', detail: 'press ↻ update to draw it', ...update }
      if (incoming) return isBusy
        ? { tone: 'cyan', glyph: '◌', text: 'your new message', detail: 'charted a few seconds into the turn · nothing to do', ...wait }
        : { tone: 'yellow', glyph: '◌', text: 'new message not charted', detail: 'press ↻ update', ...update }
      if (behind) return isBusy
        ? { tone: 'cyan', glyph: '◌', text: `${behind} turn${behind > 1 ? 's' : ''} behind`, detail: 'updates when this turn ends · nothing to do', ...wait }
        : { tone: 'yellow', glyph: '◌', text: `${behind} turn${behind > 1 ? 's' : ''} behind`, detail: 'press ↻ update', ...update }
      if (unseen) return isBusy
        ? { tone: 'cyan', glyph: '◌', text: `${unseen} update${unseen > 1 ? 's' : ''} sent`, detail: 'charted when this turn ends · nothing to do', ...wait }
        : { tone: 'yellow', glyph: '◌', text: `${unseen} update${unseen > 1 ? 's' : ''} not charted`, detail: 'press ↻ update', ...update }
      return { tone: 'green', glyph: '✓', text: 'in sync', detail: isBusy ? 'Claude is working · next update when the turn ends' : '', ...wait }
    })()

    // a clickable label that wraps between words instead of being cut: the first row is the
    // button, the rest follow under it, so every word stays readable
    const wrapped = (key: string, text: string, room: number, onPress: () => unknown, opts: { dim?: boolean; indent?: number } = {}) => {
      const [first = '', ...rest] = wordWrap(text, room)
      return {
        head: <Button key={key} plain dimColor={opts.dim} label={first} onPress={() => void onPress()} />,
        tail: rest.length ? (
          <Box key={`${key}:more`} flexDirection="column" paddingLeft={opts.indent ?? 2}>
            {rest.map((r, i) => (
              <Text key={`${key}:r${i}`} dimColor={opts.dim}>
                {r}
              </Text>
            ))}
          </Box>
        ) : null,
      }
    }

    // ── header: a title bar, then the tabs as a segmented control ──
    const header = (
      <Box flexDirection="column" key="head">
        <Box justifyContent="space-between">
          <Box flexShrink={1}>
            <Text bold wrap="wrap">
              <Text color={GOLD}>{'◈ '}</Text>
              <Text color="#e6e6e6">{map?.goal || 'compass'}</Text>
            </Text>
          </Box>
          <Box flexShrink={0} columnGap={1}>
            {pillBtn('legend', '? key', isOpen('legend') ? 'cyan' : 'dim', async () => {
              await openTab($, 'flow')
              await toggleIn($, 'legend')
            }, isOpen('legend'))}
            <Button key="close" plain dimColor label="✕" role="dismiss" onPress={() => void togglePane($)} />
          </Box>
        </Box>
        <Box flexWrap="wrap" marginTop={1}>
          {TABS.map(t => {
            const isOn = t.id === tab
            const count = t.id === 'grill' ? front.ask.length : t.id === 'chat' ? unreadAll : 0
            return (
              <Box key={`tabbox:${t.id}`} marginRight={1}>
                {pillBtn(`tab:${t.id}`, `${t.icon} ${t.label}`, isOn ? 'blue' : 'dim', () => openTab($, t.id), isOn)}
                {count > 0 ? pill(`tabn:${t.id}`, `${count}`, t.id === 'grill' ? 'yellow' : 'cyan', true) : null}
                {t.id === 'chat' ? <Text color={isRemote ? TONE.green.fg : TONE.red.fg}>●</Text> : null}
              </Box>
            )
Licence text (MIT)
MIT License

Copyright (c) 2026 gil2abir

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

drives Claudetool 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 fb8737b9e590 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.hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.7 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, with its own branch for the desktop
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.starts no programs
Reads and sendsWhether it both reads files or environment variables and reaches the network.reaches no 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 gil2abir/claude-compass
/plugin install compass@claude-compass

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

Search them from Claude: the MCP connector

Similar designs