DSH 插件市场DeepSeek Harness 社区插件目录

session-watcher

未验证 会话与消息 ★ 6 0.6.0

Local Claude Code context-cost monitor, transcript replay, buckets, and handoff

一句话定位

Local Claude Code context-cost monitor, transcript replay, buckets, and handoff

安装方式

在 DSH 的 web profile 中执行下面的命令;装完刷新页面即可。

$ dsh plugin --profile web add @nomadop/session-watcher@0.6.0

兼容的 DSH 版本

未声明

作者与热度

nomadop · ★ 6 · 更新于 2026-11-05

关于这个插件

Session Watcher

LLM context economics, in your terminal.

Session Watcher treats your prompt cache as inventory — it uses EOQ theory to measure whether the current context is still worth carrying, tracking restart pressure so you can decide when to hand off.

Documentation ·

npm ·

Paper ·

llms.txt

Quick Start ·

Install ·

DSH ·

How It Works ·

Context Buckets ·

Handoff ·

MCP Tools ·

Agents ·

Cite

---

What it does

Session Watcher reads your Claude Code transcript in real time and answers one question: is this session still worth carrying?

Most context tools optimize how you consume tokens — Headroom compresses, /compact shrinks, RTK filters. Session Watcher tracks when the cost curve is drifting, giving you the data to decide. They compose: run any pruning strategy you like, SW measures the cost curve so you can decide when to hand off.

SW reads from the transcript, never writes to it. The dashboard and statusline are pure observers; MCP tools return data for you to act on.

How it works

Your coding agent (Claude Code)
        │  writes session transcript
        ▼
┌───────────────────────────────────────────────────────┐
│  Session Watcher (in-process MCP server)              │
│  ───────────────────────────────────────────────────  │
│  harness/claude-code  — read rows, emit observations  │
│  measurement/engine   — B (context belief), epochs    │
│  session-watcher      — apply frames, run operations  │
│  rate-lamp            — rent ledger + wallet clock    │
│  server.js            — Express + SSE dashboard       │
│  statusline           — one-line shell client         │
└───────────────────────────────────────────────────────┘
        │  dashboard  ·  statusline  ·  MCP
        ▼
   Your browser / terminal status bar

The harness layer is the only part that knows Claude Code: it reads transcript rows, decides the active branch, and emits normalized observations. Everything below it — measurement, dialogue history, handoff — consumes those observations and carries no transcript format, no row shape, and no tool name of any particular agent.

Core model: L = cache_read_input_tokens — the context stock you are renting. B is the rebuild baseline: the session's overhead floor plus the tokens of every file, skill and tool it has pulled in, which is what a restart would have to re-read. g is the growth no path accounts for, a smoothed ΔtotalStock − ΔB. x = L / B is the raw position ratio; the authoritative position is u, which every call advances by its own fraction of the restart interval that held while it ran, so the position records the path travelled rather than a ratio of today's numbers, and each landmark on the x axis is read off the reference skeleton fitted across that path. br = mf × pp is the bill premium — how much you are overpaying relative to ideal restart timing. The restart reminder is separate: it reads the rent the ledger has accumulated, so no revision of the position can withdraw one.

Lamp thresholds are the named constants BR_AMBER and BR_RED in lib/bill-regret.js: below the amber one the lamp is green, between them amber, at or above the red one red. See the [paper](#paper) for the full derivation — EOQ inventory theory mapped to LLM prompt caching.

Quick Start

Requires Node.js ≥ 22.16.

# Try without installing — self-contained demo
npx -y @nomadop/session-watcher demo

# Replay your own transcript
npx -y @nomadop/session-watcher replay ~/.claude/projects//.jsonl

Opens a browser dashboard. The demo uses a pre-built anonymized session; replay uses your real transcript. Both are read-only — nothing is modified or uploaded.

Install

Plugin (recommended)

# 1. Add the marketplace (one-time)
claude plugin marketplace add nomadop/session-watcher

# 2. Install the plugin

同分类对比

同一分类下 Star 最高的 5 个,便于横向比较。

插件作者 Star版本更新
dsh-purge kingcharleslzy-ai 6.3K 1.6.86 2026-11-08
dsh-unrestricted yexi-by 1.1K 0.2.8 2026-11-05
dsh-univer-office dream-num 707 0.4.0 2026-11-03
dsh-synapse liangmianya 697 0.5.7 2026-11-04
dsh-qqbot tencent-connect 570 0.5.5 2026-11-08