// PostToolUse hook (matcher: Skill). Appends one line per skill invocation. // Fast, side-effect-only, never throws into the harness. harness=claude. let d = ""; process.stdin.on("data", (c) => (d += c)); process.stdin.on("end", () => { try { const i = JSON.parse(d || "{}"); if (i.tool_name !== "Skill") return; const ti = i.tool_input || {}; const sk = ti.skill || ti.command || ""; if (!sk) return; const fs = require("fs"); const os = require("os"); const logPath = require("path").join(os.homedir(), ".agents/registry/usage.log"); const line = new Date().toISOString() + "\tclaude\t" + sk + "\n"; fs.appendFileSync(logPath, line); } catch (e) { /* never break the tool pipeline */ } });