modscode / Gallery / mod-manager
mod-manager
Per-session mod manager: a toolbar dropdown to switch any locally installed mod on or off for this session.
What it does
- Draws a band above the prompt, a pane, toasts
- Adds /mods
- Hooks plugin.register, session.start
- Keeps its own state between turns
Good points
- No network calls
- Starts no processes
- Small: 360 lines
- Written in TypeScript
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 mod-manager by andrewli315 (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/andrewli315-mod-manager/
// 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, Select } = $.ui.resolve(e)
const name = '…'
const version = '…'
const name2 = '…'
const name3 = '…'
return (
<Box flexDirection="column">
<Box paddingX={1} gap={1} borderStyle="round" borderColor="magenta">
<Text bold color="magenta">
✦ NEW MOD
</Text>
<Text>
{name}
{` v${version}`}
</Text>
<Text dimColor>
enable it for this session?
</Text>
<Button variant="primary" label="Enable" />
<Button label="Keep off" />
</Box>
<Box paddingX={1} gap={1} borderStyle="round" borderColor="magenta">
<Text bold color="magenta">
✦ NEW MOD
</Text>
<Text>
{name2}
{` v${version}`}
</Text>
<Text dimColor>
enable it for this session?
</Text>
<Button variant="primary" label="Enable" />
<Button label="Keep off" />
</Box>
<Box paddingX={1} gap={1} borderStyle="round" borderColor="magenta">
<Text bold color="magenta">
✦ NEW MOD
</Text>
<Text>
{name3}
{` v${version}`}
</Text>
<Text dimColor>
enable it for this session?
</Text>
<Button variant="primary" label="Enable" />
<Button label="Keep off" />
</Box>
<Box paddingX={1} gap={1} borderStyle="round" borderColor="yellow">
<Text bold color="cyan">
⬢ MODS
</Text>
<Select value="__menu" />
<Text color="yellow">
● pending
</Text>
<Button variant="primary" label="↻ Apply" hotkey="a" />
<Button label="⚙ Manage" plain dimColor hotkey="m" />
<Button label="✕ Hide" plain dimColor hotkey="h" />
</Box>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "Mods" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const length = '…'
const length2 = '…'
const name = '…'
const version = '…'
const source = '…'
const name2 = '…'
const version2 = '…'
const source2 = '…'
const name3 = '…'
const version3 = '…'
const source3 = '…'
return (
<Box flexDirection="column" gap={1} padding={1}>
<Box justifyContent="space-between">
<Text bold color="cyan">
⬢ Mod Manager
</Text>
<Text dimColor>
{length}
/
{length2}
{" on in this session"}
</Text>
</Box>
<Box flexDirection="column">
<Box borderStyle="round" borderColor="magenta" paddingX={1} justifyContent="space-between">
<Box flexDirection="column">
<Text bold>
✦
{" "}
{name}
{" v"}
{version}
{" NEW"}
</Text>
<Text dimColor>
{source}
</Text>
</Box>
<Box gap={1}>
<Button label="Keep off" />
<Button variant="primary" label="🔒 locked" />
</Box>
</Box>
<Box borderStyle="round" borderColor="magenta" paddingX={1} justifyContent="space-between">
<Box flexDirection="column">
<Text bold>
✦
{" "}
{name2}
{" v"}
{version2}
{" NEW"}
</Text>
<Text dimColor>
{source2}
</Text>
</Box>
<Box gap={1}>
<Button label="Keep off" />
<Button variant="primary" label="🔒 locked" />
</Box>
</Box>
<Box borderStyle="round" borderColor="magenta" paddingX={1} justifyContent="space-between">
<Box flexDirection="column">
<Text bold>
✦
{" "}
{name3}
{" v"}
{version3}
{" NEW"}
</Text>
<Text dimColor>
{source3}
</Text>
</Box>
<Box gap={1}>
<Button label="Keep off" />
<Button variant="primary" label="🔒 locked" />
</Box>
</Box>
</Box>
<Box gap={1}>
<Button label="✓ All on" />
<Button label="✕ All off" />
<Button label="★ Save as default" />
<Button variant="primary" label="↻ Apply" />
</Box>
<Text color="yellow">
Changes load when you press Apply (the mods reload).
</Text>
</Box>
)
})
on('session.start', async ($, e, next) => {
const name = '…'
await $.ui.toast(`mod-manager stays on so you can turn the others back on`)
await $.ui.toast(`${name} enabled · press Apply to load the change`)
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 208–290 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
if (e.surface === 'mobile' || e.props.hasSurvey) {
return next(e)
}
// Hidden until the person types /mods.
if (await read($, isHidden)) {
return next(e)
}
const list = await read($, mods)
if (list.length === 0) {
return next(e)
}
const off = await read($, disabled)
const waiting = await read($, pending)
const dirty = await read($, isDirty)
const { Box, Text, Button, Select } = $.ui.resolve(e)
const onCount = list.filter(m => !off.includes(m.name) && !waiting.includes(m.name)).length
const options = [
{ value: MENU, label: `Mods ▾ ${onCount}/${list.length} on` },
...list.map(m => ({
value: m.name,
label:
m.name === SELF
? `🔒 ${m.name} · always on`
: waiting.includes(m.name)
? `✦ ${m.name} · new, awaiting your choice`
: `${off.includes(m.name) ? '○' : '●'} ${m.name} v${m.version}${off.includes(m.name) ? ' · off' : ''} · ${m.source}`,
})),
{ value: ALL_ON, label: '✓ Enable all' },
{ value: ALL_OFF, label: '✕ Disable all' },
]
return (
<Box flexDirection="column">
{waiting.slice(0, 3).map(name => {
const info = list.find(m => m.name === name)
return (
<Box key={`new:${name}`} paddingX={1} gap={1} borderStyle="round" borderColor="magenta">
<Text bold color="magenta">
✦ NEW MOD
</Text>
<Text>
{name}
{info ? ` v${info.version}` : ''}
</Text>
<Text dimColor>enable it for this session?</Text>
<Button key={`yes:${name}`} variant="primary" label="Enable" onPress={() => decide($, name, true)} />
<Button key={`no:${name}`} label="Keep off" onPress={() => decide($, name, false)} />
</Box>
)
})}
<Box paddingX={1} gap={1} borderStyle="round" borderColor={dirty ? 'yellow' : 'cyan'}>
<Text bold color="cyan">
⬢ MODS
</Text>
<Select
key="menu"
options={options}
value={MENU}
onSelect={async v => {
if (v === MENU) return
if (v === ALL_ON) return setAll($, true)
if (v === ALL_OFF) return setAll($, false)
if (waiting.includes(v)) return decide($, v, true)
return toggle($, v)
}}
/>
{dirty && <Text color="yellow">● pending</Text>}
{dirty && <Button key="apply" variant="primary" label="↻ Apply" hotkey="a" onPress={() => apply($)} />}
<Button
key="panel"
label="⚙ Manage"
plain
dimColor
hotkey="m"
onPress={() => $.ui.open({ id: PANE, title: 'Mods' })}
/>
<Button key="hide" label="✕ Hide" plain dimColor hotkey="h" onPress={() => update($, isHidden, () => true)} />
</Box>
</Box>
)
})hooks/register.tsx lines 292–359 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const list = await read($, mods)
const off = await read($, disabled)
const waiting = await read($, pending)
const dirty = await read($, isDirty)
return (
<Box flexDirection="column" gap={1} padding={1}>
<Box justifyContent="space-between">
<Text bold color="cyan">
⬢ Mod Manager
</Text>
<Text dimColor>
{list.filter(m => !off.includes(m.name) && !waiting.includes(m.name)).length}/{list.length} on in this
session
</Text>
</Box>
<Box flexDirection="column">
{list.map(m => {
const isNew = waiting.includes(m.name)
const isOff = off.includes(m.name) || isNew
const isSelf = m.name === SELF
return (
<Box
key={`row:${m.name}`}
borderStyle="round"
borderColor={isNew ? 'magenta' : isOff ? 'gray' : 'green'}
paddingX={1}
justifyContent="space-between"
>
<Box flexDirection="column">
<Text bold dimColor={isOff && !isNew}>
{isNew ? '✦' : isOff ? '○' : '●'} {m.name} v{m.version}
{isNew ? ' NEW' : ''}
</Text>
<Text dimColor>{m.source}</Text>
</Box>
<Box gap={1}>
{isNew && <Button key={`keep:${m.name}`} label="Keep off" onPress={() => decide($, m.name, false)} />}
<Button
key={`t:${m.name}`}
variant={isOff ? 'primary' : 'secondary'}
label={isSelf ? '🔒 locked' : isNew ? 'Enable' : isOff ? 'Enable' : 'Disable'}
onPress={() => (isNew ? decide($, m.name, true) : toggle($, m.name))}
/>
</Box>
</Box>
)
})}
</Box>
<Box gap={1}>
<Button key="on" label="✓ All on" onPress={() => setAll($, true)} />
<Button key="off" label="✕ All off" onPress={() => setAll($, false)} />
<Button
key="default"
label="★ Save as default"
onPress={async () => {
await $.store.set('defaults', await loadOff($))
$.ui.toast('Saved as the default for new sessions')
}}
/>
{dirty && <Button key="apply" variant="primary" label="↻ Apply" onPress={() => apply($)} />}
</Box>
{dirty && <Text color="yellow">Changes load when you press Apply (the mods reload).</Text>}
</Box>
)
})Licence text (MIT)
MIT License Copyright (c) 2026 mod-manager contributors 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
writes filesenv varsremembers
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 308d952fe419 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.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.its repository's .claude-plugin/marketplace.json does not list it: no install line to give |
| Programs on Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks |
| 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.starts no programs |
| Reads and sends | Whether it both reads files or environment variables and reaches the network.reaches no 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's .claude-plugin/marketplace.json does not list it, so there is no install line to give. Read it as code, or follow its author's README.
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 "andrewli315-mod-manager" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…Xcodebuild · App · 31/3◐ Rendering App…Write↻ Re-render (r) r✦ Ask Claude (x) x◀ (h) h▶ (l) lOpen (o) o
-
Ask Claude…Skins0 Your promptadd rate limiting to the hub api0 Tool rows: finished, running, failedYour prompt Spinner0 Folded group of reads and searches●main · note 3 · note 3 · note 30 Edit diff cardDesktop only; the terminal keeps Claude Code's diff.0 Shell output cardDesktop only.0 Code block cardDesktop only; the terminal keeps Claude Code's markdown.0 TableAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopy0 SpinnerAccent SpinnerSpinnerSpinner… 2h 10m0 Band above the prompt: normal, then nudging to compact█████░░░ 42% build█████░░░ 42% build█████░░░ 42% buildContext is 42% full0 Compact now0 Band above a questionTable BashBashBash0 Turn footer (terminal)3 build in 2h 10m · Grep · +3 −3
-
Ask Claude…agent-discoverbuildbuildbuildRefreshMCP Browse/3Tab / shift+Tab move · Enter presses · ↑↓ scroll · Esc back to the promptBrowse...Audit asks:DeclineAcceptDeclineCancelAudit asks:DeclineAcceptDeclineCancelAudit asks:DeclineAcceptDeclineCancel
-
Ask Claude…Fanyi settingsOnAPI · OpusenOn this MacAPIHost src/ SaveKey K · paste a new one, Enter SaveOpus↻ RefreshCustom model model id, for an API that lists none UseFanyi settingsHostClose
-
● pace Write · Park to1 park 12 dismiss 2pace: resume point 2h 10m · Fix login · 33 resume 34 discard 45 all 3 5pace: Park to resume point older than 7 days6 clear 6Ask Claude…
-
Ask Claude…AvatarsSpoken replies: on API key: setSet it with /plugin (Avatars, configure), or export ELEVENLABS_API_KEY and restart.OffStopStopOpusPick one to playt r s o d cCloseNew modes: ask Claude to create one (the create-mode skill), or see .