modscode / Gallery / git-sync-band
git-sync-band
A band above the prompt with branch, ahead/behind, changed files and last push; pulls before your prompt when it is safe; Pull, Files and Commit & push buttons that run git without a model turn.
What it does
- Draws a band above the prompt, toasts
- Watches tool calls
- Hooks prompt.submit, session.start, turn.complete
- 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 git-sync-band by Mohab Yasser (band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/mohabyasser2-git-sync-band/
// 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, Svg, Button } = $.ui.resolve(e)
const iconSvg = '…'
const branch = '…'
const text = '…'
const text2 = '…'
const text3 = '…'
const pushed = '…'
const line = '…'
const line2 = '…'
const line3 = '…'
const key = '…'
const line4 = '…'
const line5 = '…'
const line6 = '…'
const name = '…'
const line7 = '…'
const line8 = '…'
const line9 = '…'
const line10 = '…'
const line11 = '…'
const line12 = '…'
const question = '…'
const message = '…'
const line13 = '…'
const line14 = '…'
const line15 = '…'
const line16 = '…'
const line17 = '…'
const line18 = '…'
const code = '…'
const path = '…'
const code2 = '…'
const path2 = '…'
const code3 = '…'
const path3 = '…'
const changed = '…'
return (
<Box flexDirection="column">
<Text color="subtle" wrap="truncate">
────────
</Text>
<Box flexDirection="row" flexWrap="wrap" alignItems="center" justifyContent="space-between" width="100%" columnGap={2}>
<Box flexDirection="row" alignItems="center" columnGap={1} flexShrink={0}>
<Box flexShrink={0}>
<Svg source={`${iconSvg}`} alt={`Branch ${branch}`} width={16} height={16} />
</Box>
<Text bold wrap="truncate">
{branch}
</Text>
<Text wrap="truncate">
{"· "}
{text}
</Text>
<Text wrap="truncate">
{"· "}
{text2}
</Text>
<Text wrap="truncate">
{"· "}
{text3}
</Text>
<Text dimColor wrap="truncate">
{"· "}
{pushed}
</Text>
<Box position="absolute" left={0} display="none" flexDirection="column" borderStyle="round" borderColor="subtle" backgroundColor="background" paddingX={1}>
<Text>
{line}
</Text>
<Text>
{line2}
</Text>
<Text>
{line3}
</Text>
</Box>
</Box>
<Box flexDirection="row" alignItems="center" columnGap={2}>
<Box flexDirection="row" alignItems="center" columnGap={1} flexShrink={0}>
<Box position="relative" flexDirection="row" alignItems="center" flexShrink={0}>
<Svg source={`${iconSvg}`} alt={`${key}`} width={16} height={16} />
<Box position="absolute" top={0} left={0} right={0} height="100%" flexDirection="row" alignItems="center" justifyContent="center">
<Button label="⠀⠀" plain />
</Box>
<Box position="absolute" left={0} display="none" flexDirection="column" borderStyle="round" borderColor="subtle" backgroundColor="background" paddingX={1}>
<Text>
{line4}
</Text>
<Text>
{line5}
</Text>
<Text>
{line6}
</Text>
</Box>
</Box>
<Button label={`${name}`} plain />
</Box>
<Box flexDirection="row" alignItems="center" columnGap={1} flexShrink={0}>
<Box position="relative" flexDirection="row" alignItems="center" flexShrink={0}>
<Svg source={`${iconSvg}`} alt={`${key}`} width={16} height={16} />
<Box position="absolute" top={0} left={0} right={0} height="100%" flexDirection="row" alignItems="center" justifyContent="center">
<Button label="⠀⠀" plain />
</Box>
<Box position="absolute" left={0} display="none" flexDirection="column" borderStyle="round" borderColor="subtle" backgroundColor="background" paddingX={1}>
<Text>
{line7}
</Text>
<Text>
{line8}
</Text>
<Text>
{line9}
</Text>
</Box>
</Box>
<Button label={`${name}`} plain />
</Box>
<Box flexDirection="row" alignItems="center" columnGap={1} flexShrink={0}>
<Box position="relative" flexDirection="row" alignItems="center" flexShrink={0}>
<Svg source={`${iconSvg}`} alt={`${key}`} width={16} height={16} />
<Box position="absolute" top={0} left={0} right={0} height="100%" flexDirection="row" alignItems="center" justifyContent="center">
<Button label="⠀⠀" plain />
</Box>
<Box position="absolute" left={0} display="none" flexDirection="column" borderStyle="round" borderColor="subtle" backgroundColor="background" paddingX={1}>
<Text>
{line10}
</Text>
<Text>
{line11}
</Text>
<Text>
{line12}
</Text>
</Box>
</Box>
<Button label={`${name}`} plain />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Text dimColor wrap="truncate-end">
{question}
</Text>
<Text bold>
{message}
</Text>
<Box flexDirection="row" alignItems="center" columnGap={2}>
<Box flexDirection="row" alignItems="center" columnGap={1} flexShrink={0}>
<Box position="relative" flexDirection="row" alignItems="center" flexShrink={0}>
<Svg source={`${iconSvg}`} alt={`${key}`} width={16} height={16} />
<Box position="absolute" top={0} left={0} right={0} height="100%" flexDirection="row" alignItems="center" justifyContent="center">
<Button label="⠀⠀" plain />
</Box>
<Box position="absolute" left={0} display="none" flexDirection="column" borderStyle="round" borderColor="subtle" backgroundColor="background" paddingX={1}>
<Text>
{line13}
</Text>
<Text>
{line14}
</Text>
<Text>
{line15}
</Text>
</Box>
</Box>
<Button label={`${name}`} plain />
</Box>
<Box flexDirection="row" alignItems="center" columnGap={1} flexShrink={0}>
<Box position="relative" flexDirection="row" alignItems="center" flexShrink={0}>
<Svg source={`${iconSvg}`} alt={`${key}`} width={16} height={16} />
<Box position="absolute" top={0} left={0} right={0} height="100%" flexDirection="row" alignItems="center" justifyContent="center">
<Button label="⠀⠀" plain />
</Box>
<Box position="absolute" left={0} display="none" flexDirection="column" borderStyle="round" borderColor="subtle" backgroundColor="background" paddingX={1}>
<Text>
{line16}
</Text>
<Text>
{line17}
</Text>
<Text>
{line18}
</Text>
</Box>
</Box>
<Button label={`${name}`} plain />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Text wrap="truncate-middle">
<Text color="green">
{code}
</Text>
{" "}
{path}
</Text>
<Text wrap="truncate-middle">
<Text color="green">
{code2}
</Text>
{" "}
{path2}
</Text>
<Text wrap="truncate-middle">
<Text color="green">
{code3}
</Text>
{" "}
{path3}
</Text>
<Text dimColor>
+
{changed}
{" more"}
</Text>
</Box>
{await next(e)}
</Box>
)
})
on('session.start', async ($, e, next) => {
const branch = '…'
const behind = '…'
const upstream = '…'
const why = '…'
const firstLine = '…'
await $.ui.toast(`${branch} is ${behind} behind ${upstream}; not pulled because ${why}.`)
await $.ui.toast(`Pull failed: ${firstLine}`)
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.
git-sync-band/hooks/register.tsx lines 450–609 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
if (e.props.hasSurvey) return next(e)
const snap = await read($, snapAtom)
if (!snap) return next(e)
const ui = await read($, uiAtom)
const now = await $.clock.now()
const table = $.ui.resolve(e)
const { Box, Button, Text } = table
// The terminal draws no pictures: words there, and the keys it can press.
const Svg = e.surface !== 'terminal' && 'Svg' in table ? table.Svg : undefined
const isTerminal = Svg === undefined
const below = await next(e)
const changed = snap.files.length
const isIdle = !e.props.isWorking && !ui.busy && !ui.pending
const canCommit = !snap.op && snap.conflicted === 0 && (changed > 0 || snap.ahead > 0)
const listRows = Math.max(1, e.props.maxRows - (ui.pending ? 5 : 2))
const target = snap.upstream ?? `origin/${snap.branch}`
// What the row says, each piece with its color; the pushed time goes first
// when the band is short of room.
const pieces = [
snap.upstream === null ? { text: 'not on remote', color: undefined } : null,
snap.behind > 0 ? { text: `↓${snap.behind} behind`, color: 'warning' } : null,
snap.ahead > 0 ? { text: `↑${snap.ahead} to push`, color: 'permission' } : null,
snap.upstream !== null && snap.ahead === 0 && snap.behind === 0 ? { text: 'in sync', color: undefined } : null,
{ text: changed > 0 ? `${changed} changed` : 'clean', color: undefined },
snap.conflicted > 0 ? { text: plural(snap.conflicted, 'conflict'), color: 'error' } : null,
snap.op !== null ? { text: `${snap.op} in progress`, color: 'error' } : null,
ui.busy !== null ? { text: ui.busy, color: 'warning' } : null,
].filter(piece => piece !== null)
const pushed = snap.pushedAt !== null ? `pushed ${ago(now - snap.pushedAt)}` : null
const actions = [
{
key: 'files',
name: ui.isExpanded ? 'Hide files' : 'Files',
paths: FILES,
ink: INK,
hotkey: 'f',
shows: changed > 0,
onPress: () => void update($, uiAtom, u => ({ ...u, isExpanded: !u.isExpanded })),
},
{
key: 'pull',
name: 'Pull',
paths: PULL,
ink: INK,
hotkey: 'p',
shows: isIdle && snap.behind > 0,
onPress: () => void pullNow($),
},
{
key: 'commit',
name: changed > 0 ? 'Commit & push' : 'Push',
paths: PUSH,
ink: ACCENT,
hotkey: 'c',
shows: isIdle && canCommit,
onPress: () => void startCommit($),
},
].filter(action => action.shows)
// The fullest layout that fits one row: every word; then without the
// pushed time and the buttons' names; then icons alone, the words in
// hover cards. The terminal keeps its words.
const columns = e.props.bodyColumns
const statusCells = pieces.reduce((sum, piece) => sum + 1 + textCells(`· ${piece.text}`), 0)
const leftCells = (Svg ? pxCells(16) + 1 : textCells('git ')) + textCells(snap.branch) + statusCells
// Files is its icon alone; the others are named where there's room.
const isNamed = (key: string) => key !== 'files'
const namedCells = actions.reduce(
(sum, action) =>
sum + (isNamed(action.key) ? (Svg ? ICON_BUTTON + 1 : 0) + textCells(action.name) + PAD : ICON_BUTTON) + 2,
0,
)
const iconCells = actions.length * (ICON_BUTTON + 1)
const fullCells = Math.ceil(leftCells + (pushed ? 1 + textCells(`· ${pushed}`) : 0) + 3 + namedCells)
const mediumCells = Math.ceil(leftCells + 3 + iconCells)
const layout = isTerminal || columns >= fullCells ? 'full' : columns >= mediumCells ? 'medium' : 'icons'
const isIcons = layout === 'icons'
const hasNames = layout === 'full'
// A card that opens while the pointer is over the keyed Box around it.
const card = (...lines: string[]) => (
<Box
position="absolute"
top={-4}
left={0}
display="none"
hover={{ display: 'flex' }}
flexDirection="column"
borderStyle="round"
borderColor="subtle"
backgroundColor="background"
paddingX={1}
>
{lines.map(line => (
<Text>{line}</Text>
))}
</Box>
)
// An icon a person presses: a blank button laid over the picture takes the
// click, and its hover frames it.
const pressable = (key: string, paths: string, ink: string, onPress: () => void, tip?: string) => (
<Box key={`${key}-box`} position="relative" flexDirection="row" alignItems="center" flexShrink={0}>
{Svg && <Svg source={iconSvg(paths, ink)} alt={tip ?? key} width={16} height={16} />}
<Box
position="absolute"
top={0}
left={0}
right={0}
height="100%"
flexDirection="row"
alignItems="center"
justifyContent="center"
>
<Button key={key} label={ICON_BLANK} plain onPress={onPress} />
</Box>
{tip !== undefined && card(tip)}
</Box>
)
// An action: its icon and name where there's room, the icon alone (named
// in a hover card) where there isn't, a key and a name on the terminal.
const action = (a: (typeof actions)[number], withName: boolean) => {
if (isTerminal) {
return <Button key={a.key} label={a.name} hotkey={a.hotkey} plain onPress={a.onPress} />
}
if (!withName) return pressable(a.key, a.paths, a.ink, a.onPress, a.name)
return (
<Box key={`${a.key}-named`} flexDirection="row" alignItems="center" columnGap={1} flexShrink={0}>
{pressable(`${a.key}-icon`, a.paths, a.ink, a.onPress)}
<Button key={a.key} label={a.name} plain onPress={a.onPress} />
</Box>
)
}
const summary = [snap.branch, ...pieces.map(piece => piece.text), ...(pushed ? [pushed] : [])].join(' · ')
const branch = (
<Box key="branch" flexDirection="row" alignItems="center" columnGap={1} flexShrink={0}>
{Svg ? (
<Box flexShrink={0}>
<Svg source={iconSvg(BRANCH, branchInk(snap))} alt={`Branch ${snap.branch}`} width={16} height={16} />
</Box>
) : (
<Text dimColor>git</Text>
)}
{!isIcons && (
<Text bold wrap="truncate">
{snap.branch}
</Text>
)}
{!isIcons &&
pieces.map(piece => (
<Text color={piece.color} dimColor={piece.color === undefined} wrap="truncate">Licence text (MIT)
MIT License Copyright (c) 2026 Mohab Yasser 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 Claudetool 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 6732b3bf4d59 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.git-sync-band/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.git (reaches the network) |
| 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 "mohabyasser2-git-sync-band" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
▴Token OptimizerCheckpointCheckpointCheckpointbuildStart freshbuildStart freshbuildStart freshbuildCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointbuildbuildbuildTokens savedSaved Clean up tokens in 30 days (chat 2 this session)Ask Claude…
-
plan-progress is on. A bar appears when Claude starts a task with several steps.Ask Claude…
-
Ask Claude…Fix loginRemoveCopy markdownacme/app · mainCopy linkCopy markdownbuild2h 10mbuild2h 10mbuild2h 10mHosted on uploads.sh, not committed to the repo.They will appear in a comment on the pull request once opened.
-
What it does
- Draws a band above the prompt, a pane
- Adds /progress
- Watches tool calls and can refuse them
- Hooks classic.SessionStart, prompt.compose, prompt.submit, session.start and 2 more
-
Auto compact%System tools Compact▲Context is already at 42%, past Weekly%. Auto compact:NowAfter my next compactOnly in new chatsUsage limits show after the first reply.Auto compactToolsbuild42%Toolsbuild42%Toolsbuild42%Context12.4 free of 12.4k42% usedbuild12.4kbuild12.4kbuild12.4kAsk Claude…claude-code-usage-quota: Compact
-
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