observability:session

observability:session is a skill for Claude Code from bendrucker/claude. It costs 81 tokens per session (2,416 once invoked), scanned A, original, MIT.

A skill for searching and analyzing Claude Code conversation history using a DuckDB index, a local database built for analytical queries. It covers session transcripts stored in Claude Code project files and can include imported machines.

In plain words
What is it for?
Use it to answer questions such as how many tokens were used today or what work was done during a particular week.
Why use it?
It avoids manually reading, searching, or processing transcript files when you need to review past Claude Code activity.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Part of the observability plugin — 1 skill shipped together

Good fit Use it to answer questions such as how many tokens were used today or what work was done during a particular week.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bendrucker/claude/session
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add bendrucker/claude --skill session
Clone the repo
git clone --depth 1 https://github.com/bendrucker/claude

Made for: Claude Code.

Or install observability, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for observability:session

README.md
[![agentmods](https://agentmods.dev/badge/skills/bendrucker/claude/session/github.svg)](https://agentmods.dev/skills/bendrucker/claude/session)
Your own site
<a href="https://agentmods.dev/skills/bendrucker/claude/session"><img src="https://agentmods.dev/badge/skills/bendrucker/claude/session/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for observability:session

Your own site · 80×15
<a href="https://agentmods.dev/skills/bendrucker/claude/session"><img src="https://agentmods.dev/badge/skills/bendrucker/claude/session.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,416 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 126
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00081 $0.02416
Opus 5.5 $0.00032 $0.00966
Sonnet 5.5 $0.00016 $0.00483
Haiku 4.5 $0.00008 $0.00242

Measured 7d ago against content hash 2a80adcd9413, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

observability:session scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/observability/skills/session/SKILL.md · 140 lines

How it starts

The opening of the file, as written. The whole thing — 140 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Session

Query Claude Code history from a DuckDB index over the JSONL session files. Report each figure with the named query or SQL that produced it, and any index-health alert or Known Blind Spot that bounds it.

Current session ID: ${CLAUDE_SESSION_ID}

Arguments

  • --refresh: run refresh.ts --refresh before querying. Default: the incremental refresh.
  • --host <label>: scope queries through the host param. Default: every host, including local.
  • --since <date>: pass as the after_date param. Default: the full index.

Database

The index is ~/.local/share/claude-sessions/session.duckdb (under $XDG_DATA_HOME when set). Use that path directly in every query and agent prompt.

Refresh

Run refresh.ts before querying. It imports changed files, drops rows for deleted ones, and prints the DB path. Within --max-age (default 300 seconds) of the last refresh it exits without opening the database. Pass --refresh when the user asks for the latest data.

bun ${CLAUDE_SKILL_DIR}/scripts/refresh.ts

Querying

Open the index with duckdb -readonly -json -init ${CLAUDE_SKILL_DIR}/resources/limits.sql:

  • -readonly: a read-write open blocks refreshes and other readers.
  • -init limits.sql: caps memory and threads. DuckDB's per-process defaults let a few concurrent readers freeze the machine.
  • -json: the default box format truncates to 40 rows, and -csv breaks rows on newlines embedded in command and text.

Parameterize with SET VARIABLE and read with getvariable('key'). Quote reserved words: SET VARIABLE "limit" = 5.

duckdb -readonly -json -init ${CLAUDE_SKILL_DIR}/resources/limits.sql ~/.local/share/claude-sessions/session.duckdb "SELECT model, SUM(output_tokens) FROM message_usage GROUP BY model"
duckdb -readonly -json -init ${CLAUDE_SKILL_DIR}/resources/limits.sql ~/.local/share/claude-sessions/session.duckdb < ${CLAUDE_SKILL_DIR}/resources/queries/stats.sql

scripts/usage.ts renders one session's token-burn timeline (--session <id>), or the top sessions by estimated cost (--days <n>). Its cost estimate comes from public API rates and comes to about 0.97 of billed spend.

Read the full file on GitHub · 140 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago Changed 2a80adcd9413
  2. 10d ago Changed · -14 lines e768ccf6ba06
  3. 11d ago Changed a6774bcfea04
  4. 18d ago Changed a297449eab4a
  5. 20d ago Changed 66dcc22c1bc7
  6. 21d ago Changed · +5 lines · +6 tokens per session 6101409b9744
  7. 22d ago Changed · +1 lines 22fa02bc3875
  8. 24d ago Changed b608c9f59106
  9. 1mo ago Changed · -1 tokens per session e888f6943046
  10. 2mo ago First seen · 148 lines · 76 tokens per session scan A 0f3ae743b484

Subscribe to this mod's changes

observability:session is a skill published in the GitHub repository bendrucker/claude (18 stars, last pushed today), licensed MIT. It adds 81 tokens to every session and 2,416 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

observability:session compared with skills from other repositories

observability:session next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
observability:sessionbendrucker/claudeSkill18todayMITA81Claude Code
reviewSethGammon/CitadelSkill9284d agoMITA17Claude Code
system-upgradealivecontext/aliveSkill132yesterdayMITA55Claude Code
wenlan-handoffwenlan-app/wenlanSkill94todayApache-2.0A43Claude Code, Codex
extract-resumesuxrobGM/jobpilotSkill111todayMITA32Claude Code
pr-reviewnitinjain999/platform-skillsSkill71yesterdayApache-2.0A81Claude Code
read-literaturefirecrawl/firecrawl-claude-pluginSkill2583d agoMITA101Claude Code