A live git strip above the prompt: branch, ahead/behind, changed files and the open pull request's checks.

A small collection of Claude Code mods.
/plugin install <mod> --marketplace Arkboi-GG/claude-mods
The bars stack above the prompt, so you can install any combination.
/compact with instructions to keep the thread (goal, decisions, files, key values, open questions, next steps) so work carries on in the same topic; change them with the compactInstructions option. The 5-hour and 7-day rings show the time left until they reset (the ring still fills with the share used). If you also use the skins mod, run /skin band off once so its own usage band doesn't show twice.git; gh is optional).web=5173,api=3000).checks) and shows pass/fail with an error count.LOCAL badge that turns red PROD when a tool call matches your production patterns, and toasts when it happens.Name: , e.g. Olivia: rewrite welcome email; map names to outfits with the outfits option. While an agent runs, a playful stage word (Waking up, Analyzing, Cooking, Wrapping up) follows what its tool calls show it doing; "Wrapping up" is a guess, since an agent reports no progress.hooks/register.tsx 140 lines1import { atom, read, update } from 'claude-code'
2import type { Register } from 'claude-code'
3
4import type { Repo } from '../types'
5
6const repoAtom = atom({ plugin: 'repo-status', key: 'repo' } as const, null as Repo | null)
7
8const WIDE = 110
9
10const gateAtom = atom({ plugin: 'repo-status', key: 'gate' } as const, false)
11
12// The bars only show in a GitHub repository: true when the session's folder is inside a git
13// repository whose remote is on GitHub (any git repository when `githubOnly` is off).
14async function inGithubRepo($: any, githubOnly: boolean): Promise<boolean> {
15 try {
16 const r = await $.process.run(['git', 'remote', '-v'], { timeoutMs: 5000 })
17 if (r.exitCode !== 0) return false
18 return !githubOnly || /github\.com/i.test(r.stdout)
19 } catch {
20 return false
21 }
22}
23
24async function checkGate($: any, githubOnly: boolean) {
25 const ok = await inGithubRepo($, githubOnly)
26 await update($, gateAtom, p => (p === ok ? p : ok))
27}
28
29// Shared "dev row" protocol (the same helper sits in every mod of this repo):
30// each mod adds a keyed zone to one row, so the mods fill a single line together
31// and still work alone. Zones sort by their key, `zone-<order>`.
32function addZone(below: any, zone: any, order: number): any {
33 const tagged = { ...zone, props: { ...zone.props, key: `zone-${order}`, flexShrink: 0 } }
34 const byKey = (a: any, b: any) => String(a?.props?.key).localeCompare(String(b?.props?.key))
35 const merge = (node: any): any => {
36 if (!node || typeof node !== 'object') return null
37 if (node.props?.key === 'devrow') return { ...node, children: [...(node.children ?? []), tagged].sort(byKey) }
38 const kids: any[] = node.children ?? []
39 for (let i = 0; i < kids.length; i++) {
40 const hit = merge(kids[i])
41 if (hit) return { ...node, children: kids.map((k, j) => (j === i ? hit : k)) }
42 }
43 return null
44 }
45 const merged = merge(below)
46 if (merged) return merged
47 const row = {
48 type: 'Box',
49 props: { key: 'devrow', paddingX: 1, justifyContent: 'space-between', flexWrap: 'wrap', columnGap: 3 },
50 children: [tagged],
51 }
52 return {
53 type: 'Box',
54 props: { flexDirection: 'column' },
55 children: below ? [below, row] : [row],
56 }
57}
58
59export const register: Register = (on, options) => {
60 const githubOnly = options.githubOnly !== false
61
62 // The session moved to another folder: check it again.
63 on('classic.CwdChanged', async ($, e, next) => {
64 await checkGate($, githubOnly)
65 return next(e)
66 })
67
68 const wantPr = options.showPullRequest !== false
69 let prText = ''
70 let prLong = ''
71 let prAt = 0
72
73 on('session.start', async ($, e, next) => {
74 await checkGate($, githubOnly)
75 $.clock.every(15000, () => checkGate($, githubOnly))
76 const poll = async () => {
77 if (!(await read($, gateAtom))) return
78 try {
79 const st = await $.process.run(['git', 'status', '--porcelain=v1', '-b'], { timeoutMs: 8000 })
80 if (st.exitCode !== 0) return update($, repoAtom, () => null)
81 const lines = st.stdout.split('\n').filter(Boolean)
82 const head = lines[0] ?? ''
83 const branch = head.replace(/^## /, '').replace(/^No commits yet on /, '').split('...')[0].split(' ')[0]
84 const ahead = Number(/ahead (\d+)/.exec(head)?.[1] ?? 0)
85 const behind = Number(/behind (\d+)/.exec(head)?.[1] ?? 0)
86
87 const now = await $.clock.now()
88 if (wantPr && now - prAt > 60000) {
89 prAt = now
90 try {
91 const pr = await $.process.run(['gh', 'pr', 'view', '--json', 'number,state,statusCheckRollup'], { timeoutMs: 15000 })
92 if (pr.exitCode === 0) {
93 const j = JSON.parse(pr.stdout)
94 const checks: Array<{ conclusion?: string; status?: string }> = j.statusCheckRollup ?? []
95 const bad = checks.some(c => ['FAILURE', 'CANCELLED', 'TIMED_OUT'].includes(c.conclusion ?? ''))
96 const pending = checks.some(c => c.status !== 'COMPLETED')
97 const mark = j.state === 'MERGED' ? 'merged' : bad ? '✗' : pending ? '…' : '✓'
98 prText = `PR #${j.number} ${mark}`
99 prLong = j.state === 'MERGED' ? 'merged' : bad ? 'checks failing' : pending ? 'checks running' : 'checks passing'
100 } else {
101 prText = ''
102 prLong = ''
103 }
104 } catch {
105 prText = ''
106 prLong = ''
107 }
108 }
109 await update($, repoAtom, () => ({ branch, ahead, behind, changed: lines.length - 1, pr: prText, prLong }))
110 } catch {
111 // git missing or timed out: keep the last reading
112 }
113 }
114 await poll()
115 $.clock.every(5000, poll)
116 return next(e)
117 })
118
119 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
120 const below = await next(e)
121 const repo = await read($, repoAtom)
122 if (e.props.hasSurvey || !repo || !(await read($, gateAtom))) return below
123
124 const { Box, Text } = $.ui.resolve(e)
125 const isWide = e.props.bodyColumns >= WIDE
126 const dirty = repo.changed > 0
127 const prColor = repo.pr.includes('✗') ? '#ef4444' : repo.pr.includes('…') ? '#f59e0b' : '#22c55e'
128
129 const zone = (
130 <Box gap={2}>
131 <Text bold color="#a855f7">{repo.branch}</Text>
132 {repo.ahead > 0 || repo.behind > 0 || isWide ? <Text dimColor>↑{repo.ahead} ↓{repo.behind}</Text> : null}
133 <Text color={dirty ? '#f59e0b' : '#22c55e'}>{dirty ? `● ${repo.changed} changed` : '✓ clean'}</Text>
134 {repo.pr ? <Text color={prColor}>{isWide && repo.prLong ? `${repo.pr.split(' ').slice(0, 2).join(' ')} · ${repo.prLong}` : repo.pr}</Text> : null}
135 </Box>
136 )
137 return addZone(below, zone, 1)
138 })
139}
140types/index.d.ts 15 lines1export type Repo = {
2 branch: string
3 ahead: number
4 behind: number
5 changed: number
6 pr: string
7 prLong: string
8}
9
10declare module 'claude-code' {
11 interface PluginState {
12 'repo-status': { repo: Repo | null; gate: boolean }
13 }
14}
15