modscode / Gallery / open-tray
open-tray
A pane of things to look at or listen to: what Claude made this session, things related to what you are working on, and local servers. Project rules in .claude/tray.json or ~/.claude/open-tray/rules/.
What it does
- Draws a pane, toasts
- Adds /tray
- Watches mcp__open-tray__offer calls and can refuse them
- Hooks prompt.submit, session.start, turn.complete
- 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)
import type { Register } from 'claude-code'
// Drawn like open-tray by Jake Rains (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/jakerains-open-tray/
// 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: "Open Tray" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const label = '…'
const text = '…'
const count = '…'
const ICONS = '…'
const meta = '…'
const text2 = '…'
const tag = '…'
const url = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" justifyContent="space-between">
<Text bold>
<Text color="#a78bfa">
{"◆ "}
</Text>
Open Tray
</Text>
<Text backgroundColor="#a78bfa" color="#14121c" bold>
{` ${label} `}
</Text>
</Box>
<Box flexDirection="column" marginTop={1} paddingX={1}>
<Text color="#b8b5c8">
Nothing here yet.
</Text>
<Text color="#6e6a80" wrap="wrap">
Films, audio, images and pages I make for you land here. As we work, things related to what we are on show up below.
</Text>
</Box>
<Box flexDirection="row" marginTop={1}>
<Text bold color="#a78bfa">
{text}
</Text>
<Text color="#6e6a80">
{` ${count} `}
</Text>
<Text color="#3a3750">
────────
</Text>
</Box>
<Box flexDirection="row" justifyContent="space-between" backgroundColor="#26243a">
<Box flexDirection="row" flexShrink={1}>
<Text color="#a78bfa">
▌
</Text>
<Text>
{` ${ICONS} `}
</Text>
<Button plain label={`${label}`} />
</Box>
<Text color="#6e6a80">
{` ${meta} `}
</Text>
</Box>
<Box flexDirection="row" justifyContent="space-between" backgroundColor="#26243a">
<Box flexDirection="row" flexShrink={1}>
<Text color="#a78bfa">
▌
</Text>
<Text>
{` ${ICONS} `}
</Text>
<Button plain label={`${label}`} />
</Box>
<Text color="#6e6a80">
{` ${meta} `}
</Text>
</Box>
<Box flexDirection="row" justifyContent="space-between" backgroundColor="#26243a">
<Box flexDirection="row" flexShrink={1}>
<Text color="#a78bfa">
▌
</Text>
<Text>
{` ${ICONS} `}
</Text>
<Button plain label={`${label}`} />
</Box>
<Text color="#6e6a80">
{` ${meta} `}
</Text>
</Box>
<Box flexDirection="row" marginTop={1}>
<Text bold color="#a78bfa">
{text2}
</Text>
<Text color="#6e6a80">
{` ${count} `}
</Text>
<Text color="#3a3750">
────────
</Text>
</Box>
<Box flexDirection="row" flexWrap="wrap" marginTop={1}>
<Button plain hotkey="o" label="open " />
<Button plain hotkey="f" label="Finder " />
<Button plain hotkey="a" label="audio " />
<Button plain hotkey="p" label="keep " />
<Button plain hotkey="x" label="remove " />
<Button plain hotkey="j" label="down " />
<Button plain hotkey="k" label="up" />
</Box>
<Box flexDirection="column" borderStyle="round" borderColor="#3a3750" paddingX={1} marginTop={1}>
<Text bold color="#b8b5c8">
Local servers
</Text>
<Box flexDirection="row">
<Text color="#4ade80">
{"● "}
</Text>
<Button plain label={`${tag} ${url}`} />
<Text color="#f87171">
{" stopped"}
</Text>
</Box>
<Box flexDirection="row">
<Text color="#4ade80">
{"● "}
</Text>
<Button plain label={`${tag} ${url}`} />
<Text color="#f87171">
{" stopped"}
</Text>
</Box>
<Box flexDirection="row">
<Text color="#4ade80">
{"● "}
</Text>
<Button plain label={`${tag} ${url}`} />
<Text color="#f87171">
{" stopped"}
</Text>
</Box>
<Button plain hotkey="r" label={`restart ${tag}`} />
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const baseName = '…'
await $.ui.toast(`Not found: ${baseName}`)
await $.ui.toast(`Shown in Finder: Open Tray opens only films, audio, images, pages and documents`)
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.
open-tray/hooks/register.tsx lines 236–365 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const mine = await read($, items)
const r = await read($, related)
const away = new Set(await read($, hidden))
const live = await read($, players)
const now = await $.clock.now()
const columns = e.props.bodyColumns
const rows = flatten(mine, r, away)
const pick = Math.min(await read($, selected), Math.max(0, rows.length - 1))
const stopped = live.find(p => !p.isAlive)
const mineCount = rows.filter(row => row.place === 'mine').length
const areaCount = rows.length - mineCount
const title = (text: string, count: number) => (
<Box flexDirection="row" marginTop={1}>
<Text bold color={THEME.accent}>{text.toUpperCase()}</Text>
<Text color={THEME.faint}>{` ${count} `}</Text>
<Text color={THEME.rule}>{'─'.repeat(Math.max(0, columns - text.length - String(count).length - 2))}</Text>
</Box>
)
const line = (index: number) => {
const row = rows[index]!
const isPicked = index === pick
const bar = <Text color={THEME.accent}>{isPicked ? '▌' : ' '}</Text>
if (row.kind === 'action') {
return (
<Box flexDirection="row" backgroundColor={isPicked ? THEME.picked : undefined}>
{bar}
<Text color={THEME.go}>{' ⏵ '}</Text>
<Button key={`row-${index}`} plain label={clip(row.action.label, columns - 5)} onPress={() => void runRow($, index)} />
</Box>
)
}
const meta = `${row.item.tag ? `${row.item.tag} ` : ''}${ago(now - row.item.addedAt)}`
return (
<Box flexDirection="row" justifyContent="space-between" width={columns} backgroundColor={isPicked ? THEME.picked : undefined}>
<Box flexDirection="row" flexShrink={1}>
{bar}
<Text color={KIND_COLORS[row.item.kind]}>{` ${ICONS[row.item.kind]} `}</Text>
<Button
key={`row-${index}`}
plain
label={clip(row.item.label, Math.max(8, columns - meta.length - 7))}
onPress={() => void runRow($, index)}
/>
</Box>
<Text color={THEME.faint}>{` ${meta} `}</Text>
</Box>
)
}
// The area's rows, under a small heading per group.
const areaLines: RenderChildren[] = []
let lastGroup = ''
rows.forEach((row, index) => {
if (row.place !== 'area') return
if (row.group !== lastGroup) {
areaLines.push(<Text color={THEME.sub}>{` ${row.group}`}</Text>)
lastGroup = row.group
}
areaLines.push(line(index))
})
return (
<Box flexDirection="column" width={columns}>
<Box flexDirection="row" justifyContent="space-between" width={columns}>
<Text bold>
<Text color={THEME.accent}>{'◆ '}</Text>
{'Open Tray'}
</Text>
{r.label ? (
<Text backgroundColor={THEME.accent} color={THEME.onAccent} bold>{` ${r.label} `}</Text>
) : (
<Text color={THEME.faint}>{'following your work'}</Text>
)}
</Box>
{rows.length === 0 && (
<Box flexDirection="column" marginTop={1} paddingX={1}>
<Text color={THEME.sub}>{'Nothing here yet.'}</Text>
<Text color={THEME.faint} wrap="wrap">
{'Films, audio, images and pages I make for you land here. As we work, things related to what we are on show up below.'}
</Text>
</Box>
)}
{mineCount > 0 && title('Made this session', mineCount)}
{rows.map((row, index) => (row.place === 'mine' ? line(index) : null))}
{areaCount > 0 && title(r.label || 'Related', areaCount)}
{areaLines}
{rows.length > 0 && (
<Box flexDirection="row" flexWrap="wrap" marginTop={1}>
<Button key="open" plain hotkey="o" label="open " onPress={() => void runRow($, pick)} />
<Button key="finder" plain hotkey="f" label="Finder " onPress={() => void act($, pick, 'finder')} />
<Button key="audio" plain hotkey="a" label="audio " onPress={() => void act($, pick, 'audio')} />
<Button key="keep" plain hotkey="p" label="keep " onPress={() => void keep($, pick)} />
<Button key="remove" plain hotkey="x" label="remove " onPress={() => void remove($, pick)} />
<Button key="down" plain hotkey="j" label="down " onPress={() => void move($, 1)} />
<Button key="up" plain hotkey="k" label="up" onPress={() => void move($, -1)} />
</Box>
)}
{live.length > 0 && (
<Box flexDirection="column" borderStyle="round" borderColor={THEME.rule} paddingX={1} marginTop={1}>
<Text bold color={THEME.sub}>{'Local servers'}</Text>
{live.map((player, index) => (
<Box flexDirection="row">
<Text color={player.isAlive ? THEME.go : THEME.stop}>{player.isAlive ? '● ' : '○ '}</Text>
<Button
key={`player-${index}`}
plain
dimColor={!player.isAlive}
label={`${player.tag ?? 'player'} ${player.url}`}
onPress={() => void $.process.run(['open', player.url])}
/>
{!player.isAlive && <Text color={THEME.stop}>{' stopped'}</Text>}
</Box>
))}
{stopped && (
<Button key="restart" plain hotkey="r" label={`restart ${stopped.tag ?? stopped.url}`} onPress={() => void restart($, stopped)} />
)}
</Box>
)}
</Box>
)
})Licence text (MIT)
MIT License Copyright (c) 2026 Jake Rains 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 filesenv varsdrives 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 814b7ca1ba85 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 read | Every module hooks/hooks.json names was read.open-tray/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.2 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No 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 open | Network 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 draws | The 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 line | Whether 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 Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).open-tray/hooks/register.tsx:353 open (not on Windows); open-tray/hooks/register.tsx:408 open (not on Windows); open-tray/hooks/register.tsx:421 open (not on Windows); open-tray/hooks/register.tsx:424 open (not on Windows); open-tray/hooks/register.tsx:437 open (not on Windows) |
| Network | Whether every fetch names its https host in the code.no network |
| Programs | Whether every program it starts is named in the code and is not a shell, an interpreter or a network tool.open-tray/hooks/register.tsx:542 /bin/sh (a shell or interpreter); open-tray/hooks/register.tsx:561 /bin/sh (a shell or interpreter); open-tray/hooks/register.tsx:643 curl (reaches the network) |
| Reads and sends | Whether it both reads files or environment variables and reaches the network.reads environment variables and files and reaches the network |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An 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 jakerains/claudemods/plugin install open-tray@claudemodsThis installs the marketplace's latest commit, which may not be the one read here (814b7ca1ba85). 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 "jakerains-open-tray" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…Fix login▸★ build ok▸★ build ok▸★ build ok+3 moretasks 3 pending · Glob claimed · 3 doneConsensus42%
-
Ask Claude…2h 10m · █████░░░✓ build ✓ build ✓ buildJavaKotlin3 Python■ ok 3 ■ ok 3 ■ ok 3 Razor proven 3 Razor proven 3 Razor proven 3Phases ──────── 3/3build Pythonbuild Pythonbuild Python… 3 more phasesLua ──────── 3/Kotlin■ the whole upgrade Ruby■ build build Ruby■ build build Ruby■ build build Ruby … 3 moreNext ──────── PythonRuby (by hand)Podsclick a button, or ctrl+x tab then Tab, EnterAttention ──────── 3! Scala ! Scala ! Scala … 3 moreSession ──────── okJava
-
Ask Claude…moai-boardmoai-boardPickedx closebuild 1build 2build 3r refreshQueue not read yetokPick
-
Open a file first: /crit-tui file <path>Reopen this one in the crit browser view.Ask Claude…
-
Ask Claude…./rows.tsx●●●●●×./rows.tsxnothing loaded yet● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login./rows.tsxWorkspaceWorkspaceWorkspaceselected: build● open in Databricks
-
Ask Claude…build 3 app●●●◉●●okno Library app here yet; Library adds one●./rows.tsx./rows.tsxselected: Nerd