ModsCode / Claude Code Mods / Ranking / open-tray
open-tray
POWERTRAY: a pane of things to look at or listen to (what Claude made this session, things related to what you are on, local servers), a player for a film's sound, plain-words recaps of the work (detailed on request, quick by Haiku if you …
What it does
- Draws a pane, toasts
- Adds /tray
- Watches mcp__open-tray__checklist, mcp__open-tray__stash, mcp__open-tray__offer calls and can refuse them
- Hooks agent.spawn, prompt.edit, prompt.submit, session.start and 2 more
- 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
A starter ModsCode writes from the drawing it read, and the mod's own lines that draw, where there are any.
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/claude-mods/mods/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: "POWERTRAY" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const letter = '…'
const letter2 = '…'
const letter3 = '…'
const hot = '…'
const open = '…'
const toReview = '…'
const spinner = '…'
const time = '…'
const label = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" justifyContent="space-between">
<Box flexDirection="row">
<Box flexDirection="row">
<Text color="#ff3b5c">
{"▚▞ "}
</Text>
<Text bold>
{letter}
</Text>
<Text bold>
{letter2}
</Text>
<Text bold>
{letter3}
</Text>
</Box>
<Text>
{" "}
</Text>
<Box flexDirection="row" marginTop={0}>
<Text color="#ff4fd8">
▸
</Text>
<Button plain hotkey={`${hot}`} label="TRAY " />
<Text color="#ff4fd8">
▸
</Text>
<Button plain hotkey={`${hot}`}>
<Text color="#ffb000">
RECAP
</Text>
{" "}
</Button>
<Text color="#ff4fd8">
▸
</Text>
<Button plain hotkey={`${hot}`} label="LISTS" />
<Text color="#6b6f9e">
{` ${open} left `}
</Text>
<Text color="#ff4fd8">
▸
</Text>
<Button plain hotkey={`${hot}`} label="STASH" />
<Text color="#ff4fd8">
{` ${toReview} to review`}
</Text>
<Box flexDirection="row">
<Text color="#ff4fd8">
{` ${spinner}`}
</Text>
<Text color="#6b6f9e">
{" writing"}
</Text>
</Box>
</Box>
</Box>
<Text color="#6b6f9e">
PLAYER 1 READY
</Text>
</Box>
<Box flexDirection="column" borderStyle="double" borderColor="#ff4fd8" paddingX={1}>
<Box flexDirection="row" justifyContent="space-between">
<Text bold color="#5ce1e6">
PAUSED
</Text>
<Box flexDirection="row">
<Text color="#b9bdf0">
{time}
</Text>
<Text>
{" "}
</Text>
<Button plain label="×" />
</Box>
</Box>
<Text color="#5ce1e6">
{`♪ ${label}`}
</Text>
<Box flexDirection="row">
<Text color="#ff4fd8">
████████
</Text>
<Text color="#3b3f8f">
░░░░░░░░
</Text>
</Box>
<Box flexDirection="row" flexWrap="wrap">
<Button plain label="▶ play " />
<Button plain label="-1m " />
<Button plain label="-10s " />
<Button plain label="+10s " />
<Button plain label="+1m" />
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const length = '…'
await $.ui.toast(`POWERTRAY: a new checklist is in the Lists tab (/tray lists)`)
await $.ui.toast(`POWERTRAY: ${length} to review in the Stash tab (/tray stash)`)
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 473–632 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const elements = $.ui.resolve(e)
const { Box, Text, Button } = elements
// Typing in the pane is the terminal's; elsewhere, Claude adds the items.
const Input = 'Input' in elements ? elements.Input : null
// Pictures are cells on the terminal alone; other surfaces get a line instead.
const Raster = e.surface === 'terminal' && 'Raster' in elements ? elements.Raster : null
const columns = e.props.bodyColumns
const now = await $.clock.now()
const r = await read($, related)
const showing = await read($, tab)
const rc = await read($, recaps)
const done = await read($, work)
const isAuto = await read($, autoRecap)
const ls = await read($, lists)
const lui = await read($, listsUi)
const open = ls.all.reduce((n, l) => n + l.items.filter(it => !it.isDone).length, 0)
const sound = await read($, playing)
const kept = await read($, stash)
const toReview = kept.filter(it => it.section === 'review' && !it.isReviewed).length
// In the Stash tab, a stashed file's sound plays under its own row.
const isPlayingStashed = showing === 'stash' && Boolean(sound && kept.some(it => it.path === sound.target))
await read($, tick) // Redraws the player's clock each second while it plays.
const step = rc.isWriting ? await read($, spin) : 0 // Moves the recap's bar while it is written.
const writingFor = rc.isWriting && rc.startedAt ? `${Math.max(0, Math.round((now - rc.startedAt) / 1000))}s` : ''
// Haiku's word that the newest recap no longer holds; nothing while one is being written.
const behind = rc.list.length > 0 && !rc.isWriting ? (rc.staleWhy ?? '') : ''
// Under the transcript a pane gets few rows: the header and tabs share one, and the controls come first.
const isTight = e.props.placement === 'inline' || (e.props.scroll?.bodyRows ?? 40) < 20
const gap = isTight ? 0 : 1
// Keys work once the person has given the pane the keyboard (a click); until then no "1:" label promises them.
const hot = (key: string) => (e.props.isFocused ? key : undefined)
// "Waiting on you" is a checklist like any other, so a tick in Recap and one in Lists are the same tick.
const waitingList = ls.all.find(l => l.title.toLowerCase() === WAITING_LIST.toLowerCase())
const waitingItem = (text: string) => waitingList?.items.find(it => it.text.toLowerCase() === text.trim().toLowerCase())
const title = (text: string, count?: number | string) => {
const tail = count === undefined ? '' : ` ${count}`
return (
<Box flexDirection="row" marginTop={gap}>
<Text color={THEME.grid}>{'▸ '}</Text>
<Text bold color={THEME.chrome}>{text.toUpperCase()}</Text>
<Text color={THEME.faint}>{`${tail} `}</Text>
<Text color={THEME.rule}>{'─'.repeat(Math.max(0, columns - text.length - tail.length - 3))}</Text>
</Box>
)
}
// A checkbox that says who ticked it: Claude's spark in orange, the person's figure in green.
const tickBox = (key: string, it: { isDone: boolean; doneBy: CheckItem['doneBy'] } | undefined, onPress: () => void) => {
const by = TICKED[it?.doneBy ?? 'you']
return (
<Button key={key} plain onPress={onPress}>
{' ['}
{it?.isDone ? <Text color={by.color}>{by.mark}</Text> : ' '}
{'] '}
</Button>
)
}
const brand = (
<Box flexDirection="row">
<Text color={THEME.grid}>{'▚▞ '}</Text>
{[...NAME].map((letter, i) => (
<Text bold color={NAME_COLORS[i % NAME_COLORS.length]}>{letter}</Text>
))}
</Box>
)
// The area shows only as the Related heading on the Tray tab; the corner says whether the keys work.
const chip = <Text color={THEME.faint}>{e.props.isFocused ? 'PLAYER 1 READY' : 'CTRL+X TAB FOR KEYS'}</Text>
// RECAP's news (new, being written) goes at the end of the row, so no tab moves when it comes or goes.
const tabs = (
<Box flexDirection="row" marginTop={isTight ? 0 : 1}>
<Text color={THEME.accent}>{showing === 'tray' ? '▸' : ' '}</Text>
<Button key="tab-tray" plain hotkey={hot('1')} dimColor={showing !== 'tray'} label="TRAY " onPress={() => void showTab($, 'tray')} />
<Text color={THEME.accent}>{showing === 'recap' ? '▸' : ' '}</Text>
{/* Stale: the tab's own name turns amber; the Recap tab says why. */}
{behind && !rc.isNew ? (
<Button key="tab-recap" plain hotkey={hot('2')} onPress={() => void showTab($, 'recap')}>
<Text color={THEME.warn} bold={showing === 'recap'}>{'RECAP'}</Text>
{' '}
</Button>
) : (
<Button key="tab-recap" plain hotkey={hot('2')} dimColor={showing !== 'recap'} label="RECAP " onPress={() => void showTab($, 'recap')} />
)}
<Text color={THEME.accent}>{showing === 'lists' ? '▸' : ' '}</Text>
<Button key="tab-lists" plain hotkey={hot('3')} dimColor={showing !== 'lists'} label="LISTS" onPress={() => void showTab($, 'lists')} />
<Text color={THEME.faint}>{open > 0 ? ` ${open} left ` : ' '}</Text>
<Text color={THEME.accent}>{showing === 'stash' ? '▸' : ' '}</Text>
<Button key="tab-stash" plain hotkey={hot('4')} dimColor={showing !== 'stash'} label="STASH" onPress={() => void showTab($, 'stash')} />
<Text color={THEME.accent}>{toReview > 0 ? ` ${toReview}${columns >= 66 ? ' to review' : ''}` : ''}</Text>
{rc.isWriting ? (
<Box flexDirection="row">
<Text color={THEME.accent}>{` ${spinner(step)}`}</Text>
<Text color={THEME.faint}>{showing === 'recap' ? ' writing' : ` writing recap ${writingFor}`}</Text>
</Box>
) : rc.isNew ? (
<Box flexDirection="row">
<Text color={THEME.accent}>{' ●'}</Text>
<Text color={THEME.faint}>{' new recap'}</Text>
</Box>
) : null}
</Box>
)
const top = isTight ? (
<Box flexDirection="row" justifyContent="space-between" width={columns}>
<Box flexDirection="row">
{brand}
<Text>{' '}</Text>
{tabs}
</Box>
{chip}
</Box>
) : (
<Box flexDirection="column" width={columns}>
<Box flexDirection="row" justifyContent="space-between" width={columns}>
{brand}
{chip}
</Box>
{tabs}
</Box>
)
const body =
showing === 'recap' ? drawRecap() : showing === 'lists' ? drawLists() : showing === 'stash' ? await drawStash() : await drawTray()
return (
<Box flexDirection="column" width={columns}>
{top}
{sound && !isPlayingStashed && drawPlayer(sound)}
{body}
</Box>
)
// The player card, `width` cells wide: the pane's, or a stashed file's indented spot.
function drawPlayer(p: NonNullable<typeof sound>, width = columns) {
const inner = Math.max(10, width - 4)
const at = positionOf(p, now)
const time = p.duration ? `${clockText(at)} / ${clockText(p.duration)}` : clockText(at)
const filled = p.duration ? Math.round(inner * Math.min(1, at / p.duration)) : 0
const isPaused = p.startedAt === null
const fits = (seconds: number) => p.duration === null || p.duration > seconds * 2
return (
<Box flexDirection="column" borderStyle="double" borderColor={THEME.accent} paddingX={1} marginTop={gap} width={width}>
<Box flexDirection="row" justifyContent="space-between" width={inner}>
<Text bold color={THEME.chrome}>{isPaused ? 'PAUSED' : 'NOW PLAYING'}</Text>
{/* The corner ×: stops it and puts the card away. */}
<Box flexDirection="row">
<Text color={THEME.sub}>{time}</Text>
<Text>{' '}</Text>
<Button key="stop" plain label="×" onPress={() => void stopSound($)} />
</Box>
</Box>
<Text color={KIND_COLORS.audio}>{`♪ ${clip(p.label, inner - 2)}`}</Text>
{p.duration ? (
<Box flexDirection="row">
{filled > 0 && <Text color={THEME.accent}>{'█'.repeat(filled)}</Text>}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.
How to build this: Pane (panel), Deny a tool call
What its code calls
runs programsreads filesenv varsdrives Claudetool callsremembers
What its code shows
Read from the source at commit e821ee9090d3 on 2026-10-11. 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.7 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:795 open (not on Windows); open-tray/hooks/register.tsx:1114 open (not on Windows); open-tray/hooks/register.tsx:1191 open (not on Windows); open-tray/hooks/register.tsx:1204 open (not on Windows); open-tray/hooks/register.tsx:1207 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:1313 /bin/sh (a shell or interpreter); open-tray/hooks/register.tsx:1330 /bin/sh (a shell or interpreter); open-tray/hooks/register.tsx:1349 /bin/sh (a shell or interpreter); open-tray/hooks/register.tsx:1421 a program named at run time; open-tray/hooks/register.tsx:1473 a program named at run time |
| Reads and sends | Whether it both reads something of yours (files, environment variables, the transcript, settings) and reaches outside (the network, an MCP server, another session, telemetry).reads environment variables, files, the transcript 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 |
| Settings hooks | Hooks declared in hooks/hooks.json or plugin.json beside the module: a command (a shell when it has no args), an HTTP request, an MCP tool or a model prompt at an event. They run outside $.no settings hooks: its function hooks alone |
| Servers it ships | MCP servers (a program, or a URL; a headersHelper is a shell command; a .mcpb bundle is unpacked at run time), LSP servers, monitors (a shell command for the whole session) and bin/ (on the PATH of the Bash tool).ships no MCP or LSP server, no monitor, no bin/ |
| Skills, commands, agents | What its Markdown declares beyond text: allowed-tools granted for the turn, hooks added when a skill is invoked, a command run before Claude reads the skill.no skills, commands, agents or workflows |
| Tools and MCP | Whether every tool it calls through $.tool.call and $.mcp.call is named in the code, and none is a shell (Bash through the tool runs a shell without $.process).calls no tool, MCP server or command |
| Asks of the model | Completions it runs ($.model.complete, fork, classify), subagents it spawns, prompts it submits as you, and the tools, commands and agents it adds.adds command tray, adds tool offer, adds tool checklist, adds tool stash, prompt.submit (as the person), model.complete, model.fork (sends its own transcript) |
| Events it hooks | By what a hook there can do: gates (refuse a tool call, a prompt, a setting, another plugin), shapes (what the model reads: the system prompt, tool descriptions, each request), reads (your input, the events of the settings hooks, every event with *), and the rest.gates: prompt.submit, tool.call (mcp__open-tray__checkli…, mcp__open-tray__stash, mcp__open-tray__offer), command.run (tray) · reads: prompt.edit · also: session.start, agent.spawn, turn.complete, ui.close (+1) · timers: clock.every, clock.after |
| Reads, by name | The environment variables and files it names, and whether it reads the transcript, settings.json, the prompt box or the mouse selection.env: HOME; files: a path computed at run time, …/…; the transcript |
| Writes, by name | The files and environment variables it names, and whether it changes settings, the prompt box, the clipboard, the conversation (a row the model reads) or another session.the clipboard; the prompt box |
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 its code (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.
From its marketplace
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@claudemods/reload-pluginsThis installs the marketplace's latest commit, which may not be the one read here (e821ee9090d3). Compare them before you install. /reload-plugins loads it into a session that is already open.
Try the commit ModsCode read
No marketplace needed. In a terminal, clone the repository, check out the commit read, validate the mod, and load it for one session:
git clone https://github.com/jakerains/claudemodsgit -C claudemods checkout e821ee9090d36d856676084c43100e98361e4c88claude plugin validate claudemods/open-trayclaude --plugin-dir claudemods/open-trayThe validate line lists the events the mod hooks and what it asks Claude Code to do, without running it. The last line loads the mod for this session only and writes nothing to your settings. If the author has rewritten history, the commit may no longer exist.
Ask Claude about it
With the ModsCode connector added, Claude can read this mod's code and what it reaches, and build on them. Ask it like this:
Read the ModsCode mod "jakerains-open-tray" with its code and make me one like itSearch them from Claude: the MCP connector
Similar mods
- ruflo-swarmruvnet★ 74,323
- code-modernizationAnthropic★ 37,653
- moai-boardMoAI-ADK★ 1,230
- crit-tuiTomasz Tomczyk★ 1,196
- lcu-approveLCU★ 894
- ai-maestro-secrets23blocks-OS★ 817
More from this repository
- context-gaugeJake Rains★ 0
- prompt-cache-controlJake Rains (adapted from claude-code-templates by Daniel Áv…★ 0
Badge for your README
If this is your mod, paste this into your README. It links to this page.
[](https://modscode.com/claude-mods/mods/jakerains-open-tray/)