ModsCode / Claude Code Mods / Ranking / lead
lead
Peer cards and owner-confirmed fleet actions with ledger evidence.
What it does
- Draws a pane
- Adds /aktionen
- Hooks session.start
- Starts processes
Good points
- No network calls
- Small: 243 lines
- Written in TypeScript
- 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 lead by navigator contributors (pane), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/kanevry-lead/
// 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 pane: open it with $.ui.open({ id: 'my-pane', title: "‹t›" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const art = '…'
const kurz = '…'
const projekt = '…'
const iid = '…'
const head = '…'
const main = '…'
const fehlt = '…'
const t = '…'
return (
<Box flexDirection="column" paddingX={1}>
<Text>
Ungültige Sprache; Plugin-Default wird verwendet (de/en).
</Text>
<Box flexDirection="column">
<Text>
Unbekannter Absender
{" "}
(Selbstauskunft)
{" · "}
{art}
</Text>
<Text>
{kurz}
</Text>
<Text>
{`${projekt} !${iid} · head ${head} · main ${main}`}
</Text>
<Text>
Messung nicht verfügbar; fehlt:
{" "}
{fehlt}
</Text>
<Button label={`${t}`} />
<Text>
Absender fehlt; kein Versand möglich.
</Text>
<Text>
Anweisung, keine Freigabe (ADR-002)
</Text>
</Box>
<Text />
</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.
mods/lead/hooks/register.tsx lines 59–177 · Pane
on('ui.render', async ($, e, next) => {
const pane = e.component === 'Pane' && e.requestId === 'aktionen';
const peer = e.component === 'UserMessage' && istPeer(e.props.origin.kind) && !e.props.isExpanded;
if (!pane && !peer) return next(e);
if (!spracheGelesen) {
const gelesen = await spracheLesen($, options.language);
sprache = gelesen ?? (options.language === 'en' ? 'en' : 'de');
sprachHinweis = gelesen === undefined;
spracheGelesen = true;
reason = t('Owner-Entscheid', 'Owner decision');
status = t('Stopp: nicht gemessen', 'Stop: not measured');
}
const card = e.component === 'UserMessage' ? karte(e.props.text, sprache) : null;
const sender = e.component === 'UserMessage' ? e.props.from?.name : undefined;
// The body and sender bind measurement and confirmation to this exact card.
const key = pane ? 'pane' : JSON.stringify([e.requestId, sender, e.component === 'UserMessage' ? e.props.text : '']);
const sid = await $.session.id();
const table = $.ui.resolve(e);
const { Box, Text, Button } = table;
const Input = e.surface === 'mobile' ? null : $.ui.resolve(e).Input;
const click = async (action: Aktion) => {
if (busy) return;
if (action.send && measurements.get(key) !== action.send.text) return;
// Lock before the first await; even concurrent handlers cannot double-execute.
busy = true;
try {
const now = await $.clock.now();
const step = druck(states.get(key) ?? { phase: 'bereit' }, action, now);
states.set(key, step.zustand);
if (!step.ausfuehren) {
messages.set(key, t(`Innerhalb 30 s erneut drücken. Folge: ${action.folge}\nargv: ${JSON.stringify(action.argv)}`, `Press again within 30 s. Effect: ${action.folge}\nargv: ${JSON.stringify(action.argv)}`));
$.clock.after(30_000, () => {
if (states.get(key) === step.zustand) {
states.delete(key);
messages.set(key, t('Bestätigung verfallen; keine Aktion ausgeführt.', 'Confirmation expired; no action executed.'));
$.ui.invalidate('ui.render');
}
});
return;
}
messages.set(key, t('Aktion läuft …', 'Action running …'));
$.ui.invalidate('ui.render');
let output = '';
let incompleteOutput = false;
if (action.name === 'fenster-messen') measurements.delete(key);
if (action.send) {
// Consume before dispatch: a failed receipt must never cause a resend.
measurements.delete(key);
const sent = await $.session.send(action.send);
if (!sent.isDelivered) throw new Error(t(`Versand fehlgeschlagen: ${sent.reason}`, `Delivery failed: ${sent.reason}`));
} else {
const result = await $.process.run(action.argv, { timeoutMs: 120_000 });
if (result.exitCode !== 0) throw new Error(`CLI Exit ${result.exitCode}: ${result.stderr}\n${result.stdout}`);
output = result.stdout;
incompleteOutput = action.name === 'fenster-messen' && (result.isStdoutTruncated || !output.trim());
}
const digest = await crypto.subtle.digest('SHA-256', new Uint8Array(new TextEncoder().encode(JSON.stringify(action.argv))).buffer);
const hash = [...new Uint8Array(digest)].map(b => b.toString(16).padStart(2, '0')).join('');
const receipt = await $.process.run([cli, 'ledger', 'append', '--kind', 'notiz', '--content', JSON.stringify(beleg(action, hash, sid)), '--json']);
if (receipt.exitCode !== 0) throw new Error(t(`Aktion ausgeführt, Ledger fehlgeschlagen (Exit ${receipt.exitCode}): ${receipt.stderr}`, `Action executed, ledger failed (exit ${receipt.exitCode}): ${receipt.stderr}`));
let ledger: unknown;
try { ledger = JSON.parse(receipt.stdout); } catch { throw new Error(t('Aktion ausgeführt, Ledger fehlgeschlagen: Beleg unlesbar', 'Action executed, ledger failed: unreadable receipt')); }
if (receipt.isStdoutTruncated || typeof ledger !== 'object' || ledger === null ||
!('sequenz' in ledger) || typeof ledger.sequenz !== 'number' || !Number.isSafeInteger(ledger.sequenz) || ledger.sequenz < 1 ||
!('entry_sha256' in ledger) || typeof ledger.entry_sha256 !== 'string' || !/^[a-f0-9]{64}$/.test(ledger.entry_sha256)) {
throw new Error(t('Aktion ausgeführt, Ledger fehlgeschlagen: Beleg unlesbar', 'Action executed, ledger failed: unreadable receipt'));
}
const ledgerId = `(Ledger #${ledger.sequenz}, ${ledger.entry_sha256.slice(0, 12)})`;
if (incompleteOutput) throw new Error(t(`CLI Exit 0, ${ledgerId}, aber Messausgabe leer oder gekürzt; kein ZEICHEN verfügbar.`, `CLI exit 0, ${ledgerId}, but measurement empty or truncated; no ZEICHEN available.`));
const appended = await $.session.append({ message: { type: 'system', content: [{ type: 'text', text: t(`Owner hat per Knopf ausgelöst: ${action.folge} ${ledgerId}`, `Owner triggered by button: ${action.folge} ${ledgerId}`) }] } });
if (appended.deny !== undefined) throw new Error(t(`Systemzeile verweigert: ${appended.deny}`, `System message refused: ${appended.deny}`));
if (action.name === 'fenster-messen') measurements.set(key, output);
messages.set(key, `${action.folge} ${ledgerId}${output ? '\n' + output : ''}`);
if (action.name.startsWith('stopp-')) {
const r = await $.process.run([cli, 'stop', 'status', '--json']);
status = r.exitCode === 0 ? t(`Stopp-Status: ${r.stdout}`, `Stop status: ${r.stdout}`) : t(`Stopp nicht messbar: Exit ${r.exitCode}`, `Stop not measurable: exit ${r.exitCode}`);
}
} catch (error) {
messages.set(key, t(`Fehler: ${String(error)}. Nicht automatisch wiederholen; Zustand prüfen.`, `Error: ${String(error)}. Do not retry automatically; check the state.`));
} finally {
if (states.get(key)?.phase === 'laeuft') states.delete(key);
busy = false;
$.ui.invalidate('ui.render');
}
};
const change = (field: 'reason' | 'id' | 'decision', value: string) => {
if (field === 'reason') reason = value;
if (field === 'id') queueId = value;
if (field === 'decision') decision = value;
states.delete('pane'); messages.delete('pane');
$.ui.invalidate('ui.render');
};
const answer = queue(cli, sid, queueId, decision, sprache);
const measured = measurements.get(key);
const zeigeSprachHinweis = pane && sprachHinweis && !sprachHinweisGezeigt;
if (zeigeSprachHinweis) sprachHinweisGezeigt = true;
return <Box flexDirection="column" paddingX={1}>
{zeigeSprachHinweis && <Text>{t('Ungültige Sprache; Plugin-Default wird verwendet (de/en).', 'Invalid language; using the plugin default (de/en).')}</Text>}
{pane ? (Input ? <Box flexDirection="column">
<Text>{status}</Text>
<Input key="reason" label={t('Grund', 'Reason')} value={reason} onInput={v => change('reason', v)} onSubmit={v => change('reason', v)} />
<Button key="stop-set" label={t('Stopp setzen', 'Set stop')} onPress={() => click(stopp(cli, sid, true, reason, sprache))} />
<Button key="stop-clear" label={t('Stopp aufheben', 'Clear stop')} onPress={() => click(stopp(cli, sid, false, reason, sprache))} />
<Input key="queue-id" label={t('Owner-Queue-ID', 'Owner queue ID')} value={queueId} onInput={v => change('id', v)} onSubmit={v => change('id', v)} />
<Input key="decision" label={t('Entscheid', 'Decision')} value={decision} onInput={v => change('decision', v)} onSubmit={v => change('decision', v)} />
{answer ? <Button key="queue-close" label={t('Owner-Queue beantworten', 'Answer owner queue')} onPress={() => click(answer)} /> : <Text>{t('ID und Entscheid fehlen oder sind ungültig.', 'ID and decision are missing or invalid.')}</Text>}
<Button key="close" label={t('Schließen', 'Close')} onPress={() => { states.delete(key); return $.ui.close({ id: 'aktionen' }); }} />
</Box> : <Text>{t('Diese Zeichenfläche bietet keine Eingabefelder; /aktionen am Terminal öffnen.', 'This surface has no input fields; open /aktionen in the terminal.')}</Text>) : <Box flexDirection="column">
<Text>{sender ?? t('Unbekannter Absender', 'Unknown sender')} {t('(Selbstauskunft)', '(self-reported)')} · {card?.art}</Text>
<Text>{card?.kurz}</Text>
{card?.art === 'ANSAGE' && card.felder && <Text>{`${card.felder.projekt} !${card.felder.iid} · head ${card.felder.head.slice(0, 12)} · main ${card.felder.main.slice(0, 12)}`}</Text>}
{card?.art === 'ANSAGE' && (card.felder ? <Button key="measure" label={t('Fenster messen', 'Measure merge window')} onPress={() => click(fenster(cli, card.felder!, sprache))} /> : <Text>{t('Messung nicht verfügbar; fehlt:', 'Measurement unavailable; missing:')} {card.fehlt}</Text>)}
{card?.art === 'ANSAGE' && measured && sender && <Button key="send" label={t('ZEICHEN senden', 'Send ZEICHEN')} onPress={() => click(zeichen(sender, measured, sprache))} />}
{card?.art === 'ANSAGE' && !sender && <Text>{t('Absender fehlt; kein Versand möglich.', 'Sender missing; delivery unavailable.')}</Text>}
<Text>{t('Anweisung, keine Freigabe (ADR-002)', 'Instruction, not approval (ADR-002)')}</Text>
</Box>}
<Text>{messages.get(key) ?? ''}</Text>
</Box>;
});Licence text (MIT)
MIT License Copyright (c) 2026 Kanevry 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: Pane (panel), Add a slash command
What its code calls
runs programsenv vars
What its code shows
Read from the source at commit 2c119c8e855e. 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.mods/lead/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.4 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.no network |
| Programs | Whether every program it starts is named in the code and is not a shell, an interpreter or a network tool.mods/lead/hooks/register.tsx:51 a program named at run time; mods/lead/hooks/register.tsx:110 a program named at run time; mods/lead/hooks/register.tsx:117 a program named at run time; mods/lead/hooks/register.tsx:133 a program named at run time |
| 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 and reaches another session |
| 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 aktionen |
| 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: command.run (aktionen) · also: session.start, ui.render · timers: 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: NAVIGATOR_LANG |
| 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.another session; the conversation (a row the model reads) |
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 Kanevry/lead-session-orchestrator/plugin install lead@navigator-mods/reload-pluginsThis installs the marketplace's latest commit, which may not be the one read here (2c119c8e855e). 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/Kanevry/lead-session-orchestratorgit -C lead-session-orchestrator checkout 2c119c8e855e335f3c8e9d608be13ca18962c91fclaude plugin validate lead-session-orchestrator/mods/leadclaude --plugin-dir lead-session-orchestrator/mods/leadThe 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 or ChatGPT about it
With ModsCode added as a connector, Claude or ChatGPT can read this mod's code, what it reaches and how its controls are wired, and build on them. Ask it like this:
Read the ModsCode mod "kanevry-lead" with its code and make me one like itAdd the ModsCode MCP to Claude or ChatGPT
Similar mods
- code-modernizationAnthropic★ 37,809
- lcu-approveLCU★ 1,032
- ai-maestro-secrets23blocks-OS★ 820
- filetreeKurt Buhler★ 173
- pulse-ccfatwang2★ 113
- great-ctoAlexander Velikiy★ 103
More from this repository
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/kanevry-lead/)