modscode JA

modscode / Gallery / orbit

orbit

A globe of everything your Claude session talks to: tool calls, sockets and bytes traced to hosts, countries and orgs, with a deny-list that blocks before a call runs.

Code you can checkTerminal + desktopPaneStatus lineToastBoxButtonText

What it does

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

Good points

  • 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 orbit by jamubc (pane, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/jamubc-orbit/
// 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: "orbit: allow this connection?" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Button, Text } = $.ui.resolve(e)
    const badge = '…'
    const label = '…'
    const geoNote = '…'
    const capabilityLine = '…'
    const file = '…'
    const count = '…'
    const clock = '…'
    const speed = '…'
    const scrub = '…'
    const line = '…'
    const line2 = '…'
    const line3 = '…'
    const describeRule = '…'
    const length = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" gap={1} flexWrap="wrap">
          <Button plain>
            session
          </Button>
          <Button plain>
            ● all sessions
          </Button>
          <Text dimColor>
            │
          </Text>
          <Button plain>
            ◀
          </Button>
          <Button plain>
            ⌂
          </Button>
          <Button plain>
            ▶
          </Button>
          <Text dimColor>
            │
          </Text>
          <Button plain>
            export
          </Button>
          <Button plain dimColor>
            clear
          </Button>
          <Text dimColor>
            {"│ "}
            watching
          </Text>
        </Box>
        <Box flexDirection="row">
          <Box flexDirection="column" paddingX={1} flexGrow={1}>
            <Text bold wrap="wrap">
              {badge}
            </Text>
            <Text>
              ≋ Anthropic stream breathing…
            </Text>
            <Box flexDirection="column">
              <Text wrap="truncate">
                {`━ ${label} (this one)`}
              </Text>
              <Text wrap="truncate">
                {`━ ${label} (this one)`}
              </Text>
              <Text wrap="truncate">
                {`━ ${label} (this one)`}
              </Text>
              <Text dimColor>
                dashed: inbound
              </Text>
            </Box>
            <Text color="#ffa726" wrap="wrap">
              No home yet: set it in /config → Where you are, or /orbit locate (one public-IP lookup).
            </Text>
            <Box flexDirection="column">
              <Text color="#ffa726" wrap="wrap">
                {`No geo database: connections cannot be placed on the globe yet. ${geoNote}`}
              </Text>
              <Box flexDirection="row" gap={1}>
                <Button variant="primary">
                  Download DB-IP city (~130 MB)
                </Button>
                <Button>
                  country only (~10 MB)
                </Button>
              </Box>
            </Box>
            <Text dimColor wrap="wrap">
              {capabilityLine}
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column">
          <Text color="#ba68c8" wrap="truncate">
            {`replay ${file} · ${count} events · ${clock}`}
          </Text>
          <Box flexDirection="row" gap={1}>
            <Button plain>
              ⏮
            </Button>
            <Button plain>
              ⏸
            </Button>
            <Button plain>
              ⏭
            </Button>
            <Button plain>
              {`${speed}×`}
            </Button>
            <Text color="#ba68c8">
              {scrub}
            </Text>
            <Button plain dimColor>
              close
            </Button>
          </Box>
        </Box>
        <Box flexDirection="column" paddingX={1} borderStyle="round" borderDimColor>
          <Text wrap="truncate">
            {line}
          </Text>
          <Text wrap="truncate">
            {line2}
          </Text>
          <Text wrap="truncate">
            {line3}
          </Text>
          <Box flexDirection="row" gap={1}>
            <Button plain>
              block this host
            </Button>
            <Button plain>
              block this server
            </Button>
            <Button plain>
              allow it
            </Button>
            <Button plain dimColor>
              close
            </Button>
          </Box>
        </Box>
        <Box flexDirection="row" gap={1} flexWrap="wrap">
          <Text dimColor>
            rules:
          </Text>
          <Button plain dimColor>
            {`${describeRule} ✕`}
          </Button>
          <Button plain dimColor>
            {`${describeRule} ✕`}
          </Button>
          <Button plain dimColor>
            {`${describeRule} ✕`}
          </Button>
          <Text dimColor>
            {`+${length} more (/orbit rules)`}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Text dimColor>
            Nothing yet: tool calls, sockets of this session's processes and proxied connections will appear here.
          </Text>
          <Button plain />
          <Button plain />
          <Button plain />
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const tool = '…'
    const subject = '…'
    await $.ui.toast(`This terminal cannot show the globe as pixels; drawing it in colored blocks instead.`)
    await $.ui.toast(`orbit: ${tool} wants ${subject}: widen the terminal to answer, or it is denied in 8 s.`)
    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.

plugins/orbit/hooks/register.tsx lines 938–974 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    // Drawn from what this process kept after a /clear; the host gets it back off the render.
    if (!(await read($, seeded))) $.clock.after(0, () => void reseed($).catch(() => {}))
    const { events: shownEvents, mode: m, scope: s, home: h, selectedId: sel, capabilities: c, replay: r, sessions: all, renderer: rend, spin: sp } = await read($, snapshot)
    const listed = replay ? eventsAt(replay, replay.position) : s === 'all' ? shownEvents : shownEvents.filter(ev => ev.sessionPid === c.self || ev.sessionPid === 0)
    let globe: GlobeBox | null = null
    if (e.surface === 'terminal') {
      const width = e.props.bodyColumns
      const sideBySide = width >= 96
      const columns = Math.max(16, Math.min(sideBySide ? 48 : width - 2, 64))
      const rows = Math.max(8, Math.round(columns / 2))
      const view: View = { requestId: PANE, columns, rows, renderer: rend }
      views = [...views.filter(v => v.requestId !== PANE), view]
      const scene = sceneFor(view, now(), replay ? replay.position : now(), listed as TraceEvent[])
      const painted = paint(view, scene)
      globe = { columns, rows, renderer: rend, cells: painted.cells ?? '', png: painted.png ?? '' }
      lastFrameAt = now()
    }
    return drawPane($.ui.resolve(e) as Table, {
      surface: e.surface,
      bodyColumns: e.props.bodyColumns,
      viewportRows: e.viewport?.rows ?? 40,
      events: listed as TraceEvent[],
      summary: summarize(listed as TraceEvent[]),
      scope: s,
      mode: m,
      rules: currentRules,
      home: h,
      selectedId: sel,
      capabilities: c,
      replay: r,
      sessions: all,
      globe,
      isGenerating: now() < generatingUntil,
      spin: sp,
    }, actionsFor($))
  })
