Draws each tool call as one compact 'tool_call: Tool(input) - meta' line that a click opens to its result and closes again

A harness-agnostic agent skill stack.
Skills follow the Agent Skills format (SKILL.md + optional scripts/references/assets). One source of truth under skills/. Works with Cursor, Claude Code, Codex, and any other agent that discovers skills the standard way.
Inspired by stacks like pstack, but not locked to a single product.
npx skills add binbandit/bin-stack
Pick specific skills:
npx skills add binbandit/bin-stack --skill file-pr --skill babysit-pr --skill arena --skill bro
git clone https://github.com/binbandit/bin-stack.git ~/Developer/ai/bin-stack
cd ~/Developer/ai/bin-stack
./scripts/link-skills.sh
That links each skill directory into the harness roots you already have (~/.agents/skills, ~/.cursor/skills, ~/.claude/skills, ~/.codex/skills, …). Edit here; every harness sees the same files.
| Skill | When to use |
|---|---|
file-pr | File or update a concise pull request |
babysit-pr | Monitor a PR through review bots and CI |
arena | Run competing attempts, then graft the strongest ideas into one result |
bro | Restate the last message in plain language |
verify | Prove a behavior change on the user surface with revision-bound evidence |
review | Filter adversarial findings by reachable failure and concrete evidence |
anatomy | Build detailed, interactive isometric illustrations that explain technical ideas as physical machines |
anatomy includes its rendering kit, reference guides, examples, and helper scripts. It needs Node.js 20.10+; browser checks also need Chrome or Chromium (set CHROME_PATH if it is not in a standard location). Build and capture the smallest example from the skill directory:
cd skills/anatomy
node examples/dial-indicator/build.mjs --light
node scripts/capture.mjs examples/dial-indicator/dial-indicator-light.html --out /tmp/anatomy-preview.png
See anatomy's setup and verification guide for the other script commands.
Claude Code mods: plugins of function hooks that change how Claude Code looks and behaves. They are Claude Code only.
| Mod | What it does |
|---|---|
glamour-dark | Draws replies as rich markdown in glamour's dark style, one sentence per line |
redact-secrets | Swaps secrets for placeholders before Claude reads them or the session logs them; Write and Edit put the real values back |
tool-lines | Draws each tool call as one compact line; click a call to open its result, click it again to close it |
ascii-spinner | Swaps the working line (verb, timer, tokens, effort, tip) for a one-row WEAVEworm rethreading synthsilk, in Sekiguchi colors |
slopothon | Paints a SLOPOTHON lockup over the Claude logo: block wordmark, a dot-matrix card naming the model and branch, and a livery strip with a tagline and barcode per session. Fullscreen ("tui": "fullscreen") only; it starts each session with a /slopothon row and the logo shows for ~130ms first. Type /slopothon to redraw it inline |
Install specific mods at user scope (requires Claude Code on PATH and Python 3):
./scripts/install-mods.sh --list
./scripts/install-mods.sh glamour-dark tool-lines
The script validates every requested name before changing anything, adds mods/ as the bin-stack marketplace, and installs only the named mods. No arguments prints usage and exits without installing anything; --list lists available names without making changes. Duplicate names are installed once per invocation, and re-running an install is safe. Claude Code reads the mods in place from this clone, so an edit here applies on the next session or /reload-plugins.
Run the installer's isolated fixture tests with python3 -m unittest discover -s scripts/tests -v.
skills/
file-pr/SKILL.md
babysit-pr/SKILL.md
arena/SKILL.md
bro/SKILL.md
verify/SKILL.md
review/SKILL.md
anatomy/ # SKILL.md, kit, references, examples, and helper scripts
mods/
.claude-plugin/marketplace.json
glamour-dark/
redact-secrets/
tool-lines/
ascii-spinner/
slopothon/
scripts/
link-skills.sh # optional: symlink into local harness skill roots
install-mods.sh # install named Claude Code mods
Canonical skills live in skills/. Harness-specific paths are adapters (symlinks or CLI installs), not forks of the content.
skills/<name>/SKILL.md with required name and description frontmatter.name matching the directory. Lowercase, hyphens only.references/; keep SKILL.md short enough to load on activation.See agentskills.io/specification.
MIT
The verify and review skills adapt selected pstack guidance by Lauren Tan at revision 9f451cf875ad1239912762f67741e8e5ba6ac0f1. Each skill bundles its provenance and the original MIT notice in LICENSE-pstack so attribution travels with individual skill installs.
The anatomy skill is imported from wheresryan22/anatomy at revision 689dcf966e63d92be10a5d593c6e19e10acd4422. Its source notes and original MIT license travel with individual skill installs.
hooks/register.ts 247 lines1import { atom, memberOf, read, update } from 'claude-code'
2import type { Register, SessionMessage } from 'claude-code'
3
4const ENGINE_ROW_INDENT = 4
5const DOT_COLUMN_WIDTH = 2
6const MIN_TEXT_WIDTH = 20
7const MIN_LINE_CHARS = 120
8const MAX_LINE_ROWS = 3
9const MAX_SUBJECT_CHARS = 35
10const UNMEASURED_TERMINAL_COLUMNS = 120
11// No-break space: a long path wraps inside itself instead of leaving the prefix alone on its row.
12const TOOL_CALL_PREFIX = 'tool_call:\u00a0'
13const RESULT_GUTTER_WIDTH = 3
14const MAX_RESULT_LINES = 40
15const MAX_RESULT_LINE_CHARS = 500
16
17type ToolRow = {
18 tool: string
19 input: unknown
20 output?: unknown
21 isRunning: boolean
22 isErrored: boolean
23 isInterrupted: boolean
24}
25
26const SUBJECT_KEYS_BY_PRIORITY = [
27 'command',
28 'file_path',
29 'notebook_path',
30 'pattern',
31 'url',
32 'query',
33 'skill',
34 'description',
35 'path',
36 'action',
37 'prompt',
38]
39
40const isRecord = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null
41
42const asOneLine = (text: string) => text.replace(/\s+/g, ' ').trim()
43
44function subjectOf(input: unknown): string {
45 if (!isRecord(input)) return ''
46 const subjectKey = SUBJECT_KEYS_BY_PRIORITY.find(key => typeof input[key] === 'string' && input[key] !== '')
47 if (subjectKey !== undefined) return asOneLine(String(input[subjectKey]))
48 return Object.keys(input).length === 0 ? '' : asOneLine(JSON.stringify(input))
49}
50
51const resultField = (row: ToolRow, name: string): unknown => (isRecord(row.output) ? row.output[name] : undefined)
52
53const printedOutput = (row: ToolRow) => `${resultField(row, 'stdout') ?? ''}\n${resultField(row, 'stderr') ?? ''}`
54
55type MetaProbe = (row: ToolRow) => string | undefined
56
57const META_PROBES: MetaProbe[] = [
58 row => (row.isInterrupted ? 'interrupted' : undefined),
59 row => (row.isErrored && !row.isInterrupted ? 'error' : undefined),
60 row => (resultField(row, 'backgroundTaskId') !== undefined ? 'background' : undefined),
61 row => (resultField(row, 'timedOutAfterMs') !== undefined ? 'timed out' : undefined),
62 row => (/Shell cwd was reset/.test(printedOutput(row)) ? 'shell cwd was reset' : undefined),
63 row => {
64 const note = resultField(row, 'returnCodeInterpretation')
65 return typeof note === 'string' && note !== '' ? note : undefined
66 },
67]
68
69type ToolLine = { tool: string; subject: string; meta: string }
70
71function clip(text: string, room: number): string {
72 if (text.length <= room) return text
73 return room <= 1 ? '…' : text.slice(0, room - 1) + '…'
74}
75
76// An open call shows its whole subject; a closed one cuts it so the tool name and meta stay readable.
77function lineFor(row: ToolRow, columns: number, isOpen: boolean): ToolLine {
78 const meta = META_PROBES.map(probe => probe(row))
79 .filter(note => note !== undefined)
80 .join(', ')
81 const subject = subjectOf(row.input)
82 if (isOpen) return { tool: row.tool, subject, meta }
83 const textWidth = Math.max(columns - ENGINE_ROW_INDENT - DOT_COLUMN_WIDTH, MIN_TEXT_WIDTH)
84 const lineBudget = Math.min(Math.max(textWidth, MIN_LINE_CHARS), textWidth * MAX_LINE_ROWS)
85 const frameChars = `${TOOL_CALL_PREFIX}${row.tool}()`.length + (meta === '' ? 0 : ` - ${meta}`.length)
86 const subjectRoom = Math.min(MAX_SUBJECT_CHARS, lineBudget - frameChars)
87 return { tool: row.tool, subject: clip(subject, subjectRoom), meta }
88}
89
90const hasFailed = (row: ToolRow) => row.isErrored || row.isInterrupted
91
92const hasFinished = (row: ToolRow) => !row.isRunning && row.output !== undefined
93
94function dotColor(row: ToolRow): 'error' | 'success' | 'warning' {
95 if (hasFailed(row)) return 'error'
96 return hasFinished(row) ? 'success' : 'warning'
97}
98
99// What the model read back is the one result text every tool has, MCP and plugin tools included.
100// An answered call's text never changes, so it is looked up in the transcript once.
101const answeredTextById = new Map<string, string>()
102
103async function answeredTextOf(id: string, transcript: () => Promise<SessionMessage[]>): Promise<string | undefined> {
104 const cached = answeredTextById.get(id)
105 if (cached !== undefined) return cached
106 const toolUses = (await transcript()).flatMap(message => message.toolUses)
107 const text = toolUses.find(use => use.tool_use_id === id)?.text
108 if (text !== undefined) answeredTextById.set(id, text)
109 return text
110}
111
112// A call the main transcript does not hold (a subagent's, or one past its newest entries) shows its stored result.
113function storedTextOf(row: ToolRow): string {
114 if (row.output === undefined) return ''
115 return typeof row.output === 'string' ? row.output : JSON.stringify(row.output, null, 2)
116}
117
118const SYSTEM_REMINDER = /<system-reminder>[\s\S]*?<\/system-reminder>/g
119// Text refuses every control character but tab and newline, so colour codes and carriage returns go.
120const ANSI_ESCAPE = /\u001b\[[0-?]*[ -/]*[@-~]/g
121const CONTROL_CHARACTER = /[\u0000-\u0008\u000b-\u001f\u007f]/g
122
123function resultLinesOf(text: string): string[] {
124 const lines = text
125 .replace(SYSTEM_REMINDER, '')
126 .replace(ANSI_ESCAPE, '')
127 .replace(CONTROL_CHARACTER, '')
128 .replaceAll('\t', ' ')
129 .trimEnd()
130 .split('\n')
131 .map(line => clip(line, MAX_RESULT_LINE_CHARS))
132 if (lines.length <= MAX_RESULT_LINES) return lines
133 const shown = lines.slice(0, MAX_RESULT_LINES - 1)
134 return [...shown, `… +${lines.length - shown.length} lines`]
135}
136
137let isTranscriptExpanded = false
138
139const isCompact = (surface: string) => surface === 'terminal' && !isTranscriptExpanded
140
141// Calls the engine groups draw their result inside their own row; any other call has a ToolResult row.
142const groupedCallIds = new Set<string>()
143
144// The theme's dim grey as a colour: the engine lifts dimColor across a whole group while the pointer is on it.
145const FAINT = { color: 'inactive' }
146
147const isOpenCall = atom({ plugin: 'tool-lines', key: 'isOpen' } as const, false)
148
149export const register: Register = on => {
150 on('ui.render', { component: 'UserMessage', props: { origin: { kind: 'composer' } } }, async ($, e, next) => {
151 if (e.surface === 'terminal' && e.props.isExpanded !== isTranscriptExpanded) {
152 isTranscriptExpanded = e.props.isExpanded
153 $.ui.invalidate('ui.render')
154 }
155 if (!isCompact(e.surface)) return next(e)
156 const { Box } = $.ui.resolve(e)
157 return Box({ flexDirection: 'column', marginBottom: 1, children: [await next(e)] })
158 })
159
160 on('ui.render', { component: 'ToolUse' }, async ($, e, next) => {
161 if (!isCompact(e.surface)) return next(e)
162 const { Box, Button, Text } = $.ui.resolve(e)
163 const isOpenHere = memberOf(isOpenCall, e)
164 const isOpen = await read($, isOpenHere)
165 const toggle = () => void update($, isOpenHere, wasOpen => !wasOpen)
166 const line = lineFor(e.props, e.viewport?.columns ?? UNMEASURED_TERMINAL_COLUMNS, isOpen)
167 const metaStyle = e.props.isErrored ? { color: 'error' } : FAINT
168
169 // Every glyph of a row is a Button: a click outside one reaches the engine's group toggle, which shifts the rows.
170 const dotColumn = Box({
171 minWidth: DOT_COLUMN_WIDTH,
172 flexShrink: 0,
173 children: [
174 Button({
175 key: 'dot',
176 plain: true,
177 onPress: toggle,
178 children: [Text({ color: dotColor(e.props), children: ['●'] })],
179 }),
180 ],
181 })
182 const summary = Button({
183 key: 'summary',
184 plain: true,
185 onPress: toggle,
186 children: [
187 Text({
188 wrap: 'wrap',
189 children: [
190 Text({ ...FAINT, children: [TOOL_CALL_PREFIX] }),
191 Text({ bold: true, children: [line.tool] }),
192 `(${line.subject})`,
193 ...(line.meta === '' ? [] : [Text({ ...metaStyle, children: [` - ${line.meta}`] })]),
194 ],
195 }),
196 ],
197 })
198
199 const hasInlineResult = isOpen && groupedCallIds.has(e.props.tool_use_id)
200 const resultText = hasInlineResult
201 ? ((await answeredTextOf(e.props.tool_use_id, () => $.session.messages())) ?? storedTextOf(e.props))
202 : ''
203 const gutter = Button({ key: 'gutter', plain: true, onPress: toggle, children: [Text({ ...FAINT, children: ['⎿'] })] })
204 // One Button per line: the pointer inverts only the first row of a Button whose text holds a newline.
205 const resultRows = (resultText === '' ? [] : resultLinesOf(resultText)).map((resultLine, index) =>
206 Box({
207 flexDirection: 'row',
208 children: [
209 Box({ minWidth: RESULT_GUTTER_WIDTH, flexShrink: 0, children: index === 0 ? [gutter] : [] }),
210 Box({
211 flexShrink: 1,
212 children: [
213 Button({
214 key: `result-${index}`,
215 plain: true,
216 onPress: toggle,
217 // A blank line still takes its row.
218 children: [Text({ ...FAINT, wrap: 'wrap', children: [resultLine === '' ? ' ' : resultLine] })],
219 }),
220 ],
221 }),
222 ],
223 }),
224 )
225
226 const textColumn = Box({ flexShrink: 1, flexDirection: 'column', children: [summary, ...resultRows] })
227 return Box({ flexDirection: 'row', marginLeft: 2, children: [dotColumn, textColumn] })
228 })
229
230 on('ui.render', { component: 'ToolGroup' }, async ($, e, next) => {
231 if (!isCompact(e.surface)) return next(e)
232 for (const call of e.props.calls) {
233 if (call.tool_use_id !== undefined) groupedCallIds.add(call.tool_use_id)
234 }
235 const unfoldedGroup = { ...e.props, isExpanded: true }
236 return next({ ...e, props: unfoldedGroup })
237 })
238
239 on('ui.render', { component: 'ToolResult' }, async ($, e, next) => {
240 if (!isCompact(e.surface)) return next(e)
241 const { Box } = $.ui.resolve(e)
242 if (!(await read($, memberOf(isOpenCall, e)))) return Box({})
243 // The engine's own result (an Edit's diff) is the richest; indented, it sits under the line's text.
244 return Box({ marginLeft: 2, children: [await next(e)] })
245 })
246}
247types/index.d.ts 6 lines1declare module 'claude-code' {
2 interface PluginState {
3 'tool-lines': { isOpen: StateFamily<boolean> }
4 }
5}
6