perf(skills): cut the tokens and start-up time every agent pays

Requirement 071, from the skeptic audit picks.

Output: radio.py show groups older rows per peer and class into one
line each (7 days 143,520 -> 3,229 bytes); rasci.py show is narrower
(7,081 -> 2,915 bytes) and archives tasks ended over 7 days ago into
rasci-archive.json, still listed by get, --all, artifacts and tools
and revived by any command that names them; make test runs quiet.

Hooks: hooks register as python3 -I -S (site import skipped), the
hook paths of watch, queue, radio, graph and log skip argparse, and
traceback, tempfile, configparser, tomllib, statistics and urllib load
lazily; councilroot.guard() serves watch and radio; the dream
reminder exits before Python when no row can be on. pre-bash 68 ms,
post-bash 50 ms.

Hub: names.json keeps only the entries every lookup needs (11.6 MB ->
11 KB, lookups identical) and phrasing is cached; a state build takes
55 instead of 104 ms.

Context: the commit-chain skills shrink from 3,330 to 1,192 words with
their names kept, details moved to chain.md and reference.md files read
on demand; descriptions capped at 25 words; .ignore and .rgignore keep
state and worktrees out of searches. overhead.py of
kvb-check-efficiency measures hook and script cost per call.

🎯 Fix: 93 %
💥 Break: 5 %
💸 Tokens: 107 %
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 83
🚦 Gate: ⚠️ tokens 107 % > 100 (on-demand reference files; resident text and daily cost fall): operator approved the commit

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-27 10:49:30 +00:00
1 parent 5c969be21c
commit 9403e17e97
53 files changed
+1219 -522

No files matched your search

+5 -2
View File
@@ -61,7 +61,9 @@ for (const [plugin, marketplace] of Object.entries(RETIRED_PLUGINS)) {
}
data.env = data.env || {};
if (!data.env.CLAUDE_CODE_AUTO_COMPACT_WINDOW) data.env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = "300000";
const PYTHON = "/usr/bin/python3 -I";
// Trip-wire: -S skips the site import (a third of a hook's start-up); the skill scripts import the standard library only.
const PYTHON = "/usr/bin/python3 -I -S";
const SITED = "/usr/bin/python3 -I";
const ABSOLUTE = { python3: PYTHON, bash: "/usr/bin/bash" };
require("./council-deny").withCouncilDeny(data);
@@ -148,7 +150,8 @@ for (const [script, event, matcher, sub, extra] of SCRIPT_HOOKS) {
const file = JSON.stringify(path.join(path.dirname(settingsPath), "skills", ...script.split("/")));
// Trip-wire: python3 on a missing file exits 2, which blocks every prompt or tool call; the test makes it exit 1.
const command = `[ -f ${file} ] && ${PYTHON} -c ${AS_MAIN} ${file} ${sub}`;
const legacy = [`${PYTHON} ${file} ${sub}`, `[ -f ${file} ] && ${PYTHON} ${file} ${sub}`];
const legacy = [SITED, PYTHON].flatMap((python) => [`${python} ${file} ${sub}`, `[ -f ${file} ] && ${python} ${file} ${sub}`])
.concat(`[ -f ${file} ] && ${SITED} -c ${AS_MAIN} ${file} ${sub}`);
const owner = data.hooks[event].find((entry) => (entry.hooks || []).some((hook) => ran(hook, script, sub)));
if (owner) {
const registered = owner.hooks.find((hook) => ran(hook, script, sub));