modscode / Gallery / thread-setup
thread-setup
Choose per thread whether Claude uses auto memory and which skills it can see, from a /setup panel, with defaults for new threads.
What it does
- Draws a pane, toasts
- Adds /setup, /mem
- Watches Skill calls and can refuse them
- Hooks classic.SessionStart, prompt.attachment, prompt.context, prompt.section and 4 more
- Keeps its own state between turns
Good points
- No network calls
- Starts no processes
- Written in TypeScript
- Has a desktop-specific branch
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 thread-setup by tadassuksteris (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/tadassuksteris-thread-setup/
// 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: "Thread setup" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Input } = $.ui.resolve(e)
const memory = '…'
const value = '…'
const offCount = '…'
const memory2 = '…'
const offCount2 = '…'
const query = '…'
const label = '…'
const title = '…'
const offCount3 = '…'
const name = '…'
const blurb = '…'
const details = '…'
const name2 = '…'
const blurb2 = '…'
const details2 = '…'
const name3 = '…'
const blurb3 = '…'
const details3 = '…'
const title2 = '…'
const offCount4 = '…'
const name4 = '…'
const blurb4 = '…'
const details4 = '…'
const name5 = '…'
const blurb5 = '…'
const details5 = '…'
const name6 = '…'
const blurb6 = '…'
const details6 = '…'
const title3 = '…'
const offCount5 = '…'
const name7 = '…'
const blurb7 = '…'
const details7 = '…'
const name8 = '…'
const blurb8 = '…'
const details8 = '…'
const name9 = '…'
const blurb9 = '…'
const details9 = '…'
return (
<Box flexDirection="column" gap={1}>
<Box flexDirection="column" borderStyle="round" borderColor="yellow" paddingX={1}>
<Box>
<Box width={14} flexShrink={0}>
<Text>
This thread
</Text>
</Box>
<Box width={16} flexShrink={0}>
<Text color="green">
●
{" "}
</Text>
<Text>
{"Memory "}
{memory}
</Text>
</Box>
<Box>
<Text color="green">
{"● "}
</Text>
<Box>
<Text>
{`${value} skills on · `}
</Text>
<Text color="yellow">
{offCount}
{" off"}
</Text>
</Box>
</Box>
</Box>
<Box>
<Box width={14} flexShrink={0}>
<Text>
New threads
</Text>
</Box>
<Box width={16} flexShrink={0}>
<Text color="green">
●
{" "}
</Text>
<Text>
{"Memory "}
{memory2}
</Text>
</Box>
<Box>
<Text color="green">
{"● "}
</Text>
<Box>
<Text>
{`${value} skills on · `}
</Text>
<Text color="yellow">
{offCount2}
{" off"}
</Text>
</Box>
</Box>
</Box>
<Box justifyContent="space-between" alignItems="center" marginTop={1}>
<Text dimColor>
Matches your defaults.
</Text>
<Box flexShrink={0} gap={1}>
<Button label="Reset" dimColor />
<Button label="Save as default" variant="secondary" />
</Box>
</Box>
</Box>
<Box flexDirection="column" borderStyle="round" borderDimColor paddingX={1}>
<Box justifyContent="space-between" alignItems="center">
<Text bold>
Memory
</Text>
<Box gap={1}>
<Button label="On" variant="primary" />
<Button label="Off" variant="primary" />
</Box>
</Box>
<Text dimColor>
Saved memories for this project. A change applies from your next message.
</Text>
</Box>
<Box flexDirection="column" gap={1} borderStyle="round" borderDimColor paddingX={1}>
<Box flexDirection="column">
<Box justifyContent="space-between" alignItems="center">
<Text bold>
Skills
</Text>
<Box alignItems="center" gap={1}>
<Button label="All on" dimColor />
<Button label="All off" dimColor />
</Box>
</Box>
<Text dimColor>
Off hides a skill from Claude in this thread, and blocks it if called.
</Text>
<Text dimColor>
No skills read yet. They show up here after your next message.
</Text>
<Text dimColor>
Showing your last thread's skills until this thread's list is read, with your next message.
</Text>
</Box>
<Box justifyContent="space-between" alignItems="center" flexWrap="wrap" columnGap={2}>
<Box alignItems="center" columnGap={1} flexWrap="wrap">
<Input placeholder="Filter skills" value={`${query}`} />
<Text dimColor>
Show
</Text>
<Box flexShrink={0}>
<Box justifyContent="center">
<Button label={`${label}`} variant="primary" />
</Box>
<Box justifyContent="center">
<Button label={`${label}`} variant="primary" />
</Box>
<Box justifyContent="center">
<Button label={`${label}`} variant="primary" />
</Box>
</Box>
</Box>
<Box alignItems="center" gap={1}>
<Text dimColor>
Descriptions
</Text>
<Box flexShrink={0}>
<Box justifyContent="center">
<Button label={`${label}`} variant="primary" />
</Box>
<Box justifyContent="center">
<Button label={`${label}`} variant="primary" />
</Box>
<Box justifyContent="center">
<Button label={`${label}`} variant="primary" />
</Box>
</Box>
</Box>
</Box>
<Box flexDirection="column" rowGap={0.5}>
<Box alignItems="center">
<Text bold>
{title}
</Text>
<Text color="yellow">
{" · "}
{offCount3}
{" off"}
</Text>
</Box>
<Box flexDirection="column">
<Box justifyContent="space-between" alignItems="center">
<Box flexShrink={1}>
<Text color="green">
○
{" "}
</Text>
<Text>
{name}
</Text>
<Text dimColor wrap="truncate-end">
{" "}
{blurb}
</Text>
</Box>
<Box justifyContent="center" flexShrink={0}>
<Button label="Off" />
</Box>
</Box>
<Box paddingLeft={2} paddingBottom={1}>
<Text dimColor wrap="wrap">
{details}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box justifyContent="space-between" alignItems="center">
<Box flexShrink={1}>
<Text color="green">
○
{" "}
</Text>
<Text>
{name2}
</Text>
<Text dimColor wrap="truncate-end">
{" "}
{blurb2}
</Text>
</Box>
<Box justifyContent="center" flexShrink={0}>
<Button label="Off" />
</Box>
</Box>
<Box paddingLeft={2} paddingBottom={1}>
<Text dimColor wrap="wrap">
{details2}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box justifyContent="space-between" alignItems="center">
<Box flexShrink={1}>
<Text color="green">
○
{" "}
</Text>
<Text>
{name3}
</Text>
<Text dimColor wrap="truncate-end">
{" "}
{blurb3}
</Text>
</Box>
<Box justifyContent="center" flexShrink={0}>
<Button label="Off" />
</Box>
</Box>
<Box paddingLeft={2} paddingBottom={1}>
<Text dimColor wrap="wrap">
{details3}
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column" rowGap={0.5}>
<Box alignItems="center">
<Text bold>
{title2}
</Text>
<Text color="yellow">
{" · "}
{offCount4}
{" off"}
</Text>
</Box>
<Box flexDirection="column">
<Box justifyContent="space-between" alignItems="center">
<Box flexShrink={1}>
<Text color="green">
○
{" "}
</Text>
<Text>
{name4}
</Text>
<Text dimColor wrap="truncate-end">
{" "}
{blurb4}
</Text>
</Box>
<Box justifyContent="center" flexShrink={0}>
<Button label="Off" />
</Box>
</Box>
<Box paddingLeft={2} paddingBottom={1}>
<Text dimColor wrap="wrap">
{details4}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box justifyContent="space-between" alignItems="center">
<Box flexShrink={1}>
<Text color="green">
○
{" "}
</Text>
<Text>
{name5}
</Text>
<Text dimColor wrap="truncate-end">
{" "}
{blurb5}
</Text>
</Box>
<Box justifyContent="center" flexShrink={0}>
<Button label="Off" />
</Box>
</Box>
<Box paddingLeft={2} paddingBottom={1}>
<Text dimColor wrap="wrap">
{details5}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box justifyContent="space-between" alignItems="center">
<Box flexShrink={1}>
<Text color="green">
○
{" "}
</Text>
<Text>
{name6}
</Text>
<Text dimColor wrap="truncate-end">
{" "}
{blurb6}
</Text>
</Box>
<Box justifyContent="center" flexShrink={0}>
<Button label="Off" />
</Box>
</Box>
<Box paddingLeft={2} paddingBottom={1}>
<Text dimColor wrap="wrap">
{details6}
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column" rowGap={0.5}>
<Box alignItems="center">
<Text bold>
{title3}
</Text>
<Text color="yellow">
{" · "}
{offCount5}
{" off"}
</Text>
</Box>
<Box flexDirection="column">
<Box justifyContent="space-between" alignItems="center">
<Box flexShrink={1}>
<Text color="green">
○
{" "}
</Text>
<Text>
{name7}
</Text>
<Text dimColor wrap="truncate-end">
{" "}
{blurb7}
</Text>
</Box>
<Box justifyContent="center" flexShrink={0}>
<Button label="Off" />
</Box>
</Box>
<Box paddingLeft={2} paddingBottom={1}>
<Text dimColor wrap="wrap">
{details7}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box justifyContent="space-between" alignItems="center">
<Box flexShrink={1}>
<Text color="green">
○
{" "}
</Text>
<Text>
{name8}
</Text>
<Text dimColor wrap="truncate-end">
{" "}
{blurb8}
</Text>
</Box>
<Box justifyContent="center" flexShrink={0}>
<Button label="Off" />
</Box>
</Box>
<Box paddingLeft={2} paddingBottom={1}>
<Text dimColor wrap="wrap">
{details8}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box justifyContent="space-between" alignItems="center">
<Box flexShrink={1}>
<Text color="green">
○
{" "}
</Text>
<Text>
{name9}
</Text>
<Text dimColor wrap="truncate-end">
{" "}
{blurb9}
</Text>
</Box>
<Box justifyContent="center" flexShrink={0}>
<Button label="Off" />
</Box>
</Box>
<Box paddingLeft={2} paddingBottom={1}>
<Text dimColor wrap="wrap">
{details9}
</Text>
</Box>
</Box>
</Box>
<Text dimColor>
No skills are off.
</Text>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const describeSetup = '…'
await $.ui.toast(`New threads start with ${describeSetup}`)
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 393–398 · Pane
on('ui.render', { component: 'Pane', requestId: PANE_ID }, async ($, e) => {
const Input = e.surface === 'mobile' ? undefined : $.ui.resolve({ ...e, surface: e.surface }).Input
const input = await readPanelInput($, e.surface, e.props.bodyColumns)
return panelView($.ui.resolve(e), Input, input, panelActions($))
})hooks/panel.tsx lines 407–423 · Pane
export function panelView(
ui: Ui,
Input: InputElement | undefined,
input: PanelInput,
actions: PanelActions,
): RenderElement {
const { Box } = ui
const panel = toPanel(input)
return (
<Box flexDirection="column" gap={1}>
{statusCard(ui, panel, actions)}
{memoryCard(ui, panel, actions)}
{skillsCard(ui, Input, panel, actions)}
</Box>
)
}hooks/panel.tsx lines 181–214 · Pane
function statusCard(ui: Ui, panel: Panel, actions: PanelActions) {
const { Box, Button, Text } = ui
return (
<Box
flexDirection="column"
borderStyle="round"
borderColor={panel.isAtDefaults ? undefined : 'yellow'}
borderDimColor={panel.isAtDefaults}
paddingX={1}
>
{statusLine(ui, panel, 'This thread', panel.thread, true)}
{statusLine(ui, panel, 'New threads', panel.start, false)}
{/* Always drawn, so the card keeps its size: only the colours change. */}
<Box justifyContent="space-between" alignItems="center" marginTop={1}>
{panel.isAtDefaults ? (
<Text dimColor>Matches your defaults.</Text>
) : (
<Text color="yellow">This thread differs from your defaults.</Text>
)}
<Box flexShrink={0} gap={1}>
<Button key="reset-default" label="Reset" dimColor onPress={() => actions.resetToDefaults()} />
<Button
key="save-default"
label="Save as default"
variant={panel.isAtDefaults ? 'secondary' : 'primary'}
dimColor={panel.isAtDefaults}
onPress={() => actions.saveAsDefaults()}
/>
</Box>
</Box>
</Box>
)
}hooks/panel.tsx lines 145–179 · Pane
function statusLine(ui: Ui, panel: Panel, label: string, setup: Setup, isMain: boolean) {
const { Box, Text } = ui
const isMemoryOn = setup.memory === 'on'
const offCount = setup.skillsOff.length
const total = panel.skills.length
return (
<Box>
<Box width={LABEL_COLUMN} flexShrink={0}>
<Text bold={isMain} dimColor={!isMain}>
{label}
</Text>
</Box>
<Box width={MEMORY_COLUMN} flexShrink={0}>
<Text color={isMemoryOn ? 'green' : undefined} dimColor={!isMemoryOn}>
{isMemoryOn ? '●' : '○'}{' '}
</Text>
<Text dimColor={!isMain}>Memory {setup.memory}</Text>
</Box>
<Box>
<Text color={offCount === 0 ? 'green' : 'yellow'}>● </Text>
{offCount === 0 ? (
<Text dimColor={!isMain}>All skills on</Text>
) : (
<Box>
<Text dimColor={!isMain}>
{total > 0 ? `${Math.max(0, total - offCount)} skills on · ` : 'Skills: '}
</Text>
<Text color="yellow">{offCount} off</Text>
</Box>
)}
</Box>
</Box>
)
}hooks/panel.tsx lines 216–242 · Pane
function memoryCard(ui: Ui, panel: Panel, actions: PanelActions) {
const { Box, Button, Text } = ui
const mode = panel.thread.memory
return (
<Box flexDirection="column" borderStyle="round" borderDimColor paddingX={1}>
<Box justifyContent="space-between" alignItems="center">
<Text bold>Memory</Text>
<Box gap={1}>
<Button
key="memory-on"
label="On"
variant={mode === 'on' ? 'primary' : 'secondary'}
onPress={() => actions.setMemory('on')}
/>
<Button
key="memory-off"
label="Off"
variant={mode === 'off' ? 'primary' : 'secondary'}
onPress={() => actions.setMemory('off')}
/>
</Box>
</Box>
<Text dimColor>Saved memories for this project. A change applies from your next message.</Text>
</Box>
)
}hooks/panel.tsx lines 332–404 · Pane
function skillsCard(ui: Ui, Input: InputElement | undefined, panel: Panel, actions: PanelActions) {
const { Box, Button, Text } = ui
const total = panel.skills.length
const offCount = panel.skills.filter(skill => panel.off.has(skill.name)).length
// Sized for the largest count the tabs can show, so a count that grows moves nothing.
const tabSlot = slotFor([`Off ${total}`, `All ${total}`], panel.isTerminal)
return (
<Box flexDirection="column" gap={1} borderStyle="round" borderDimColor paddingX={1}>
<Box flexDirection="column">
<Box justifyContent="space-between" alignItems="center">
<Text bold>Skills</Text>
<Box alignItems="center" gap={1}>
<Button key="skills-all-on" label="All on" dimColor onPress={() => actions.setAllSkills(true)} />
<Button key="skills-all-off" label="All off" dimColor onPress={() => actions.setAllSkills(false)} />
</Box>
</Box>
<Text dimColor>Off hides a skill from Claude in this thread, and blocks it if called.</Text>
{total === 0 && <Text dimColor>No skills read yet. They show up here after your next message.</Text>}
{total > 0 && !panel.isLive && (
<Text dimColor>
Showing your last thread's skills until this thread's list is read, with your next message.
</Text>
)}
</Box>
{total > 0 && (
<Box justifyContent="space-between" alignItems="center" flexWrap="wrap" columnGap={2}>
<Box alignItems="center" columnGap={1} flexWrap="wrap">
{Input !== undefined && (
<Input
key="skill-filter"
placeholder="Filter skills"
value={panel.query}
onInput={value => actions.setQuery(value)}
onSubmit={value => actions.setQuery(value)}
/>
)}
<Text dimColor>Show</Text>
{choice(
ui,
'view',
panel.view,
[
{ value: 'all', label: `All ${total}` },
{ value: 'on', label: `On ${total - offCount}` },
{ value: 'off', label: `Off ${offCount}` },
],
actions.setView,
tabSlot,
)}
</Box>
<Box alignItems="center" gap={1}>
<Text dimColor>Descriptions</Text>
{choice(
ui,
'describe',
panel.describe,
[
{ value: 'line', label: 'One line' },
{ value: 'full', label: 'Full' },
],
actions.setDescriptionMode,
)}
</Box>
</Box>
)}
{groupSkills(panel.shown).map(group => skillGroup(ui, panel, actions, group))}
{total > 0 && panel.shown.length === 0 && (
<Text dimColor>{panel.view === 'off' && panel.query === '' ? 'No skills are off.' : 'No skill matches.'}</Text>
)}
</Box>
)
}Licence text (MIT)
MIT License Copyright (c) 2026 tadassuksteris 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
env 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 0371af752cc5 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.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, with its own branch for the desktop |
| 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 "tadassuksteris-thread-setup" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
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
-
slop Edit1 of 3accepteditrejectAsk Claude…
-
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
-
Ask Claude…Glossary BrowserGlossary openContextsContextsContexts▲ prevWrite1/Glossary▼ nextContexts