ModsCode / Claude Code Mods / Ranking / penny-patrol
penny-patrol
Meters above the prompt: the context window, the session's spend and what is left of your limits, a small mascot that walks them while Claude works, and a line under them with something to learn, something to smile at or something to feel …
What it does
- Draws a band above the prompt
- Watches tool calls and can refuse them
- Hooks classic.PostToolUse, classic.Stop, classic.SubagentStop, session.compact and 5 more
- Calls the network
Good points
- Starts no processes
- 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 penny-patrol by Kumar Aman (band), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/kumaraman110-penny-patrol/
// 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 } = $.ui.resolve(e)
const labels = '…'
const labels2 = '…'
const labels3 = '…'
return (
<Box flexDirection="column" paddingX={1}>
<Box flexDirection="row">
<Text dimColor>
{labels}
</Text>
</Box>
<Box flexDirection="row">
<Text dimColor>
{labels2}
</Text>
</Box>
<Box flexDirection="row">
<Text dimColor>
{labels3}
</Text>
</Box>
{await next(e)}
</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.
penny-patrol/hooks/penny-patrol.ts lines 740–748 · Band
on('ui.render', { component: 'AbovePrompt' }, ($, e, next) => {
if (isHidden || reading === null || e.props.hasSurvey) {
return next(e)
}
const { Box, Text, Link } = $.ui.resolve(e)
return band(Box, Text, Link, reading, e.props.bodyColumns, e.props.maxRows, e.surface === 'terminal')
})penny-patrol/hooks/penny-patrol.ts lines 1357–1452 · Band
function band(Box: Box, Text: Text, Link: Link, now: Reading, columns: number, maxRows: number, isTerminal: boolean): RenderElement {
// paddingX takes two cells.
const inner = Math.max(1, columns - 2)
const money = ledger !== null && ledger.seen > 0 ? ledger : null
const bill = money ? billOf(money) : null
// The steps are this session's own; the month's spend is every session's, as the budget is.
const mine = calendar(nowMs, [days])
const gauges = gaugesOf(calendar(nowMs, everyDays()).month.usd, money !== null)
const free = now.segments.reduce((sum, segment) => sum + (segment.kind === 'free' ? segment.tokens : 0), 0)
// The bar is the room there is before compaction: what is in use, then what is free. The buffer is no
// room, and no part of the bar.
const isTight = free < (now.used + free) * TIGHT_SHARE
const context = now.segments.filter(segment => segment.kind !== 'buffer').map(segment => ({ ...partOf(segment), isTight }))
const contextFacts = [`${now.percent}%`, `${short(now.used)} / ${short(now.window)}`, free > 0 ? `${short(free)} free` : '']
// With the plan's windows known, the cost is what was spent in each of them and in the plan's month,
// each beginning again when its own does; the bar is the month's. The whole session is the ledger's
// to say.
const periods = money ? periodsOf(money) : []
const period = periods.find(each => each.isPlan) ?? periods[0]
const split = bill ? spendParts(period ? { main: period.main, agents: period.agents, folded: 0 } : bill) : []
// A part that spent nothing has no cell of the bar, but its entry under it.
const spend = split.filter(part => part.weight > 0)
const costFacts = money && bill
? [...(period ? periods.map(each => `${each.name} ${money$(each.total)}`) : [money$(bill.total)]), promptOf(money, bill)]
: []
if (inner >= FULL_COLUMNS) {
const room = Math.min(TEXT_MAX, inner - GAP - Math.floor(inner * TRACK_SHARE))
const track = inner - GAP - room
// What a line may say after its label.
const width = room - LABEL
const model = lineOf('Model', [now.model, effort === null ? '' : `${capital(effort)} effort`], width, true)
const steps = lineOf('Steps', (['today', 'week', 'month', 'year'] as const).map(period => `${capital(period)} ${count(mine[period].steps)}`), width, true)
const contextBar: Section = {
cells: cellsOf(context, track),
beside: lineOf('Context', contextFacts, width, false),
above: [],
below: rows => {
// The free run needs no entry: the line beside the bar says what is free.
const chips = now.segments.filter(segment => segment.kind === 'used').map(segment => chipOf(partOf(segment), short(segment.tokens)))
const sent = lineOf('', sentOf(now.last), width, true)
// A legend that fits on one line leaves the other to the last request.
const tight = sent.runs.length > 0 && rows > 1 ? wrapped(chips, width, rows - 1) : null
return tight
? [...tight.map(runs => ({ label: '', runs })), sent]
: legendOf(chips, [], width, rows).map(runs => ({ label: '', runs }))
},
}
// What was spent before tracking is no window's.
const before: Chip[] = bill && bill.before > 0 && !period
? [{ glyph: '', color: undefined, isDim: true, text: `Before tracking ${money$(bill.before)}`, weight: bill.before }]
: []
const costBar: Section[] = money && bill
? [{
cells: cellsOf(spend, track),
beside: lineOf('Cost', costFacts, width, false),
above: [],
below: rows => legendOf(split.map(part => chipOf(part, money$(part.weight))), before, width, rows).map(runs => ({ label: '', runs })),
smiles: COST_SMILES,
}]
: []
// A limit bar says what it has to say itself, so the line beside it is another's. The first limit
// window stands first, the model beside it; the other limits stand last, the steps beside the first
// of them (with one window alone, under it). With no window the model and the steps stand over the
// first bar.
const first = gauges.find(gauge => gauge.isWindow)
const rest = gauges.filter(gauge => gauge !== first)
const limit = (gauge: Gauge, beside: Line, under: Line[]): Section =>
({ cells: wordedCells(gauge, track), beside, above: [], below: () => under, isLimit: true })
const sections: Section[] = [
...(first ? [limit(first, model, rest.length > 0 ? [] : [steps])] : []),
contextBar,
...costBar,
...rest.map((gauge, i) => limit(gauge, first && i === 0 ? steps : { label: '', runs: [] }, [])),
]
const header = first ? [] : [model, steps]
const line = lineRow(Box, Text, Link, inner, isTerminal)
// With fewer rows than all of it needs, the line gives way first; then the limit bars give up the free
// rows over them, and the mascot keeps to the other bars; only then does the scene.
for (const isLow of gauges.length > 0 ? [false, true] : [false]) {
const rows = scene(Box, Text, isLow ? sections.map(section => (section.isLimit === true ? { ...section, isLow: true } : section)) : sections, header, track)
for (const children of line ? [[...rows, line], rows] : [rows]) {
if (children.length <= maxRows) {
return Box({ flexDirection: 'column', paddingX: 1, children })
}
}
}
}
const bars = [{ parts: context, facts: contextFacts }, ...(money ? [{ parts: spend, facts: costFacts }] : [])]
return Box({ flexDirection: 'column', paddingX: 1, children: compact(Box, Text, inner, bars, gauges) })
}penny-patrol/hooks/penny-patrol.ts lines 1545–1581 · Band
function compact(Box: Box, Text: Text, inner: number, bars: Array<{ parts: Part[]; facts: string[] }>, gauges: Gauge[]): RenderElement[] {
const aside = (text: string): string => (text === '' ? '' : `${' '.repeat(GAP)}${text}`)
const labels = bars.map(bar => aside(fit(bar.facts, inner - MIN_BAR - GAP)))
const labelWidth = Math.max(0, ...labels.map(label => label.length))
const rows = bars.map((bar, i) =>
Box({
flexDirection: 'row',
children: [
...runsOf(Text, cellsOf(bar.parts, inner - labelWidth)),
...(labelWidth > 0 ? [Text({ dimColor: true, children: (labels[i] ?? '').padStart(labelWidth) })] : []),
],
}),
)
if (gauges.length > 0) {
const each = Math.floor((inner - (gauges.length - 1) * GAP) / gauges.length)
rows.push(Box({
flexDirection: 'row',
columnGap: GAP,
children: gauges.map(gauge => {
const name = `${gauge.name} `
const label = [gauge.label, gauge.short].map(aside).find(text => each - name.length - text.length >= MIN_BAR) ?? ''
return Box({
flexDirection: 'row',
children: [
Text({ dimColor: true, children: name }),
...runsOf(Text, cellsOf(gauge.parts, Math.max(0, each - name.length - label.length))),
...(label === '' ? [] : [Text({ dimColor: true, children: label })]),
],
})
}),
}))
}
return rows
}penny-patrol/hooks/penny-patrol.ts lines 2429–2449 · Band
function runsOf(Text: Text, cells: Cell[]): RenderElement[] {
const runs: RenderElement[] = []
let start = 0
for (let i = 1; i <= cells.length; i += 1) {
const from = cells[start]
const to = cells[i]
if (from) {
const paint = paintOf(from)
const next = to ? paintOf(to) : null
if (next === null || next.backgroundColor !== paint.backgroundColor || next.color !== paint.color || next.dimColor !== paint.dimColor) {
runs.push(Text({ ...paint, children: cells.slice(start, i).map(cell => cell.glyph).join('') }))
start = i
}
}
}
return runs
}Licence text (MIT)
MIT License Copyright (c) 2026 Kumar Aman 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: Band above the prompt, Deny a tool call
What its code calls
networkwrites filesenv varsdrives Claudetool calls
What its code shows
Read from the source at commit b78c746f1244 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.penny-patrol/hooks/penny-patrol.ts |
| 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.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.penny-patrol/hooks/penny-patrol.ts:1054 fetch(feed.url(pick)) |
| Programs | Whether every program it starts is named in the code and is not a shell, an interpreter or a network tool.starts no programs |
| 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 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 |
| 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.adds command ? |
| 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, classic.Stop, classic.SubagentStop, command.run · reads: classic.PostToolUse · also: session.start, session.measure, turn.start, turn.complete (+3) · timers: clock.every, clock.after |
| 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: HOME, USERPROFILE; files: …/days, …/… |
| 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: …/… |
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 Kumaraman110/penny-patrol/plugin install penny-patrol@penny-patrol/reload-pluginsThis installs the marketplace's latest commit, which may not be the one read here (b78c746f1244). 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/Kumaraman110/penny-patrolgit -C penny-patrol checkout b78c746f124469c9f2c9e575bab2b43e68fc3f14claude plugin validate penny-patrol/penny-patrolclaude --plugin-dir penny-patrol/penny-patrolThe 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 "kumaraman110-penny-patrol" with its code and make me one like itSearch them from Claude: the MCP connector
Similar mods
- blast-radiusdeepseek-ai★ 247,289
- replay-theaterdeepseek-ai★ 247,289
- code-modernizationAnthropic★ 37,653
- seo-cockpitAgrici Daniel★ 18,364
- next-stepsThariq Shihipar★ 4,505
- lean-ctxThinkery / Yves Gugger★ 3,872
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/kumaraman110-penny-patrol/)