modscode / Gallery / repo-sessions
repo-sessions
Pane listing the Claude Code and Codex sessions working in this repo or folder
What it does
- Draws a band above the prompt, a pane
- Adds /sessions-here, /sessions-pane
- Hooks session.start
- Keeps its own state between turns
- Starts processes
Good points
- No network calls
- Written in TypeScript
- Has a desktop-specific branch
- 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 repo-sessions by Gabriel Blacher (pane, band, status), as modscode read it from the mod's code:
// https://modscode.com/gallery/gblacher2-repo-sessions/
// 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, Svg, Button } = $.ui.resolve(e)
const source = '…'
const length = '…'
const agent = '…'
const status = '…'
const name = '…'
const text = '…'
const label = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" alignItems="center" justifyContent="space-between" gap={1}>
<Box flexDirection="row" alignItems="center" gap={2}>
<Svg source={`${source}`} alt={`${length} other sessions in this repo`} />
<Box flexDirection="row" alignItems="center" gap={1}>
<Svg source={`${source}`} alt={`${agent} ${status}`} />
<Button label={`${name}`} plain />
<Svg source={`${source}`} alt={`${text}`} />
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Svg source={`${source}`} alt={`${agent} ${status}`} />
<Button label={`${name}`} plain />
<Svg source={`${source}`} alt={`${text}`} />
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Svg source={`${source}`} alt={`${agent} ${status}`} />
<Button label={`${name}`} plain />
<Svg source={`${source}`} alt={`${text}`} />
</Box>
<Svg source={`${source}`} alt={`${text}`} />
</Box>
<Button label={`${label}`} dimColor />
</Box>
<Svg source={`${source}`} alt="Session activity, last 10 minutes" />
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "Sessions here" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Text } = $.ui.resolve(e)
return (
<Text>
Scanning…
</Text>
)
})
}
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 235–343 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const { value: snap } = await $.state.get(SNAPSHOT)
const { value: isExpanded = false } = await $.state.get(EXPANDED)
const others = (snap?.peers ?? []).filter(p => !p.isSelf)
if (!snap || e.props.hasSurvey) return next(e)
const toggle = () => $.state.set(EXPANDED, !isExpanded)
const label = isExpanded ? 'Collapse' : 'Timeline'
if (e.surface !== 'terminal') {
const { Box, Button, Svg } = $.ui.resolve(e)
const header = summarySvg(snap)
const timeline = isExpanded ? paneSvg(snap, 560, { withHeader: false, isFixed: true }) : null
// Chips that fit beside the header and the toggle; the rest fold into +N.
let room = Math.min(1100, Math.max(320, e.props.bodyColumns * 7.5)) - header.width - 110
const shown = others.filter(p => {
const w = chipWidth(p.name, ago(snap.checkedAt - p.since), p.openUrl !== undefined)
if (w > room) return false
room -= w
return true
})
const hidden = others.length - shown.length
const more = hidden > 0 ? pixelTextSvg(`+${hidden}`) : null
return (
<Box flexDirection="column">
<Box flexDirection="row" alignItems="center" justifyContent="space-between" gap={1}>
<Box flexDirection="row" alignItems="center" gap={2}>
<Svg source={header.source} width={header.width} height={header.height} alt={`${others.length} other sessions in this repo`} />
{shown.map(p => {
const isBusy = p.status === 'busy'
const sprite = spriteSvg(p.agent, isBusy)
const time = pixelTextSvg(ago(snap.checkedAt - p.since))
const url = p.openUrl
return (
<Box key={`chip-${p.agent}-${p.id}`} flexDirection="row" alignItems="center" gap={1}>
<Svg source={sprite.source} width={sprite.width} height={sprite.height} alt={`${p.agent} ${p.status}`} />
{url ? (
<Button
key={`open-${p.agent}-${p.id}`}
label={p.name}
plain
dimColor={!isBusy}
onPress={() => $.process.run(['open', url])}
/>
) : (
<Svg source={nameSvg(p.name, isBusy).source} width={nameSvg(p.name, isBusy).width} height={16} alt={p.name} />
)}
<Svg source={time.source} width={time.width} height={time.height} alt={time.text} />
</Box>
)
})}
{more && <Svg source={more.source} width={more.width} height={more.height} alt={more.text} />}
</Box>
<Button key="toggle" label={label} dimColor onPress={toggle} />
</Box>
{timeline && (
<Svg source={timeline.source} width={timeline.width} height={timeline.height} alt="Session activity, last 10 minutes" />
)}
</Box>
)
}
const { Box, Button, Text } = $.ui.resolve(e)
const busy = others.filter(p => p.status === 'busy').length
return (
<Box flexDirection="column">
<Box flexDirection="row" gap={2}>
<Text wrap="truncate-end">
<Text bold>{snap.root.split('/').pop()}</Text>
<Text dimColor> {busy} busy · {others.length - busy} idle</Text>
</Text>
{others.map(p => {
const url = p.openUrl
return (
<Box key={`chip-${p.agent}-${p.id}`} flexDirection="row">
<Text color={p.status === 'busy' ? '#0ca30c' : 'gray'}>{p.status === 'busy' ? '●' : '○'}</Text>
<Text color={p.agent === 'codex' ? '#3987e5' : '#d95926'}>■ </Text>
{url ? (
<Button
key={`open-${p.agent}-${p.id}`}
label={p.name}
plain
dimColor={p.status !== 'busy'}
onPress={() => $.process.run(['open', url])}
/>
) : (
<Text dimColor={p.status !== 'busy'} wrap="truncate-end">{p.name}</Text>
)}
</Box>
)
})}
<Button key="toggle" label={label} dimColor onPress={toggle} />
</Box>
{isExpanded &&
others.map(p => (
<Text key={`row-${p.agent}-${p.id}`} wrap="truncate-end">
<Text color={p.agent === 'codex' ? '#3987e5' : '#d95926'}>{stripText(p.history)}</Text>
<Text dimColor> {p.status} {ago(snap.checkedAt - p.since)} · </Text>
{p.name}
</Text>
))}
</Box>
)
})hooks/register.tsx lines 346–380 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { value: snap } = await $.state.get(SNAPSHOT)
if (e.surface !== 'terminal') {
const { Svg, Text } = $.ui.resolve(e)
if (!snap) return <Text>Scanning…</Text>
const pane = paneSvg(snap)
return <Svg source={pane.source} alt={`${snap.peers.length} sessions in this repo`} />
}
const { Box, Text } = $.ui.resolve(e)
if (!snap) return <Text dimColor>Scanning…</Text>
return (
<Box flexDirection="column">
{snap.peers.map(p => (
<Box key={`${p.agent}-${p.id}`} flexDirection="column" marginTop={1}>
<Text wrap="truncate-end">
<Text color={p.status === 'busy' ? '#0ca30c' : 'gray'}>{p.status === 'busy' ? '●' : '○'} </Text>
<Text bold={p.status === 'busy'}>{p.name}</Text>
</Text>
<Text wrap="truncate-end">
{' '}<Text color={p.agent === 'codex' ? '#3987e5' : '#d95926'}>{stripText(p.history)}</Text>
<Text dimColor>
{' '}{p.isSelf ? 'You · ' : ''}{p.status} {ago(snap.checkedAt - p.since)}
{p.branch ? ` · ${p.branch}` : ''}
{relativeCwd(p.cwd, snap.root) ? ` · ${relativeCwd(p.cwd, snap.root)}` : ''}
</Text>
</Text>
</Box>
))}
</Box>
)
})Licence text (MIT)
MIT License Copyright (c) 2026 Gabriel Blacher 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 programsreads filesdrives Clauderemembers
What its code shows
Read from the source at commit 5972143582d8 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.2 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).hooks/register.tsx:280 open (not on Windows); hooks/register.tsx:323 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.hooks/register.tsx:58 a program named at run time |
| Reads and sends | Whether it both reads files or environment variables and reaches the network.reads 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'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 "gblacher2-repo-sessions" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
spending-effort-with-jev: no TypeSafe API key, so effort tips are off. Set it in /plugin.⚠ effort: long run, fuzzy spec → have Claude interview you, then go maxAsk Claude…
-
✦ explain as pick how Claude answers×3 ● build3 ● build3 ● build▸ VideoAsk Claude…
-
Ask Claude…superpowersϟ Arc tokens showing buildNot now██ FinalFinal42%:1 ✓██ FinalFinal42%:1 ✓██ FinalFinal42%:1 ✓███ brand gradient (OKLCH)Not now██ FinalFinal42%:1 ✓██ FinalFinal42%:1 ✓██ FinalFinal42%:1 ✓███ brand gradient (OKLCH)Not now██ FinalFinal42%:1 ✓██ FinalFinal42%:1 ✓██ FinalFinal42%:1 ✓███ brand gradient (OKLCH)d darkl lightz daltonizeda ansiu auto
-
What it does
- Draws a band above the prompt, a pane, the status line, toasts in the terminal
- Adds /agentzero
- Watches Bash calls and can refuse them
- Hooks command.register, env.get, fs.read, fs.stat and 13 more
-
Ask Claude…Timer● MonAprNo timer runningStopResume last CollapseFri week./meter.tsxUnbilled Wed h$1.24 · expenses MarMayToday, Oct 6This week
-
Ask Claude…Notes⚠ A team of Never uses your Claude usage much faster.Showing:buildbuildbuildHide completed:buildbuildbuildSet team size:DefaultDefaultDefaultSet model:NotesNotesNotesWorkflowYour next prompt can hand work to Never Notes helpers.● Fix login · Tool agents42% AllCopy failed2h 10m● Fix login · Tool agents42% AllCopy failed2h 10m● Fix login · Tool agents42% AllCopy failed2h 10m