ModsCode / Claude Code Mods / Build / Status line
Show a status line from a mod
The statusLine setting runs a shell script to print one line; a mod calls $.ui.status(text) and its own line appears under the prompt (after a ⚠ and the mod's name). It stays until you change it, one line per mod, and you can set it from a hook or a timer.
The smallest form
export function register(on) {
on('turn.complete', async ($, e, next) => {
const git = await $.process.run(['git', 'branch', '--show-current'])
if (git.exitCode === 0) $.ui.status('branch: ' + git.stdout.trim())
return next(e)
})
}
Written by ModsCode with the API of the official docs. Free to use.
Real mods' code (6)
Quoted as is from public mods on GitHub, at the commit ModsCode read. The heading leads to the mod's page (what it does, its good points, what its code reaches); the file name leads to the lines on GitHub.
Check the code yourself before you copy or install it. Mods run unsandboxed, with your permissions. ModsCode does not vouch for what the code does.
ruview-live ruvnet · Terminal + desktop · ★ 97,236
RuView live sensing in Claude Code: /ruview opens a pane beside the transcript with three views: an overview of your CSI nodes (ESP32, Realtek) and 60 GHz radar (rates, loss, RSSI, presence, device-reported vitals, alerts), a live CSI ampl…
on('session.start', async ($, e, next) => {
cliPath = cliPathOf($.plugin.root);
host = {
run: (argv, init) => $.process.run(argv, init),
every: (ms, fn) => $.clock.every(ms, fn),
now: () => $.clock.now(),
open: (pane) => $.ui.open(pane),
close: (pane) => $.ui.close(pane),
status: (text) => $.ui.status(text),
invalidate: () => $.ui.invalidate('ui.render'),
blit: (args) => $.ui.blit(args),
};
await $.command.register({ name: COMMAND, description: 'RuView live sensing pane: CSI nodes, CSI waterfall and radar', argumentHint: '[waterfall|radar|refresh|off]' }).catch(() => undefined);
return next(e);
});MIT licence. Keep its notice when you copy the code. Its code
Licence text (MIT)
MIT License Copyright (c) 2024 rUv 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.
intentic intentic · Terminal + desktop · ★ 77
Cheaper, sharper Claude Code sessions: Bash output trimmed before Claude reads it, a project map and this project's field notes at session start, iq code search and fileq document reading taught, and /intentic:stats to show what each one s…
on("session.start", async ($, e, next) => {
await $.command.register({ name: COMMAND, description: "Show what the intentic plugin saved, in a pane", argumentHint: "[all]" });
if (cleaning) {
try {
const data = await dataDir($);
const session = await $.session.id();
// Resumed or reloaded: what this session already saved is in the ledger. A ledger over the 4 MiB a mod may
// read at once is not an error; the count starts from this point.
tally = data === undefined ? EMPTY : seedFromLedger(await $.fs.read(`${data}/output/filter-stats.jsonl`), session);
} catch {
tally = EMPTY;
}
$.ui.status(statusText(tally));
}
return next(e);
});MIT licence. Keep its notice when you copy the code. Its code
Licence text (MIT)
MIT License Copyright (c) 2026 Artur Kurowski 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.
replay-theater Hamza Zafar · Terminal + desktop · ★ 184
Step through the last turn's file edits, one diff at a time.
on('turn.complete', async ($, e, next) => {
const r = await next(e)
if (!e.agentId && pending.length > 0) {
const steps = pending
pending = []
await update($, replay, () => steps) // one replay per turn
await update($, pos, () => 0)
const count = `${steps.length} edit${steps.length === 1 ? '' : 's'}`
if (!toasted) {
toasted = true
$.ui.toast(`replay-theater: ${count} last turn. Run /replay`)
} else {
showing = true
$.ui.status(`▶ /replay: ${count}`)
}
}
return r
})MIT licence. Keep its notice when you copy the code. Its code
Licence text (MIT)
MIT License Copyright (c) 2026 Hamza Zafar 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.
probe-ui ucsandman · Terminal + desktop · ★ 28
Interactive UI probe: ui.render components, toast, status, log, pane, command register
on("session.start", async ($, e, next) => {
rec("session.start", { e, surfaces: await $.session.surfaces() });
$.ui.log("probe-ui: hooks module loaded (this line is $.ui.log)");
$.ui.status("probe-ui status line");
$.ui.toast("probe-ui toast: hello from a function hook", { timeoutMs: 8000 });
await $.command.register({ name: "probeui", description: "probe-ui: opens the probe pane", immediate: true });
try { await $.ui.open({ id: "probe-pane", title: "PROBE PANE", rows: 6 }); rec("pane", { opened: true }); } catch (err) { rec("pane", { error: String(err) }); }
await flush($);
return next(e);
});MIT licence. Keep its notice when you copy the code. Its code
Licence text (MIT)
MIT License Copyright (c) 2026 Wes Sander 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.
costclaw-live Wes Sander · Terminal · ★ 28
COSTCLAW LIVE: per-request cost, cache decay and repeated-read detection while the session runs, and it serves the Nth identical Read of an unchanged file from its own cache instead of paying for it
on("session.start", async ($, e, next) => {
await bootSession($);
state.serveAfter = await readServeAfter($);
if (options && typeof options.serveAfter === "number" && Number.isSafeInteger(options.serveAfter) && options.serveAfter >= 2) {
state.serveAfter = options.serveAfter;
}
await $.command.register({
name: "costclaw",
description: "COSTCLAW LIVE: findings with evidence, cost cross-check, cache decay. /costclaw serve <n> sets the read-cache threshold.",
argumentHint: "[serve <n>]",
immediate: true,
});
$.ui.status(headline());
$.clock.every(2000, () => tick($));
note($, `⟦costclaw-live⟧ armed · serve-after=${state.serveAfter} · rate card ${PRICING_SNAPSHOT_DATE} · evidence -> ${EVIDENCE_DIR}live-${state.sessionId}.jsonl`);
pushLog("start", { sessionId: state.sessionId, repo: state.repo, serveAfter: state.serveAfter, snapshot: PRICING_SNAPSHOT_DATE });
await flushEvidence($);
return next(e);
});MIT licence. Keep its notice when you copy the code. Its code
Licence text (MIT)
MIT License Copyright (c) 2026 Wes Sander 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.
supervisor Wes Sander · Terminal · ★ 28
SUBAGENT SUPERVISOR: routing-and-budget Mod. Rewrites a spawn's model onto the capability graph instead of denying it, keeps a measured per-agent-type token ledger in $.store, caps tool calls per subagent, and shows live subagents + the la…
on("session.start", async ($, e, next) => {
state.sessionId = await $.session.id();
state.t0 = Date.now();
const stored = await $.store.get(STORE_KEY);
if (stored && typeof stored === "object" && stored.priors) state.priors = stored.priors;
await $.command.register({
name: "supervisor",
description: "SUBAGENT SUPERVISOR: routing log + measured budget ledger (log | ledger | priors | all)",
argumentHint: "[log|ledger|priors|all]",
immediate: true,
});
push({ kind: "session", sessionId: state.sessionId, maxCalls: state.maxCalls, maxCallsSource: state.maxCallsSource, priorTypes: Object.keys(state.priors) });
$.ui.status(statusText());
$.clock.every(2000, () => tick($));
$.ui.log("\u27e6supervisor\u27e7 armed \u00b7 capability graph fable>opus>sonnet>haiku \u00b7 maxSubagentCalls=" + state.maxCalls
+ " (" + state.maxCallsSource + ") \u00b7 log \u2192 " + LOG_DIR + state.sessionId + ".jsonl");
await refreshUsage($);
return next(e);
});MIT licence. Keep its notice when you copy the code. Its code
Licence text (MIT)
MIT License Copyright (c) 2026 Wes Sander 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.
Start building
Put a .claude-plugin/plugin.json ({"name": "my-mod"}) and a hooks/hooks.json ({"modules": ["register.js"]}) in a folder, save the code above as hooks/register.js, and run claude --plugin-dir . to load it for one session. claude plugin validate . lists the events it hooks and the APIs it calls.