ModsCode / Claude Code Mods / Ranking / playpen
playpen
The sessions you are working in right now as small cards above the prompt: a status lamp, a short label, what just happened, and one press to answer or jump there.
What it does
- Draws a band above the prompt, toasts
- Adds /board
- Watches AskUserQuestion calls and can refuse them
- Hooks classic.Notification, classic.PermissionRequest, classic.PostModelSwitch, prompt.context and 8 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 playpen by Joel Rönnqvist (band, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/kytioisacat-playpen/
// 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 band above the prompt; what else goes there is drawn under it
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const { Box, Text, Button } = $.ui.resolve(e)
const label = '…'
const title = '…'
const text = '…'
const n = '…'
const label2 = '…'
const label3 = '…'
const suggestion = '…'
const title2 = '…'
const text2 = '…'
const label4 = '…'
const label5 = '…'
const label6 = '…'
const suggestion2 = '…'
const title3 = '…'
const text3 = '…'
const label7 = '…'
const label8 = '…'
const label9 = '…'
const suggestion3 = '…'
const title4 = '…'
const text4 = '…'
const label10 = '…'
const label11 = '…'
const label12 = '…'
const suggestion4 = '…'
const title5 = '…'
const text5 = '…'
const label13 = '…'
const label14 = '…'
const label15 = '…'
const suggestion5 = '…'
const title6 = '…'
const text6 = '…'
const label16 = '…'
const label17 = '…'
const label18 = '…'
const suggestion6 = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" flexWrap="wrap" rowGap={0}>
<Box flexDirection="column" borderStyle="round">
<Box flexDirection="row" justifyContent="space-between">
<Box flexDirection="row" gap={1} overflow="hidden">
<Text>
●
</Text>
<Button plain label={`${label}`} />
</Box>
<Box flexDirection="row" gap={1}>
<Button variant="primary" label="hand off" />
<Button plain label="►" />
<Button plain dimColor label="×" />
</Box>
</Box>
<Text color="red" wrap="truncate-end">
asks you
</Text>
<Box flexDirection="column">
<Text bold wrap="wrap">
{title}
</Text>
<Text color="red" wrap="wrap">
{text}
</Text>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label2}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label3}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button variant="primary" label="send" />
<Box>
<Text wrap="wrap">
{suggestion}
</Text>
</Box>
</Box>
</Box>
<Box position="absolute" flexDirection="column" paddingX={1} borderStyle="round" borderColor="red" display="none">
<Text bold wrap="wrap">
{title2}
</Text>
<Text color="red" wrap="wrap">
{text2}
</Text>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label4}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label5}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label6}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button variant="primary" label="send" />
<Box>
<Text wrap="wrap">
{suggestion2}
</Text>
</Box>
</Box>
</Box>
</Box>
<Box flexDirection="column" borderStyle="round">
<Box flexDirection="row" justifyContent="space-between">
<Box flexDirection="row" gap={1} overflow="hidden">
<Text>
●
</Text>
<Button plain label={`${label}`} />
</Box>
<Box flexDirection="row" gap={1}>
<Button variant="primary" label="hand off" />
<Button plain label="►" />
<Button plain dimColor label="×" />
</Box>
</Box>
<Text color="red" wrap="truncate-end">
asks you
</Text>
<Box flexDirection="column">
<Text bold wrap="wrap">
{title3}
</Text>
<Text color="red" wrap="wrap">
{text3}
</Text>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label7}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label8}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label9}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button variant="primary" label="send" />
<Box>
<Text wrap="wrap">
{suggestion3}
</Text>
</Box>
</Box>
</Box>
<Box position="absolute" flexDirection="column" paddingX={1} borderStyle="round" borderColor="red" display="none">
<Text bold wrap="wrap">
{title4}
</Text>
<Text color="red" wrap="wrap">
{text4}
</Text>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label10}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label11}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label12}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button variant="primary" label="send" />
<Box>
<Text wrap="wrap">
{suggestion4}
</Text>
</Box>
</Box>
</Box>
</Box>
<Box flexDirection="column" borderStyle="round">
<Box flexDirection="row" justifyContent="space-between">
<Box flexDirection="row" gap={1} overflow="hidden">
<Text>
●
</Text>
<Button plain label={`${label}`} />
</Box>
<Box flexDirection="row" gap={1}>
<Button variant="primary" label="hand off" />
<Button plain label="►" />
<Button plain dimColor label="×" />
</Box>
</Box>
<Text color="red" wrap="truncate-end">
asks you
</Text>
<Box flexDirection="column">
<Text bold wrap="wrap">
{title5}
</Text>
<Text color="red" wrap="wrap">
{text5}
</Text>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label13}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label14}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label15}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button variant="primary" label="send" />
<Box>
<Text wrap="wrap">
{suggestion5}
</Text>
</Box>
</Box>
</Box>
<Box position="absolute" flexDirection="column" paddingX={1} borderStyle="round" borderColor="red" display="none">
<Text bold wrap="wrap">
{title6}
</Text>
<Text color="red" wrap="wrap">
{text6}
</Text>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label16}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label17}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button plain hotkey={`${n}`} label={`[${n}1]`} />
<Box>
<Text wrap="wrap">
{label18}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Button variant="primary" label="send" />
<Box>
<Text wrap="wrap">
{suggestion6}
</Text>
</Box>
</Box>
</Box>
</Box>
</Box>
<Box height={0} />
{await next(e)}
</Box>
)
})
on('session.start', async ($, e, next) => {
const label = '…'
const text = '…'
await $.ui.toast(`Could not open the session; its link is on the clipboard`)
await $.ui.toast(`Sent to ${label}: ${text}`)
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 1299–1458 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
if (e.props.hasSurvey || isCollapsed || deck.length === 0) return next(e)
const { Box, Text, Button } = $.ui.resolve(e)
const columns = e.props.bodyColumns
// a terminal draws whole cells; the desktop app takes half a cell of air
// between a card's frame and its content, and between the cards, and a
// hairline between the rows
const space = e.surface === 'terminal' ? 1 : 0.5
// three cards across; each is two rows inside a thin frame: the lamp,
// label, hand-off, reply and ×, then the gist
// a terminal draws whole cells, and a card stops at MAX_CARD there; the
// desktop app takes fractions, so three cards fill the band's width
const isCells = e.surface === 'terminal'
const fit = (columns - (PER_ROW - 1) * space) / PER_ROW
const cardWidth = isCells ? Math.max(MIN_CARD, Math.min(MAX_CARD, Math.floor(fit))) : Math.max(MIN_CARD, fit - 0.01)
const perRow = Math.max(1, Math.floor((columns + space) / (cardWidth + space)))
const inner = Math.floor(cardWidth - 4) // less the frame and its padding
const labelMax = Math.max(8, inner - 8) // room for ✦ ► ×
// The popover: twice a card wide, drawn over the neighbours and never in
// the flow, so no card moves when it shows. The band clips at its own
// edge, so rows are reserved under the cards for the tallest popover
// that may show, and none when no card has one.
const wide = Math.min(columns, cardWidth * 2 + 1)
const wideInner = wide - 4
const rowsOf = (text: string, width: number) => Math.max(1, Math.ceil(text.length / Math.max(1, width)))
const popoverRows = (card: Card) => {
let rows = 2 // the frame
if (trim(card.title, LABEL_MAX) !== card.label) rows += rowsOf(card.title, wideInner)
if (card.permission) {
rows += rowsOf(card.permission, wideInner) + 2
} else if (card.question) {
rows += rowsOf(card.question.text, wideInner)
for (const option of card.question.options) rows += rowsOf(option, wideInner - 4)
} else {
rows += rowsOf(card.snippet || stateWord(card.state), wideInner)
if (card.suggestion) rows += rowsOf(card.suggestion, wideInner - 9)
}
return rows
}
// A red card with a question shows the question and its options in the
// card itself, so the band already has that height, and its popover under
// the pointer is the same content wide. Any card shows the popover while
// open with ►; rows are reserved under the cards only then.
// The desktop app draws the popover over the transcript above the band
// and clips nothing, so there the cards stay two rows and no space is
// kept. The terminal clips at the band's edge: there a red card shows its
// question in the card, and rows are reserved while a card is open.
const isTerminal = e.surface === 'terminal'
const asks = (card: Card) => card.state === 'waiting' && (card.question !== null || !!card.permission)
// The popover is revealed by the pointer alone, which is the one way the
// desktop app draws it whole. A red question has one; ► gives any card
// one for a while, and since the pointer is on the card at the press, it
// shows at once. In a terminal, which clips the popover, the same content
// expands the card in the flow instead.
const hasPopover = (card: Card) => asks(card) || openId === card.id
const expandsInCard = (card: Card) => isTerminal && (asks(card) || openId === card.id)
const cardRowCount = Math.ceil(deck.length / perRow)
// rows kept free under the cards for a terminal's hover popover, which
// hangs below the card and would otherwise be cut at the band's edge
let reserve = 0
if (isTerminal) {
deck.forEach((card, i) => {
if (!hasPopover(card)) return
const rowsBelow = cardRowCount - 1 - Math.floor(i / perRow)
reserve = Math.max(reserve, popoverRows(card) - 1 - rowsBelow * 4)
})
reserve = Math.max(0, Math.min(reserve, e.props.maxRows - cardRowCount * 4))
}
return (
<Box flexDirection="column">
<Box flexDirection="row" flexWrap="wrap" columnGap={space} rowGap={e.surface === 'terminal' ? 0 : 0.1}>
{deck.map((card, i) => {
const isMe = me !== null && card.id === me.id
const isOpen = openId === card.id
const options = card.question?.options ?? []
// a popover that would run past the band's right edge hangs from
// the card's right edge instead
const column = (i % perRow) * (cardWidth + 1)
const anchorRight = column + wide > columns
return (
// a thin frame around the whole card: dim, full strength on this
// session, and the surface brightens it under the pointer by itself
<Box
key={`card:${card.id}`}
flexDirection="column"
width={cardWidth}
paddingX={space}
borderStyle="round"
borderDimColor={!isMe}
hover={{ borderDimColor: false }}
>
<Box flexDirection="row" justifyContent="space-between">
<Box flexDirection="row" gap={1} overflow="hidden">
<Text color={lampColor(card.state)}>●</Text>
<Button
key={`jump:${card.id}`}
plain
label={trim(card.label, labelMax)}
onPress={() => void (isMe ? Promise.resolve() : jump($, card))}
/>
</Box>
<Box flexDirection="row" gap={1}>
{armedId === card.id ? (
<Button
key={`handoff:${card.id}`}
variant="primary"
label="hand off"
onPress={() => pressHandoff($, card, isMe)}
/>
) : (
<Button
key={`handoff:${card.id}`}
plain
dimColor
label="✦"
onPress={() => pressHandoff($, card, isMe)}
/>
)}
<Button
key={`reply:${card.id}`}
plain
dimColor={!isOpen}
label="►"
onPress={() => pressAnswer($, card)}
/>
<Button key={`hide:${card.id}`} plain dimColor label="×" onPress={() => void hide($, card)} />
</Box>
</Box>
{/* Row two is the short form: the gist, red while the session
needs you. A card that asks a question goes on below it with
the question and one row per option, in the card's own
width; the popover shows the same thing wide. */}
<Text
color={card.state === 'waiting' ? 'red' : undefined}
dimColor={card.state !== 'waiting'}
wrap="truncate-end"
>
{card.gist ||
(card.state === 'waiting' ? (card.question ? 'asks you' : card.permission ? 'asks permission' : 'needs you') : stateWord(card.state))}
</Text>
{/* A terminal only: the card expanded in the flow, taller and
never wider. The full title where it adds to the label, then
the question with one row per option, or the latest reply in
full with the suggestion and a send button. */}
{expandsInCard(card) && (
<Box flexDirection="column">
{isOpen && trim(card.title, LABEL_MAX) !== card.label && (
<Text bold wrap="wrap">
{card.title}
</Text>
)}
{card.question && !card.permission && (
<Text color="red" wrap="wrap">
{card.question.text}
</Text>
)}
{card.permission ? (
<Box flexDirection="column">Licence text (MIT)
MIT License Copyright (c) 2026 Joel Rönnqvist 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: Band above the prompt, Deny a tool call
What its code calls
runs programswrites filesenv varsdrives Claudetool callsrememberscalls tools
What its code shows
Read from the source at commit 09437df84b72 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.hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.1 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).hooks/register.tsx:572 open (not on Windows); hooks/register.tsx:1001 open (not on Windows); hooks/register.tsx:1048 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 (reaches the network) |
| 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, an MCP server |
| 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).mcp.call: ccd_session_mgmt/get_session; mcp.call: ccd_directory/change_directory; mcp.call: ccd_sidebar/move_sessions; mcp.call: ccd_sidebar/set_pinned; mcp.call: ccd_session_mgmt/list_sessions; mcp.call: ccd_session/start_session; mcp.call: ccd_session_mgmt/detach_session |
| 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.model.complete, prompt.submit (as the person), adds command board |
| 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: command.run (board), prompt.submit, classic.PermissionRequest, tool.check, tool.call (AskUserQuestion) · shapes: turn.step, prompt.context · reads: prompt.suggest, classic.Notification, classic.PostModelSwitch, session.receive · also: session.start, turn.start, turn.complete, session.end (+1) · timers: clock.after, clock.every |
| 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, …/….json, …/…; 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.files: a path computed at run time, …/….json, …/.claude/playpen/handoff-…-….md; the clipboard |
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 KytioisaCat/playpen/plugin install playpen@kytioisacat/reload-pluginsThis installs the marketplace's latest commit, which may not be the one read here (09437df84b72). 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/KytioisaCat/playpengit -C playpen checkout 09437df84b72b32dda5bed89eb0e10435e6a6147claude plugin validate playpenclaude --plugin-dir playpenThe 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 "kytioisacat-playpen" with its code and make me one like itSearch them from Claude: the MCP connector
Similar mods
- code-modernizationAnthropic★ 37,653
- next-stepsThariq Shihipar★ 4,505
- token-optimizerAlex Greenshpun★ 2,534
- reflect-modBayram Annakov★ 1,703
- crit-tuiTomasz Tomczyk★ 1,196
- ai-maestro-secrets23blocks-OS★ 817
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/kytioisacat-playpen/)