plugins/orbit/hooks/pane.tsx lines 117–276 · Pane
export function drawPane(ui: Table, m: PaneModel, a: Actions) {
  const { Box, Text, Button } = ui
  const width = Math.max(30, m.bodyColumns)
  const isAll = m.scope === 'all'
  const sessionPids = [...new Set(m.events.map(ev => ev.sessionPid))].sort((x, y) => x - y)
  const selected = m.events.find(ev => ev.id === m.selectedId)

  const header = (
    <Box flexDirection="row" gap={1} flexWrap="wrap">
      <Button key="scope-session" plain dimColor={isAll} onPress={() => a.setScope('session')}>{isAll ? 'session' : '● session'}</Button>
      <Button key="scope-all" plain dimColor={!isAll} onPress={() => a.setScope('all')}>{isAll ? '● all sessions' : 'all sessions'}</Button>
      <Text dimColor>│</Text>
      <Button key="spin-left" plain onPress={() => a.spin(-20)}>◀</Button>
      <Button key="spin-home" plain dimColor={m.spin === null} onPress={() => a.spin(null)}>⌂</Button>
      <Button key="spin-right" plain onPress={() => a.spin(20)}>▶</Button>
      <Text dimColor>│</Text>
      <Button key="export" plain onPress={a.exportTrace}>export</Button>
      <Button key="clear" plain dimColor onPress={a.clear}>clear</Button>
      <Text dimColor>│ {m.mode === 'off' ? 'watching' : `enforcing: ${m.mode}`}</Text>
    </Box>
  )

  const legend = isAll ? (
    <Box flexDirection="column">
      {sessionPids.map(pid => {
        const s = m.sessions.find(x => x.pid === pid)
        const label = m.events.find(ev => ev.sessionPid === pid)?.session || (s ? `${folder(s.cwd)} ${s.tty}` : `pid ${pid}`)
        return <Text color={hex(sessionColor(pid, sessionPids))} wrap="truncate">{`━ ${label}${pid === m.capabilities.self ? ' (this one)' : ''}`}</Text>
      })}
      <Text dimColor>dashed: inbound</Text>
    </Box>
  ) : (
    <Box flexDirection="row" gap={2}>
      <Text color={hex(OUTBOUND)}>━ out</Text>
      <Text color={hex(INBOUND)}>━ in</Text>
      <Text color={hex(BLOCKED)}>╌ blocked</Text>
      <Text color={hex(HOME)}>● you</Text>
    </Box>
  )

  const homeLine =
    m.home.source === 'none' ? (
      <Text color="#ffa726" wrap="wrap">No home yet: set it in /config → Where you are, or /orbit locate (one public-IP lookup).</Text>
    ) : (
      <Text dimColor wrap="truncate">{`you: ${m.home.label || `${m.home.lat.toFixed(2)}, ${m.home.lon.toFixed(2)}`}${m.home.source === 'lookup' ? ' (from your public IP)' : ''}`}</Text>
    )

  const geoLine =
    m.capabilities.geo === 'ready' ? null : m.capabilities.geo === 'downloading' ? (
      <Text color="#4dd0e1" wrap="wrap">{`Downloading the geo database… ${m.capabilities.geoNote}`}</Text>
    ) : m.capabilities.geo === 'no-node' ? (
      <Text color="#ffa726" wrap="wrap">Places need Node.js for the geo helper: install node, or set its path in /config.</Text>
    ) : (
      <Box flexDirection="column">
        <Text color="#ffa726" wrap="wrap">{`No geo database: connections cannot be placed on the globe yet.${m.capabilities.geoNote ? ' ' + m.capabilities.geoNote : ''}`}</Text>
        <Box flexDirection="row" gap={1}>
          <Button key="geo-city" variant="primary" onPress={() => a.downloadGeo('city')}>Download DB-IP city (~130 MB)</Button>
          <Button key="geo-country" onPress={() => a.downloadGeo('country')}>country only (~10 MB)</Button>
        </Box>
      </Box>
    )

  const replay = m.replay ? (
    <Box flexDirection="column">
      <Text color="#ba68c8" wrap="truncate">{`replay ${m.replay.file.slice(m.replay.file.lastIndexOf('/') + 1)} · ${m.replay.count} events · ${clock(m.replay.position)}`}</Text>
      <Box flexDirection="row" gap={1}>
        <Button key="rp-back" plain onPress={() => a.replaySeek(-1)}>⏮</Button>
        <Button key="rp-toggle" plain onPress={a.replayToggle}>{m.replay.isPlaying ? '⏸' : '▶'}</Button>
        <Button key="rp-fwd" plain onPress={() => a.replaySeek(1)}>⏭</Button>
        <Button key="rp-speed" plain onPress={a.replaySpeed}>{`${m.replay.speed}×`}</Button>
        <Text color="#ba68c8">{scrub(m.replay, Math.max(8, Math.min(width - 24, 60)))}</Text>
        <Button key="rp-close" plain dimColor onPress={a.replayClose}>close</Button>
      </Box>
    </Box>
  ) : null

  const side = (
    <Box flexDirection="column" paddingX={1} flexGrow={1}>
      <Text bold wrap="wrap">{badge(m)}</Text>
      {m.isGenerating && <Text color={hex(OUTBOUND)}>≋ Anthropic stream breathing…</Text>}
      {legend}
      {homeLine}
      {geoLine}
      <Text dimColor wrap="wrap">{capabilityLine(m.capabilities)}</Text>
    </Box>
  )

  let globe: any = null
  if (m.surface === 'terminal' && m.globe) {
    const { Raster, Image } = ui
    globe =
      m.globe.renderer === 'image' ? (
        <Image key="globe" source={{ png: m.globe.png }} columns={m.globe.columns} rows={m.globe.rows} alt="the globe" />
      ) : (
        <Raster key="globe" columns={m.globe.columns} rows={m.globe.rows} cells={m.globe.cells} />
      )
  } else if (m.surface !== 'terminal') {
    globe = <Text dimColor wrap="wrap">The globe draws in the terminal; here is the trace.</Text>
  }

  const sideBySide = m.globe !== null && width >= m.globe.columns + 44
  const globeRows = m.globe ? m.globe.rows : 1
  const used = 2 + (sideBySide ? Math.max(globeRows, 8) : globeRows + 8) + (m.replay ? 2 : 0) + (selected ? 5 : 0) + 2
  const room = Math.max(3, m.viewportRows - used)
  const listed = [...m.events].sort((x, y) => y.t - x.t).slice(0, room)

  const log = (
    <Box flexDirection="column">
      {listed.length === 0 && <Text dimColor>Nothing yet: tool calls, sockets of this session's processes and proxied connections will appear here.</Text>}
      {listed.map(ev => (
        <Button key={`ev:${ev.id}`} plain dimColor={ev.id !== m.selectedId && ev.status !== 'open'} onPress={() => a.select(ev.id)}>
          {eventLine(ev, width - 1, isAll)}
        </Button>
      ))}
    </Box>
  )

  const detail = selected ? (
    <Box flexDirection="column" paddingX={1} borderStyle="round" borderDimColor>
      {detailLines(selected).map(line => (
        <Text wrap="truncate">{line}</Text>
      ))}
      <Box flexDirection="row" gap={1}>
        {(selected.host || selected.ip) && selected.status !== 'blocked' && (
          <Button key="detail-block" plain onPress={() => a.block(selected.host && !selected.host.startsWith('mcp:') ? selected.host : selected.ip)}>block this host</Button>
        )}
        {selected.host.startsWith('mcp:') && <Button key="detail-block-mcp" plain onPress={() => a.block(selected.host)}>block this server</Button>}
        {selected.status === 'blocked' && <Button key="detail-allow" plain onPress={() => a.allow(selected.note.replace(/^.*?(host|mcp|tool):/, '$1:'))}>allow it</Button>}
        <Button key="detail-close" plain dimColor onPress={() => a.select('')}>close</Button>
      </Box>
    </Box>
  ) : null

  const rules =
    m.rules.length > 0 ? (
      <Box flexDirection="row" gap={1} flexWrap="wrap">
        <Text dimColor>rules:</Text>
        {m.rules.slice(0, 8).map(r => (
          <Button key={`rule:${r.kind}:${r.pattern}`} plain dimColor onPress={() => a.unrule(r)}>{`${describeRule(r)} ✕`}</Button>
        ))}
        {m.rules.length > 8 && <Text dimColor>{`+${m.rules.length - 8} more (/orbit rules)`}</Text>}
      </Box>
    ) : null

  return (
    <Box flexDirection="column">
      {header}
      {sideBySide ? (
        <Box flexDirection="row">
          {globe}
          {side}
        </Box>
      ) : (
        <Box flexDirection="column">
          {globe}
          {side}
        </Box>
      )}
      {replay}
      {detail}
Licence text (MIT)
MIT License

Copyright (c) 2026 jamubc

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

networkruns programswrites 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 3027e57e6edc 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.plugins/orbit/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.12 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.https://api.ipify.org, https://ipinfo.io
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.plugins/orbit/hooks/register.tsx:192 a program named at run time; plugins/orbit/hooks/register.tsx:524 a program named at run time; plugins/orbit/hooks/register.tsx:572 a program named at run time
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 jamubc/toolbox
/plugin install orbit@toolbox

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

Search them from Claude: the MCP connector

Similar designs