ModsCode / Claude Code Mods / Ranking / source-control
source-control
Source Control for Claude Code: Git status above the chat box, a panel with changes, commit, a history graph, branches and worktrees, plus fetch, pull, push and sync in one click. English and German.
What it does
- Draws a band above the prompt, a pane
- Watches tool calls and can refuse them
- Hooks config.describe, session.start, turn.complete, ui.close
- 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
A starter ModsCode writes from the drawing it read, and the mod's own lines that draw, where there are any.
Starter (register.tsx)
import type { Register } from 'claude-code'
// Drawn like source-control by manuel-will (pane, band, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/manuel-will-source-control/
// 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 } = $.ui.resolve(e)
const cutEnd = '…'
const behind = '…'
const ahead = '…'
const changes = '…'
const operation = '…'
const unpublished = '…'
const busy = '…'
const text = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" width="100%" paddingRight={4}>
<Box flexShrink={1}>
<Box flexDirection="row" alignItems="center">
⎇
<Text wrap="truncate-end">
<Text bold>
{cutEnd}
</Text>
<Text color="warning">
{` ${behind}↓`}
</Text>
<Text color="suggestion">
{` ${ahead}↑`}
</Text>
<Text>
{` ✎ ${changes}`}
</Text>
</Text>
<Box flexDirection="row" alignItems="center" marginLeft={2}>
✎
<Text>
{`${changes}`}
</Text>
</Box>
<Text wrap="truncate-end">
<Text color="success">
{" ✓"}
</Text>
<Text color="error">
{` · ${operation}`}
</Text>
<Text color="inactive">
{` · ${unpublished}`}
</Text>
<Text color="inactive">
{` · ${busy}`}
</Text>
<Text color="warning">
{` · ${text}`}
</Text>
</Text>
</Box>
</Box>
<Box flexGrow={1} />
<Box marginLeft={1}>
<Box flexDirection="row">
<Button variant="primary">
{" "}
</Button>
</Box>
</Box>
<Box marginLeft={1}>
<Button plain>
◨
</Button>
</Box>
</Box>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "source-control" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Input } = $.ui.resolve(e)
const titleNarrow = '…'
const branchTextOf = '…'
const upstream = '…'
const behind = '…'
const ahead = '…'
const checked = '…'
const name = '…'
const address = '…'
const worktreeOf = '…'
const operation = '…'
const fetchFailed = '…'
const text = '…'
const messagePlaceholder = '…'
const hooksHint = '…'
return (
<Box flexDirection="column" paddingX={1} paddingTop={1}>
<Box flexDirection="row" paddingRight={0}>
<Text bold>
{titleNarrow}
</Text>
<Box flexGrow={1} />
<Box flexDirection="row" alignItems="center" marginLeft={2}>
↻
<Button plain dimColor />
</Box>
<Box flexDirection="row" alignItems="center" marginLeft={2}>
↓
<Button plain dimColor />
</Box>
<Box flexDirection="row" alignItems="center" marginLeft={2}>
↑
<Button plain dimColor />
</Box>
</Box>
<Box flexDirection="row" alignItems="center">
⎇
<Text wrap="truncate-end">
<Text bold>
{branchTextOf}
</Text>
<Text>
<Text color="inactive">
{" → "}
</Text>
<Text color="merged">
{upstream}
</Text>
</Text>
<Text color="warning">
{` ${behind}↓`}
</Text>
<Text color="suggestion">
{` ${ahead}↑`}
</Text>
<Text color="warning">
{` · ${checked}`}
</Text>
</Text>
</Box>
<Box flexDirection="row">
<Box flexShrink={0}>
<Text dimColor>
{`${name} ·`}
</Text>
</Box>
<Box marginLeft={1} flexShrink={1}>
<Text dimColor wrap="truncate-end">
{address}
</Text>
</Box>
</Box>
<Text dimColor wrap="truncate-end">
{worktreeOf}
</Text>
<Text color="error" wrap="wrap">
{operation}
</Text>
<Text color="warning" wrap="wrap">
{fetchFailed}
</Text>
<Text wrap="wrap">
{text}
</Text>
<Box flexDirection="row">
<Button />
</Box>
<Text dimColor wrap="truncate-end">
────────
</Text>
<Input placeholder={`${messagePlaceholder}`} submitLabel="commit" autoFocus />
<Box flexDirection="row" marginTop={0} />
<Text dimColor wrap="truncate-end">
{hooksHint}
</Text>
</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.
source-control/hooks/register.tsx lines 848–865 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
bandDraws += 1
bandSurfaces.add(e.surface)
if (e.props.hasSurvey) {
return next(e)
}
const [probe, snapshot, view] = await Promise.all([read($, PROBE), read($, SNAPSHOT), read($, VIEW)])
if (probe !== 'repo' || snapshot === null) {
return next(e)
}
const kit = kitOf($.ui.resolve(e), e.surface, e.props.bodyColumns)
return bandView(kit, snapshot, view ?? INITIAL_VIEW, handlers, staleAfterMs)
})source-control/hooks/ui/band.tsx lines 147–182 · Band
export function bandView(
kit: Kit,
snapshot: ScSnapshot,
view: ScView,
handlers: Handlers,
staleAfterMs: number,
): RenderElement {
const { Box, Button } = kit
const primary: Primary | null = primaryOf(snapshot)
const isNarrow = kit.columns < NARROW_COLUMNS
const isBusy = view.busy !== null
const primaryLabel = primary === null ? '' : isNarrow ? primary.short : primary.label
const busyLabel = view.busy ?? ''
return (
<Box flexDirection="row" width="100%" paddingRight={kit.surface === 'terminal' ? ENGINE_MARK_COLUMNS : 0}>
<Box flexShrink={1}>{statusText(kit, snapshot, view, staleAfterMs)}</Box>
<Box flexGrow={1} />
{primary !== null && (
<Box marginLeft={1}>
{primaryButton(kit, 'primary', isBusy ? null : primary.icon, isBusy ? busyLabel : primaryLabel, () => {
if (!isBusy) {
handlers.primary(primary.kind)
}
}, isBusy)}
</Box>
)}
<Box marginLeft={1}>
<Button key="panel" plain dimColor={!view.isPaneOpen} onPress={() => handlers.togglePane()}>
{GLYPH.panel}
</Button>
</Box>
</Box>
)
}source-control/hooks/ui/band.tsx lines 93–134 · Band
function statusText(kit: Kit, snapshot: ScSnapshot, view: ScView, staleAfterMs: number): RenderElement {
const { Text } = kit
const isNarrow = kit.columns < NARROW_COLUMNS
const changes = changeCountOf(snapshot)
const operation = operationTextOf(snapshot)
const freshness = isNarrow ? null : freshnessOf(snapshot, view, staleAfterMs)
const isUnpublished = snapshot.upstream === null && snapshot.branch !== null && snapshot.remoteName !== null && !snapshot.isUnborn
const branchRoom = Math.max(8, Math.floor(kit.columns / 3))
const { Box } = kit
// the desktop draws the pencil as an icon (the glyph is an emoji there),
// so the line breaks into the text before it and the text after it
const hasIcons = kit.Svg !== null
return (
<Box flexDirection="row" alignItems="center">
{icon(kit, 'branch', 'muted', COLOR.muted)}
<Text wrap="truncate-end">
<Text bold>{cutEnd(clean(branchTextOf(snapshot)), branchRoom)}</Text>
{snapshot.behind > 0 && <Text color={COLOR.behind}>{` ${snapshot.behind}${GLYPH.behind}`}</Text>}
{snapshot.ahead > 0 && <Text color={COLOR.ahead}>{` ${snapshot.ahead}${GLYPH.ahead}`}</Text>}
{changes > 0 && !hasIcons && <Text>{` ${GLYPH.changes} ${changes}`}</Text>}
</Text>
{changes > 0 && hasIcons && (
<Box flexDirection="row" alignItems="center" marginLeft={2}>
{icon(kit, 'edit', 'muted')}
<Text>{`${changes}`}</Text>
</Box>
)}
<Text wrap="truncate-end">
{isConfirmedSettled(snapshot, view, staleAfterMs) && <Text color={COLOR.ok}>{` ${GLYPH.clean}`}</Text>}
{operation !== null && <Text color={COLOR.error}>{` · ${operation}`}</Text>}
{isUnpublished && !isNarrow && <Text color={COLOR.muted}>{` · ${t().unpublished}`}</Text>}
{view.busy !== null && <Text color={COLOR.muted}>{` · ${view.busy}`}</Text>}
{view.busy === null && freshness !== null && (
<Text color={freshness.isWarning ? COLOR.warn : COLOR.muted}>{` · ${freshness.text}`}</Text>
)}
</Text>
</Box>
)
}source-control/hooks/ui/band.tsx lines 50–87 · Band
export function primaryButton(
kit: Kit,
key: string,
iconName: IconName | null,
label: string,
onPress: () => void,
isBusy: boolean,
isWide = false,
): RenderElement {
const { Box, Button } = kit
// the app's own button keeps the app's size, next to its neighbours
if (kit.surface !== 'terminal') {
return (
<Box flexDirection="row">
<Button key={key} variant="primary" dimColor={isBusy} onPress={onPress}>
{label === '' ? ' ' : label}
</Button>
</Box>
)
}
const shown = iconName !== null ? [glyphOf(iconName), label].filter(part => part !== '').join(' ') : label
return (
<Box
flexDirection="row"
alignItems="center"
backgroundColor={VSCODE_BLUE}
paddingX={1}
{...(isWide ? { flexGrow: 1, justifyContent: 'center' as const } : {})}
>
<Button key={key} plain dimColor={isBusy} onPress={onPress}>
{shown === '' ? ' ' : shown}
</Button>
</Box>
)
}source-control/hooks/register.tsx lines 867–875 · Pane
on('ui.render', { component: 'Pane', requestId: PANE_ID }, async ($, e) => {
paneDraws += 1
paneSurfaces.add(e.surface)
const [snapshot, view] = await Promise.all([read($, SNAPSHOT), read($, VIEW)])
const kit = kitOf($.ui.resolve(e), e.surface, Math.max(10, e.props.bodyColumns - 2))
return paneView(kit, snapshot, view ?? INITIAL_VIEW, handlers, staleAfterMs, e.props.placement === 'dock')
})source-control/hooks/ui/pane.tsx lines 586–743 · Pane
export function paneView(
kit: Kit,
snapshot: ScSnapshot | null,
view: ScView,
handlers: Handlers,
staleAfterMs: number,
isDocked: boolean,
): RenderElement {
const { Box, Button, Text } = kit
const isBusy = view.busy !== null
const isFolded = (id: string) => view.folded.includes(id)
const top = headerRow(kit, handlers, isBusy, isDocked)
// the terminal draws a docked pane's close mark in its first row; the
// desktop puts it in a title bar of its own
const hasMarkRow = isDocked && kit.Svg === null
if (snapshot === null) {
return (
<Box flexDirection="column" paddingX={1} paddingTop={hasMarkRow ? 1 : 0}>
{top}
{dimLine(kit, t().noRepository)}
</Box>
)
}
const details = snapshot.details
const conflictCount = snapshot.conflicts.length
const operation =
snapshot.operation !== null
? `${t().operationRunning(OPERATION_NAMES[snapshot.operation])} · ${conflictCount > 0 ? t().conflicts(conflictCount) : t().allConflictsResolved}`
: operationTextOf(snapshot)
const notice = view.notice
const noticeColor = notice?.tone === 'error' ? COLOR.error : notice?.tone === 'success' ? COLOR.ok : COLOR.muted
const target = snapshot.branch ?? 'HEAD'
// the message field only while there is something to commit (or a merge
// to conclude), so a clean repository shows no commit control at all
const canCommit = changeCountOf(snapshot) > 0 || snapshot.operation === 'merge'
const { Input } = kit
const sections: (RenderElement | null | false)[] = []
if (snapshot.conflicts.length > 0) {
sections.push(sectionHeader(kit, handlers, 'conflicts', t().conflictsSection, snapshot.conflicts.length, isFolded('conflicts')))
if (!isFolded('conflicts')) {
sections.push(dimLine(kit, t().conflictsHint))
sections.push(...snapshot.conflicts.map(file => fileRow(kit, handlers, file, 'stage')))
}
}
if (snapshot.staged.length > 0) {
sections.push(
sectionHeader(
kit,
handlers,
'staged',
t().stagedSection,
snapshot.staged.length,
isFolded('staged'),
<Button key="unstage-all" plain dimColor onPress={() => handlers.act('unstageAll')}>
{`${GLYPH.unstage} ${t().all}`}
</Button>,
),
)
if (!isFolded('staged')) {
sections.push(...snapshot.staged.map(file => fileRow(kit, handlers, file, 'unstage')))
}
}
sections.push(
sectionHeader(
kit,
handlers,
'changes',
t().changesSection,
snapshot.unstaged.length,
isFolded('changes'),
snapshot.unstaged.length > 0 ? (
<Button key="stage-all" plain dimColor onPress={() => handlers.act('stageAll')}>
{`${GLYPH.stage} ${t().all}`}
</Button>
) : null,
),
)
if (!isFolded('changes')) {
sections.push(
...(snapshot.unstaged.length > 0
? snapshot.unstaged.map(file => fileRow(kit, handlers, file, 'stage'))
: [dimLine(kit, changeCountOf(snapshot) === 0 ? `${t().noChanges} ${GLYPH.clean}` : conflictCount > 0 ? t().noOtherChanges : t().allStaged)]),
)
}
sections.push(sectionHeader(kit, handlers, 'history', t().historySection, null, isFolded('history')))
if (!isFolded('history')) {
sections.push(...historyRows(kit, snapshot))
}
if (details !== null) {
sections.push(sectionHeader(kit, handlers, 'branches', t().branchesSection, details.branches.length, isFolded('branches')))
if (!isFolded('branches')) {
sections.push(...details.branches.map(branch => branchRow(kit, branch, view.fetchError === null)))
}
if (details.worktrees.length > 1) {
sections.push(sectionHeader(kit, handlers, 'worktrees', t().worktreesSection, details.worktrees.length, isFolded('worktrees')))
if (!isFolded('worktrees')) {
sections.push(...details.worktrees.map(tree => worktreeRow(kit, tree)))
}
}
if (details.stashes.length > 0) {
sections.push(sectionHeader(kit, handlers, 'stashes', t().stashesSection, details.stashes.length, isFolded('stashes')))
if (!isFolded('stashes')) {
sections.push(...details.stashes.map(stash => stashRow(kit, stash)))
}
}
}
return (
<Box flexDirection="column" paddingX={1} paddingTop={hasMarkRow ? 1 : 0}>
{top}
{infoRow(kit, snapshot, view, staleAfterMs)}
{details?.remote != null && remoteRow(kit, snapshot.remoteName ?? 'remote', details.remote)}
{snapshot.isLinkedWorktree && dimLine(kit, t().worktreeOf(shortPathOf(snapshot.commonDir.replace(/[\\/]\.git[\\/]?$/, ''))))}
{operation !== null && <Text color={conflictCount > 0 ? COLOR.error : COLOR.warn} wrap="wrap">{operation}</Text>}
{view.fetchError !== null && <Text color={COLOR.warn} wrap="wrap">{t().fetchFailed(view.fetchError)}</Text>}
{notice !== null && notice.text !== view.fetchError && <Text color={noticeColor} wrap="wrap">{notice.text}</Text>}
{notice?.retry === 'autostash' && !isBusy && (
<Box flexDirection="row">
<Button key="retry-autostash" onPress={() => handlers.act('pullAutostash')}>
{t().pullAutostash}
</Button>
</Box>
)}
{kit.Svg === null ? rule(kit) : <Box marginTop={1} />}
{Input !== null && canCommit && (
<Input
key={`message-${view.commitField}`}
placeholder={t().messagePlaceholder(target)}
submitLabel={kit.Svg === null ? 'commit' : '↵'}
autoFocus
onInput={value => handlers.draft(value)}
onSubmit={value => handlers.commit(value)}
/>
)}
{actionRow(kit, snapshot, view, handlers)}
{details?.hasHooks === true && dimLine(kit, t().hooksHint)}
{sections}
</Box>
)
}Licence text (MIT)
MIT License Copyright (c) 2026 manuel-will 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.
How to build this: Pane (panel), Deny a tool call
What its code calls
runs programswrites filesenv varsdrives Claudetool callsremembers
What its code shows
Read from the source at commit f70a2b680b13 on 2026-10-11. 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.source-control/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.14 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.source-control/hooks/register.tsx:77 a program named at run time |
| Reads and sends | Whether it both reads something of yours (files, environment variables, the transcript, settings) and reaches outside (the network, an MCP server, another session, telemetry).reads environment variables, files, settings.json, but reaches nothing outside |
| 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 |
| Settings hooks | Hooks declared in hooks/hooks.json or plugin.json beside the module: a command (a shell when it has no args), an HTTP request, an MCP tool or a model prompt at an event. They run outside $.no settings hooks: its function hooks alone |
| Servers it ships | MCP servers (a program, or a URL; a headersHelper is a shell command; a .mcpb bundle is unpacked at run time), LSP servers, monitors (a shell command for the whole session) and bin/ (on the PATH of the Bash tool).ships no MCP or LSP server, no monitor, no bin/ |
| Skills, commands, agents | What its Markdown declares beyond text: allowed-tools granted for the turn, hooks added when a skill is invoked, a command run before Claude reads the skill.no skills, commands, agents or workflows |
| Tools and MCP | Whether every tool it calls through $.tool.call and $.mcp.call is named in the code, and none is a shell (Bash through the tool runs a shell without $.process).calls no tool, MCP server or command |
| Asks of the model | Completions it runs ($.model.complete, fork, classify), subagents it spawns, prompts it submits as you, and the tools, commands and agents it adds.prompt.submit (as the person) |
| Events it hooks | By what a hook there can do: gates (refuse a tool call, a prompt, a setting, another plugin), shapes (what the model reads: the system prompt, tool descriptions, each request), reads (your input, the events of the settings hooks, every event with *), and the rest.gates: tool.call, command.run · also: session.start, config.describe, turn.complete, ui.close (+1) · timers: clock.after, clock.every |
| Reads, by name | The environment variables and files it names, and whether it reads the transcript, settings.json, the prompt box or the mouse selection.env: GIT_SSH_COMMAND, GIT_SSH, LC_ALL, LC_MESSAGES, LANG; files: a path computed at run time, its own folder/.claude-plugin/plugin.js…; settings.json |
| Writes, by name | The files and environment variables it names, and whether it changes settings, the prompt box, the clipboard, the conversation (a row the model reads) or another session.files: a path computed at run time |
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 its code (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.
From its marketplace
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 manuel-will/cc-source-control/plugin install source-control@cc-source-control/reload-pluginsThis installs the marketplace's latest commit, which may not be the one read here (f70a2b680b13). Compare them before you install. /reload-plugins loads it into a session that is already open.
Try the commit ModsCode read
No marketplace needed. In a terminal, clone the repository, check out the commit read, validate the mod, and load it for one session:
git clone https://github.com/manuel-will/cc-source-controlgit -C cc-source-control checkout f70a2b680b131ee736b9914aa4b9e0f952306373claude plugin validate cc-source-control/source-controlclaude --plugin-dir cc-source-control/source-controlThe validate line lists the events the mod hooks and what it asks Claude Code to do, without running it. The last line loads the mod for this session only and writes nothing to your settings. If the author has rewritten history, the commit may no longer exist.
Ask Claude about it
With the ModsCode connector added, Claude can read this mod's code and what it reaches, and build on them. Ask it like this:
Read the ModsCode mod "manuel-will-source-control" with its code and make me one like itSearch them from Claude: the MCP connector
Similar mods
- mod-storehellosverre★ 2
- pr-commentsaguiddir★ 2
- gh-inboxmako-code★ 1
- issue-boardastrosteveo★ 0
- lingo-paneAsdrúbal Iván Suárez Rivera★ 0
- tidemarkVizzleTF★ 0
Badge for your README
If this is your mod, paste this into your README. It links to this page.
[](https://modscode.com/claude-mods/mods/manuel-will-source-control/)