SLOPSHOPPER

readable-width

Caps reply and prompt text at 80 columns while code blocks and tables keep the full width, and highlights your own prompts.

spinnerrows
v1.2.0no licenseupdated 2026-10-23Tvrtk0/claude-code-mods/readable-width
A shopper browsing a rack in a slop shop
Preview · a replayed session in a sandbox
claude · ~/work/app · readable-width
╭───────────────────────────────────────────────────────╮ │ ❯ fix the failing auth test and add an audit log call │ ╰───────────────────────────────────────────────────────╯ ⏺ Read(src/auth.ts) ⎿ Read 6 lines ⟨Claude Code's own drawing⟩ ⏺ Bash(bun test) ⎿ 3 pass, 1 fail ╭─────────────────────────────────────────────────────────────────────╮ │ Done. I made refresh reject expired claims and added an audit call. │ ╰─────────────────────────────────────────────────────────────────────╯ ✻ Worked… ✻ Thinking… ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── › ? for shortcuts

Draws

Spinner
✻ Thinking…
Turn line
✻ Worked…
Your message
╭───────────────────────────────────────────────────────╮ │ ❯ fix the failing auth test and add an audit log call │ ╰───────────────────────────────────────────────────────╯
Claude's reply
╭─────────────────────────────────────────────────────────────────────╮ │ Done. I made refresh reject expired claims and added an audit call. │ ╰─────────────────────────────────────────────────────────────────────╯
Tool row
⟨Claude Code's own drawing⟩
Command output
⟨Claude Code's own drawing⟩
README

local-mods

Personal Claude Code mods for a calmer, more readable terminal.

ModWhat it does
readable-widthDraws each piece of a reply in a grey rounded card, as wide as its longest line and wrapped at 80 columns; tables and code blocks that name a language keep the full width; an unlabelled or text block wraps like prose. Your prompts are bold and accent-colored, in a rounded accent-colored bubble as wide as their longest line, with a blank line above each message.
usage-metersThe bottom of the band above the prompt, under the other mods' buttons: ctx, 5h and 7d meters in one rounded frame. Each bar runs teal to green to yellow to red along its length, so a fuller bar reaches warmer colors; 5h and 7d also show the time left until they reset (2h 16m, 3d 4h). The pointer on a meter shows a card over the buttons: the context's tokens and the session's cost, or when a limit resets (today 18:00, Fri 16:00).
tool-logFolds tool calls and their results in the chat into a ◆ N tools line, one per run of calls with no text between them, and keeps them in a side log grouped by prompt. Toggle it with the framed ☰ panel button, /panel or a key bound to app:toggleDiffPreSession (ctrl+t in ~/.claude/keybindings.json, see below; this replaces the built-in todo list toggle); a click on a chat line opens it on that prompt's steps, until the next prompt or ✕ returns it to live. The chat line also sums file changes and failures (◆ 6 tools · 2 files changed +14 −3 · 1 failed). A turn longer than 30 s ends with a desktop notification. Successful Bash rows expand to show their command, and Edit/Write rows to show their diff. Inside a git repo a framed ± diff button opens the built-in /diff panel. The panel has three tabs: Log, Files (every file changed this session with its diff, new files included) and Agents (subagents with status, time, tool count and their latest step); ☰ panel reopens it on the tab last in view. The active tab is orange, a tab with something new since you last looked is bright, the rest are dim. Replaces the spinner with a minimal one that names the current step, e.g. ⠋ 12s · Reading register.tsx or ⠙ 3s · Thinking.
turn-detailsReplaces the Brewed for 34s · done 1:09 PM line with ◆ details ▸, which folds the turn's duration, finish time, tool calls and model open in place.
ask-modeA read-only mode for when you want an answer, not changes. Beside the panel button, a framed quick │ ask │ deep switch: a click picks a level, a click on the active one turns it off; /quick, /ask and /deep do the same, /ask off leaves any. While on, the frame and the level are yellow beside a 🔒, every prompt carries a brief to answer and report, and every call that may change something is refused, in subagents too: Edit, Write, Bash commands off a read-only list (ls, cat, rg, git log/diff/status/show, gh pr view…; redirects and command substitution included), MCP tools whose name does not read (send, create, update…). quick answers briefly on Haiku 5.5 at low effort, ask investigates on your model, deep analyzes at max effort on Opus. It stays on until you turn it off; a new session starts with it off.

