Skip to content

feat(mod): load marker and cached-vs-repo status (#442, #444) - #446

Merged
wasikarn merged 2 commits into
developfrom
claude/mod-version-status-442-444
Oct 4, 2026
Merged

wasikarn merged 2 commits into
developfrom
claude/mod-version-status-442-444

Conversation

@wasikarn

@wasikarn wasikarn commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Refs #442, #444. Both extend the one hooks module, hooks/mod/cost-ledger.ts.

What changed

  • mod: per-session load-proof marker #444, load marker: the first hook call of each module load appends { t, session_id, loaded: true, cli, mh } to the existing cost-ledger.jsonl, not the UI log. If modules are off, no row is written, and that missing row is the signal.
  • cost-report prints module loaded: N of M sessions since the first load marker (<date>), or module loaded: no load marker (...) when there is none. Marker rows are kept out of the ledger sum and out of the no-finite-usd warning.
  • mod: cache-vs-repo version status and stale-skill toast #442, version status: this runs only in an mh checkout (the session root's plugin.json name matches $.plugin.name). On session.start, a $.ui.status line compares the cached version ($.plugin.root) with the repo version. On skill.prompt, a skill whose repo SKILL.md differs from the cached copy gets one $.ui.toast per load. The prompt text passes through unchanged.
  • The observer contract still holds: every handler is wrapped and ends in next(e). With modules off, nothing changes.
  • Docs: docs/reference/cost-ledger-module.md plus one line each in repo-gotchas.md, cost-report's SKILL.md and data-model.md.

Evidence

  • claude plugin test . (CLI 2.1.289): 14 pass (8 new).
  • tests/skills/test-cost-report.sh: 27/27 (4 new; the new checks failed before the report change).
  • claude plugin validate . lists the new calls. The API names were checked against the claude-code.d.ts that 2.1.289 writes.
  • audit: 0 CRIT. gauntlet: all layers passed.

Not done, on purpose

  • No manifest bump, though mod: cache-vs-repo version status and stale-skill toast #442 asks for one. The operator bumps separately.
  • The live claude -p probe was not run. The subagent gate blocks nested sessions. These points are checked against the d.ts only: $.plugin.root is the folder above .claude-plugin/, skill.prompt's skill may or may not carry the mh: prefix (the code handles both), and session.start fires under -p. If any of them is wrong, the feature shows nothing; nothing breaks. The probe steps are in cost-ledger-module.md.

…442, #444)

- cost-ledger.ts writes one {loaded, cli, mh} row per module load to cost-ledger.jsonl
  from the first hook call, so modules-off reads apart from loaded-but-idle (#444).
- In an mh checkout, session.start shows the cached vs repo version via $.ui.status and
  skill.prompt toasts once per skill whose repo SKILL.md differs from the cached copy (#442).
- cost-report prints 'module loaded: N of M sessions' and skips marker rows in the ledger sum.
- Observer contract unchanged: every handler is wrapped and ends in next(e).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant