/logbook:metricsfrom Logbook
Use when asked how logbook is performing, or how its threads, tool calls, state-document edits, pickups after a compaction or /clear, or update requests went, answered from logbook's own records in the metrics store with DuckDB.
Ships in Logbook. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Logbook writes its metrics to the metrics store. The store root is the value of PLUGIN_METRICS_DIR when it is set and non-empty, otherwise ~/.plugin-metrics. Every block below names the root as the placeholder ; replace it with that folder before running a block.
<root>/plugin=logbook/catalogue.json describes every event and field logbook writes.<root>/plugin=logbook/kind=event/repo=<repo>/<run>.jsonl holds one run's events, one JSON line each.<root>/plugin=logbook/kind=summary/repo=<repo>/<run>.json holds one run's summary line.Logbook's run is one thread, named <slug>.<UTC start as YYYYMMDDTHHMMSSZ>. Its events are tool.call, doc.edit, doc.commit, doc.request, thread.pickup and thread.handover, and its summary is written when the thread is parked, closed, or held at a session's end.
command -v duckdb. When DuckDB is not found, tell the user to install it with brew install duckdb and stop.<root>/plugin=logbook/catalogue.json first. Its purpose and objectives say what logbook must achieve and which fields measure each objective; pick the fields that answer the question from each field's description and reading.duckdb -json. Use glob for this count: read_json fails with No files found when its glob matches nothing, while glob returns 0.Probe:
set TimeZone = 'UTC';
select (select count(*) from glob('<root>/plugin=logbook/kind=event/**/*.jsonl')) as events, (select count(*) from glob('<root>/plugin=logbook/kind=summary/**/*.json')) as summaries;
Present:
create or replace view events as select * from read_json('<root>/plugin=logbook/kind=event/**/*.jsonl', hive_partitioning = true, union_by_name = true);
create or replace view summaries as select * from read_json('<root>/plugin=logbook/kind=summary/**/*.json', hive_partitioning = true, union_by_name = true);
Empty:
create or replace view events as select null::varchar as plugin, null::varchar as kind, null::varchar as repo, null::varchar as run, null::varchar as parent, null::varchar as session, null::timestamptz as ts, null::varchar as event, null::varchar as tool, null::varchar as outcome, null::varchar as refusal_field, null::varchar[] as rules, null::varchar as source where false;
create or replace view summaries as select null::varchar as plugin, null::varchar as kind, null::varchar as repo, null::varchar as run, null::varchar as parent, null::varchar as session, null::timestamptz as ts, null::varchar as status, null::double as lifetime_seconds where false;
duckdb -json in one call whose input is set TimeZone = 'UTC';, the two view lines you chose and then the query, because the views last only as long as that call. Use the catalogue's named queries under queries when one answers the question, or write your own SQL over the events and summaries views, filtered to plugin = 'logbook'.What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/debriefUse at session hand-off to bring the thread's state document up to date and park the thread./fileUse at the start of work to open a new thread and its state document./preflightUse at the start of work to pick up an existing thread and continue it from its state document.Other plugins' skills for the same job
npx claudepluginhub satanshumishra/logbook --plugin logbook