Install

From GitHub:

claude plugin marketplace add Tvrtk0/claude-code-mods
claude plugin install readable-width@local-mods
claude plugin install usage-meters@local-mods
claude plugin install tool-log@local-mods
claude plugin install turn-details@local-mods
claude plugin install ask-mode@local-mods

From a local clone (edits apply after /reload-plugins, no reinstall):

claude plugin marketplace add ~/.claude/mods
claude plugin install readable-width@local-mods
claude plugin install usage-meters@local-mods
claude plugin install tool-log@local-mods
claude plugin install turn-details@local-mods
claude plugin install ask-mode@local-mods

Installed from a local clone, plugins are read straight from the folder.

Develop

claude plugin validate ~/.claude/mods/<mod>
claude plugin test ~/.claude/mods/<mod>

Keyboard shortcut for the panel

A mod cannot add a key of its own, so the ⌃T hint beside ☰ panel borrows an engine action that only the /diff panel handles. Bind any key to it:

{
  "$schema": "https://www.schemastore.org/claude-code-keybindings.json",
  "bindings": [
    { "context": "Global", "bindings": { "ctrl+t": "app:toggleDiffPreSession" } }
  ]
}

ctrl+t hands the panel the keyboard (opening it if needed) and closes it when it already has it. Inside: h/l or 1–3 switch tabs, j/k move between rows (starting from the newest), enter opens one, d/u scroll half a window, g/b jump to the first or last row, esc returns to the prompt and leaves the panel open. The panel scrolls itself, so its tabs and keys stay at the top; Bottom is b, not G: a button hotkey cannot tell shift+g from g.

