modscode / Gallery / sc-workspace
sc-workspace
A workspace pane for Claude Code: agents and worktrees, checkpoints, notes, changes and memory files in one tabbed pane
What it does
- Draws a pane
- Watches tool calls and can refuse them
- Hooks agent.spawn, prompt.submit, session.end, session.start and 5 more
- Keeps its own state between turns
- Starts processes
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 sc-workspace by SimpleCORE (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/simplecore-inc-sc-workspace/
// 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: "Workspace" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const brand = '…'
const release = '…'
const label = '…'
const printable = '…'
const details = '…'
const details2 = '…'
const details3 = '…'
return (
<Box flexDirection="column">
<Box justifyContent="space-between" marginTop={1}>
<Text bold wrap="truncate-end">
{brand}
</Text>
<Box gap={2} flexShrink={0}>
<Text dimColor>
{release}
</Text>
<Box paddingX={1} flexShrink={0} backgroundColor="#2a2f38">
<Button label={`${label}`} plain role="dismiss" />
</Box>
</Box>
</Box>
<Box flexDirection="column" borderStyle="round" borderColor="cyan" paddingX={1}>
<Text bold>
{printable}
</Text>
<Box flexDirection="column" marginTop={1}>
<Box gap={1}>
<Text color="cyan">
●
</Text>
<Button label={`${printable}`} plain />
<Box flexShrink={0}>
<Text dimColor wrap="truncate-end">
{details}
</Text>
</Box>
</Box>
<Box gap={1}>
<Text color="cyan">
●
</Text>
<Button label={`${printable}`} plain />
<Box flexShrink={0}>
<Text dimColor wrap="truncate-end">
{details2}
</Text>
</Box>
</Box>
<Box gap={1}>
<Text color="cyan">
●
</Text>
<Button label={`${printable}`} plain />
<Box flexShrink={0}>
<Text dimColor wrap="truncate-end">
{details3}
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1} rowGap={1}>
<Box gap={1}>
<Box justifyContent="center" alignItems="center" backgroundColor="#1f4650">
<Button label={`${label}`} plain />
</Box>
<Box justifyContent="center" alignItems="center" backgroundColor="#1f4650">
<Button label={`${label}`} plain />
</Box>
<Box justifyContent="center" alignItems="center" backgroundColor="#1f4650">
<Button label={`${label}`} plain />
</Box>
</Box>
<Box gap={1}>
<Box justifyContent="center" alignItems="center" backgroundColor="#1f4650">
<Button label={`${label}`} plain />
</Box>
<Box justifyContent="center" alignItems="center" backgroundColor="#1f4650">
<Button label={`${label}`} plain />
</Box>
<Box justifyContent="center" alignItems="center" backgroundColor="#1f4650">
<Button label={`${label}`} plain />
</Box>
</Box>
<Box gap={1}>
<Box justifyContent="center" alignItems="center" backgroundColor="#1f4650">
<Button label={`${label}`} plain />
</Box>
<Box justifyContent="center" alignItems="center" backgroundColor="#1f4650">
<Button label={`${label}`} plain />
</Box>
<Box justifyContent="center" alignItems="center" backgroundColor="#1f4650">
<Button label={`${label}`} plain />
</Box>
</Box>
</Box>
</Box>
</Box>
)
})
}
The mod's own code
Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.
mods/workspace/hooks/register.tsx lines 1183–1342 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const ui = $.ui.resolve(e)
const { Box } = ui
const bodyColumns = e.props.bodyColumns ?? 60
// A reader page wraps at the pane's width, kept from every draw so a search hit opens at the right page.
readerRoom = { rows: READER_PAGE_ROWS, columns: bodyColumns - 6 }
// With another mod's pane open beside it, the engine draws a tab row above the header.
const isUnderTabs = isBesideOtherPanes('sc-workspace', {
'sc-accounts': (await $.state.get({ plugin: 'sc-accounts', key: 'paneOpen' })).value === true,
'sc-workspace': (await $.state.get({ plugin: 'sc-workspace', key: 'paneOpen' })).value === true,
'sc-toolbox': (await $.state.get({ plugin: 'sc-toolbox', key: 'paneOpen' })).value === true,
})
const header = {
brand: paneTitle(MOD_NAME),
release: release.version ? m.release(release.version, release.date) : undefined,
isUnderTabs,
columns: bodyColumns,
exit: { label: `✕ ${m.closeButton}`, onPress: () => void closePane($).catch((error: unknown) => $.ui.toast(message(error))) },
backLabel: m.backButton,
}
// A dialog in progress takes the whole pane: the header, then the dialog.
const asked = await read($, dialog)
const dismiss = async () => {
await update($, dialog, () => null)
await update($, focused, () => null)
}
if (asked?.kind === 'base') {
const now = await $.clock.now()
const choices = baseChoices(await baseCandidates($), (await read($, diff))?.base, now, locale, m)
return ChoiceDialog(
ui,
bodyColumns,
header,
m.baseTitle,
choices.map(choice => ({
...choice,
onPress: () => {
void (async () => {
await dismiss()
if (!choice.isCurrent) await refreshDiff($, choice.base)
})().catch((error: unknown) => $.ui.toast(message(error)))
},
})),
{ label: m.cancel, onPress: () => void dismiss().catch((error: unknown) => debug($, error)) },
await read($, focused),
)
}
if (asked?.kind === 'target') {
const now = await $.clock.now()
const view = await read($, diff)
if (view) {
const candidates = (await baseCandidates($)).map(({ since: _since, ...point }) => point)
return ChoiceDialog(
ui,
bodyColumns,
header,
m.targetTitle,
targetChoices(candidates, view, now, locale, m).map(choice => ({
...choice,
onPress: () => {
void (async () => {
await dismiss()
if (!choice.isCurrent) await refreshDiff($, undefined, choice.target)
})().catch((error: unknown) => $.ui.toast(message(error)))
},
})),
{ label: m.cancel, onPress: () => void dismiss().catch((error: unknown) => debug($, error)) },
await read($, focused),
)
}
}
if (asked?.kind === 'diff') {
const view = await read($, diff)
const files = view?.files ?? []
const at = files.findIndex(one => one.path === asked.ref)
const file = files[at]
const selected = view?.selected?.path === asked.ref ? view.selected : undefined
if (view && file && selected) {
// Whole hunks on every page, each under a header of its own, so every page draws as a diff.
const pages = diffPages(selected.text, DIFF_PAGE_LINES)
const count = pages.length
const index = Math.min(Math.max(0, await read($, diffPage)), count - 1)
const turn = (step: number) => () => {
void update($, diffPage, () => index + step).catch((error: unknown) => debug($, error))
}
const open = (path: string) => () => void openFile($, path).catch((error: unknown) => $.ui.toast(message(error)))
const previousFile = files[at - 1]
const nextFile = files[at + 1]
const counts = file.added === null ? m.binary : `+${file.added} −${file.removed ?? 0}`
const omitted = selected.omitted > 0 && index === count - 1 ? ` · ${m.linesOmitted(selected.omitted)}` : ''
return CodeDialog(
ui,
bodyColumns,
header,
file.path,
`${counts} · ${m.diffDialogSince(view.base.label)}${omitted}`,
{ source: pages[index] ?? '', format: 'diff', path: file.path, empty: m.binary },
{ index, count, label: m.readerPage(index + 1, count) },
{
previous: { label: m.readerPrevious, onPress: turn(-1) },
next: { label: m.readerNext, onPress: turn(1) },
extra: [
...(previousFile ? [{ key: 'diff-previous-file', label: m.diffPreviousFile, onPress: open(previousFile.path) }] : []),
...(nextFile ? [{ key: 'diff-next-file', label: m.diffNextFile, onPress: open(nextFile.path) }] : []),
// Only the working tree can be written back: a file compared between two checkpoints, or another worktree's, has no restore.
...(!view.target && !view.worktree ? [{ key: 'diff-file-restore', label: m.diffRestoreFile, onPress: () => void update($, dialog, () => ({ kind: 'file', ref: file.path })).catch((error: unknown) => debug($, error)) }] : []),
],
close: { label: m.closeButton, onPress: () => void dismiss().catch((error: unknown) => debug($, error)) },
},
await read($, focused),
)
}
}
if (asked?.kind === 'memoryRead') {
const file = (await read($, memory))?.find(one => one.path === asked.ref)
const text = memoryTexts.get(asked.ref)
if (file && text !== undefined) {
const pages = markdownPages(text, readerRoom)
const index = Math.min(Math.max(0, await read($, memoryPage)), pages.length - 1)
const front = frontmatterOf(text)
const turn = (step: number) => () => {
void update($, memoryPage, () => index + step).catch((error: unknown) => debug($, error))
}
// An auto-memory file leads with its name and description; its frontmatter is not drawn.
const lead = front.name ? `**${front.name}**${front.description ? `: ${front.description}` : ''}\n\n` : ''
return ReaderDialog(
ui,
bodyColumns,
header,
file.display,
m.readerSubtitle(file.path.replace(home ?? '\u0000', '~'), m.memoryKind[file.kind], m.memoryLines(file.lines)),
// Lines wrapped in the file read as the paragraphs they are.
reflow(index === 0 ? `${lead}${pages[index]?.text ?? ''}` : (pages[index]?.text ?? '')),
{ index, count: pages.length, label: m.readerPage(index + 1, pages.length) },
{
previous: { label: m.readerPrevious, onPress: turn(-1) },
next: { label: m.readerNext, onPress: turn(1) },
close: { label: m.closeButton, onPress: () => void dismiss().catch((error: unknown) => debug($, error)) },
},
await read($, focused),
)
}
}
if (asked?.kind === 'memoryScope') {
const current = await read($, memoryScope)
const scopes = ['all', 'global', 'project'] as const
return ChoiceDialog(
ui,
bodyColumns,
header,
m.memoryScopeTitle,
scopes.map(scope => ({
key: `memory-scope-${scope}`,
label: m.memoryScope[scope],
isCurrent: scope === current,mods/workspace/hooks/shared/kit.tsx lines 1013–1058 · Pane
export function ChoiceDialog(
ui: ElementTable,
bodyColumns: number,
header: HeaderInfo,
title: string,
choices: Choice[],
cancel: { label: string; onPress: () => void },
/** The key of the element holding the keyboard, so the Cancel tile can show it. */
focused: string | null = null,
) {
const { Box, Text } = ui
// Every row is one line: the details share one column at the right, and the labels
// take what is left of the dialog's width and are cut to it, never wrapped.
const details = choices.map(choice => (choice.detail === undefined ? undefined : printable(choice.detail)))
const detailWidth = Math.max(0, ...details.map(detail => displayWidth(detail ?? '')))
const labelRoom = Math.max(6, bodyColumns - CARD_CHROME - 2 - (detailWidth > 0 ? detailWidth + 1 : 0))
const labels = choices.map(choice => truncate(printable(choice.label).replace(/\s+/g, ' ').trim(), labelRoom))
const labelWidth = Math.max(0, ...labels.map(displayWidth))
return DialogFrame(
ui,
dialogHeader(header, cancel.onPress),
theme.accent,
title,
<Box key="dialog-choices" flexDirection="column" marginTop={1}>
{choices.map((choice, index) => (
<Box key={`choice-${choice.key}`} gap={1}>
<Text color={choice.isCurrent ? theme.accent : undefined} dimColor={!choice.isCurrent}>
{choice.isCurrent ? '●' : '○'}
</Text>
{LinkButton(ui, choice.key, padCells(labels[index] ?? '', labelWidth), choice.onPress, { autoFocus: choice.isCurrent === true })}
{details[index] && (
<Box flexShrink={0}>
<Text dimColor wrap="truncate-end">
{details[index]}
</Text>
</Box>
)}
</Box>
))}
</Box>,
Tiles(ui, Math.max(20, bodyColumns - CARD_CHROME), [{ key: 'dialog-cancel', label: cancel.label, isDismiss: true, onPress: cancel.onPress }], {
focused,
}),
)
}mods/workspace/hooks/shared/kit.tsx lines 646–666 · Pane
export function DialogFrame(
ui: ElementTable,
header: HeaderInfo,
borderColor: string,
title: string,
body: ReturnType<typeof Header>,
tiles: ReturnType<typeof Tiles>,
) {
const { Box, Text } = ui
return (
<Box key="dialog-pane" flexDirection="column">
{Header(ui, header)}
<Box key="dialog" flexDirection="column" borderStyle="round" borderColor={borderColor} paddingX={1}>
<Text bold>{printable(title)}</Text>
{body}
{tiles}
</Box>
</Box>
)
}mods/workspace/hooks/shared/kit.tsx lines 258–262 · Pane
export function LinkButton(ui: ElementTable, key: string, label: string, onPress: () => void, extra: { autoFocus?: boolean } = {}) {
const { Button } = ui
return <Button key={key} label={printable(label)} plain hover={{ color: theme.accent, bold: true }} {...(extra.autoFocus ? { autoFocus: true as const } : {})} onPress={onPress} />
}mods/workspace/hooks/shared/kit.tsx lines 518–561 · Pane
export function Tiles(ui: ElementTable, bodyColumns: number, given: Tile[], outline?: { focused: string | null }) {
const { Box, Button } = ui
if (given.length === 0) return null
const tiles = given.map(tile => ({ ...tile, label: printable(tile.label) }))
const needed = Math.max(...tiles.map(tile => displayWidth(tile.label))) + TILE_PADDING * 2
const perRow = Math.max(1, Math.min(tiles.length, Math.floor((bodyColumns + TILE_GAP) / (needed + TILE_GAP))))
const width = Math.max(needed, Math.floor((bodyColumns - TILE_GAP * (perRow - 1)) / perRow))
const rows: Tile[][] = []
for (let start = 0; start < tiles.length; start += perRow) rows.push(tiles.slice(start, start + perRow))
return (
<Box key="footer" flexDirection="column" marginTop={1} rowGap={1}>
{rows.map((row, index) => (
<Box key={`footer-row-${index}`} gap={TILE_GAP}>
{row.map(tile => (
<Box
key={`tile-${tile.key}`}
width={width}
justifyContent="center"
alignItems="center"
backgroundColor={tile.isMain ? theme.tileMain : theme.tile}
hover={{ backgroundColor: theme.tileHover }}
// Outlined tiles show where the keyboard is: the focused one in the accent colour.
{...(outline
? outline.focused === tile.key
? { borderStyle: 'round', borderColor: theme.accent }
: { borderStyle: 'round', borderColor: 'gray', borderDimColor: true }
: {})}
>
<Button
key={tile.key}
label={tile.label}
plain
{...(tile.isDismiss ? { role: 'dismiss' as const } : {})}
{...(tile.isFocused ? { autoFocus: true as const } : {})}
onPress={tile.onPress}
/>
</Box>
))}
</Box>
))}
</Box>
)
}mods/workspace/hooks/shared/kit.tsx lines 85–109 · Pane
export function Header(ui: ElementTable, header: HeaderInfo) {
const { Box, Button, Text } = ui
const brand = printable(header.brand)
const release = header.release === undefined ? undefined : printable(header.release)
const exit = header.exit ? { ...header.exit, label: printable(header.exit.label) } : undefined
const exitWidth = exit ? displayWidth(exit.label) + 2 : 0
const room = (header.columns ?? 80) - displayWidth(brand) - exitWidth - 2
const isReleaseShown = release !== undefined && displayWidth(release) <= room
return (
<Box key="header" justifyContent="space-between" marginTop={header.isUnderTabs ? 1 : 0}>
<Text bold wrap="truncate-end">
{brand}
</Text>
<Box gap={2} flexShrink={0}>
{isReleaseShown && <Text dimColor>{release}</Text>}
{exit && (
<Box key="header-exit-ground" paddingX={1} flexShrink={0} backgroundColor={theme.tile} hover={{ backgroundColor: theme.tileHover }}>
<Button key="close" label={exit.label} plain role="dismiss" onPress={exit.onPress} />
</Box>
)}
</Box>
</Box>
)
}Licence text (MIT)
MIT License Copyright (c) 2026 SimpleCORE Inc. 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
What its code shows
Read from the source at commit 4d5f9231e689 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.mods/workspace/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.19 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).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.mods/workspace/hooks/register.tsx:151 a program named at run time; mods/workspace/hooks/register.tsx:1033 a program named at run time |
| 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 simplecore-inc/claude-mods/plugin install sc-workspace@simplecore-modsThis installs the marketplace's latest commit, which may not be the one read here (4d5f9231e689). 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 "simplecore-inc-sc-workspace" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…ReviewPR #3 Fix loginbranche couranteà traiter ▸3 ▸3 ▸3 · en relecture ▸3 ▸3 ▸3▸◉3 a1b2c3d ↩ répondu obsolète → Claude Review▸◉3 a1b2c3d ↩ répondu obsolète → Claude Review▸◉3 a1b2c3d ↩ répondu obsolète → Claude Review────────fil 31/3 Review ↗ GitHub
Review@alexReview@alexReview@alexReviewRéponse : Review publierEntrée publie · Esc annule la réponse · les touches n, p… tapent dans le champ… ReviewLe panneau n'a pas le clavier : ctrl+x tab ou un clic, et les touches marchent.p préc. n suiv. t PR suiv. x démarquer a tout démarquer f corriger (3) r répondre v résoudre o web q fermer -
Ask Claude…PR securityall3 shown · 3 ignoredLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — Editignored (3)⋯src/app.ts:Approve Pull requests: Mergesrc/app.ts:Approve Pull requests: Mergesrc/app.ts:Approve Pull requests: Merge
-
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…Glossary BrowserGlossary openContextsContextsContexts▲ prevWrite1/Glossary▼ nextContexts
-
Ask Claude…envbuildbuildbuild+ .env.localsrc/app.ts is not in .gitignoreWriteNo .env files in the project root yet.K = paste the value, Enter saves saveNew key: NAME, Enter to continuegenerate randomcancelMissing compared with Write:KKK