Source 1 files
hooks/register.tsx 204 lines
1import type {
2  EngineInterface,
3  Register,
4  RenderElement,
5  RenderInput,
6} from 'claude-code'
7
8const WIDTH = 80
9const GUTTER = 2
10// A prompt bubble's frame and padding: a cell each side for both.
11const BUBBLE = 4
12// A reply card's frame: the band's grey.
13const CARD = '#5a5a5a'
14const PADDING = 0
15
16type Segment = { text: string; isWide: boolean }
17
18// A fixed left padding rather than centering: replies stream in at the left
19// edge, so with none the finished block does not move at all. Null when the
20// terminal is too narrow to spare it.
21const marginFor = (columns: number | undefined) =>
22  columns === undefined || columns < 40 ? null : PADDING
23
24// Splits markdown into prose and wide blocks (code fences and tables), so
25// prose wraps at WIDTH while wide blocks keep the room to the right edge.
26function segment(markdown: string): Segment[] {
27  const segments: Segment[] = []
28  let lines: string[] = []
29  let isWide = false
30  let fence: string | null = null
31
32  const flush = () => {
33    const text = lines.join('\n').trim()
34    if (text !== '') segments.push({ text, isWide })
35    lines = []
36  }
37
38  for (const line of markdown.split('\n')) {
39    const trimmed = line.trimStart()
40
41    if (fence !== null) {
42      lines.push(line)
43      if (trimmed.startsWith(fence)) {
44        flush()
45        fence = null
46        isWide = false
47      }
48      continue
49    }
50
51    // Only code keeps the full width: a fence that names a language other
52    // than plain text. An unlabelled or text fence wraps like prose.
53    const opens = /^(`{3,}|~{3,})\s*([\w+#.-]*)/.exec(trimmed)
54    if (opens) {
55      flush()
56      fence = opens[1] ?? '```'
57      const lang = (opens[2] ?? '').toLowerCase()
58      isWide = lang !== '' && !['text', 'txt', 'plain', 'plaintext', 'markdown', 'md'].includes(lang)
59      lines.push(line)
60      continue
61    }
62
63    const isTableRow = trimmed.startsWith('|')
64    if (isTableRow !== isWide) {
65      flush()
66      isWide = isTableRow
67    }
68    lines.push(line)
69  }
70
71  flush()
72
73  return segments
74}
75
76// Moves a row the engine drew to the column's left edge, so the whole
77// transcript reads as one column instead of jumping between edge and center.
78function shift(
79  $: EngineInterface,
80  e: RenderInput,
81  drawn: RenderElement,
82): RenderElement {
83  const columns = e.viewport?.columns
84  const margin = marginFor(columns)
85
86  if (e.surface !== 'terminal' || margin === null || columns === undefined) {
87    return drawn
88  }
89
90  const { Box } = $.ui.resolve(e)
91
92  // The engine refuses its own row under a Box that sets a width, so the
93  // margin alone shifts it.
94  return <Box marginLeft={margin}>{drawn}</Box>
95}
96
97export const register: Register = on => {
98  on('ui.render', { component: 'AssistantMessage' }, ($, e, next) => {
99    const columns = e.viewport?.columns
100    const margin = marginFor(columns)
101
102    if (e.surface !== 'terminal' || margin === null || columns === undefined) {
103      return next(e)
104    }
105
106    const { Box, Markdown } = $.ui.resolve(e)
107    // A card: a grey rounded frame around each piece of the reply. It is as
108    // wide as its widest block: the whole column when a wide block (code, a
109    // table) is in it, else the longest line, at most WIDTH, frame included.
110    const parts = segment(e.props.text)
111    const room = columns - margin
112    const longest = Math.max(0, ...e.props.text.split('\n').map(line => line.length))
113    const width = parts.some(part => part.isWide) ? room : Math.min(WIDTH, room, longest + BUBBLE)
114    const inner = width - BUBBLE
115
116    return (
117      <Box
118        marginLeft={margin}
119        marginTop={1}
120        width={width}
121        flexDirection="column"
122        gap={1}
123        borderStyle="round"
124        borderColor={CARD}
125        paddingX={1}
126      >
127        {parts.map(part => (
128          <Box width={part.isWide ? inner : Math.min(WIDTH - BUBBLE, inner)}>
129            <Markdown text={part.text} />
130          </Box>
131        ))}
132      </Box>
133    )
134  })
135
136  on('ui.render', { component: 'UserMessage' }, async ($, e, next) => {
137    const columns = e.viewport?.columns
138    const margin = marginFor(columns)
139
140    if (
141      e.surface !== 'terminal' ||
142      margin === null ||
143      columns === undefined
144    ) {
145      return next(e)
146    }
147
148    // Rows that are not a typed prompt (attachments, notifications) keep the
149    // engine's drawing and only move to the same left edge.
150    if (e.props.origin.kind !== 'composer') {
151      return shift($, e, await next(e))
152    }
153
154    const { Box, Text } = $.ui.resolve(e)
155    // A bubble: a rounded frame in the accent color, as wide as the prompt's
156    // longest line and at most WIDTH, the frame and its padding included.
157    const longest = Math.max(...e.props.text.split('\n').map(line => line.length))
158    const width = Math.min(WIDTH, columns - margin, longest + GUTTER + BUBBLE)
159
160    return (
161      <Box
162        marginLeft={margin}
163        marginTop={1}
164        width={width}
165        borderStyle="round"
166        borderColor="claude"
167        paddingX={1}
168      >
169        <Box width={GUTTER} flexShrink={0}>
170          <Text bold color="claude">
171            ❯
172          </Text>
173        </Box>
174        <Box width={width - GUTTER - BUBBLE}>
175          <Text bold color="claude">
176            {e.props.text}
177          </Text>
178        </Box>
179      </Box>
180    )
181  })
182
183  on('ui.render', { component: 'ToolUse' }, async ($, e, next) =>
184    shift($, e, await next(e)),
185  )
186
187  // An expanded group unfolds into ToolUse rows, which shift themselves.
188  on('ui.render', { component: 'ToolGroup' }, async ($, e, next) =>
189    e.props.isExpanded ? next(e) : shift($, e, await next(e)),
190  )
191
192  on('ui.render', { component: 'TurnDuration' }, async ($, e, next) =>
193    shift($, e, await next(e)),
194  )
195
196  on('ui.render', { component: 'Spinner' }, async ($, e, next) =>
197    shift($, e, await next(e)),
198  )
199
200  on('ui.render', { component: 'CommandOutput' }, async ($, e, next) =>
201    shift($, e, await next(e)),
202  )
203}
204