health

health is a command for Claude Code from RohiRIK/OpenLtm. It costs 37 tokens per session (2,117 once invoked), scanned A, original, MIT.

A command for checking the health of stored project memories, including their freshness, confidence, coverage, and recent activity.

In plain words
What is it for?
It is for reviewing memory scores, finding stale memories, inspecting cleanup status, and diagnosing memory decay.
Why use it?
It helps reveal when saved context is becoming outdated, incomplete, or neglected.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the openltm plugin — 9 skills, 6 commands, 2 agents, 3 hooks shipped together

Good fit It is for reviewing memory scores, finding stale memories, inspecting cleanup status, and diagnosing memory decay.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/rohirik/openltm/health
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.

Clone the repo
git clone --depth 1 https://github.com/RohiRIK/OpenLtm

Made for: Claude Code.

Or install openltm, the plugin that ships this one along with the rest of its 9 skills, 6 commands, 2 agents, 3 hooks.

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 health

README.md
[![agentmods](https://agentmods.dev/badge/commands/rohirik/openltm/health.svg)](https://agentmods.dev/commands/rohirik/openltm/health)
Your own site
<a href="https://agentmods.dev/commands/rohirik/openltm/health"><img src="https://agentmods.dev/badge/commands/rohirik/openltm/health.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,117 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00037 $0.02117
Opus 5 $0.00018 $0.01059
Sonnet 5 $0.00007 $0.00423
Haiku 4.5 $0.00004 $0.00212

Measured 8d ago against content hash 94019be83f19, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

health scanned grade A with 1 finding 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 8d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s http://localhost:7331/api/health/projects
commands/health.md · 200 lines

How it starts

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

Project Health Scores

curl -s http://localhost:7331/api/health/projects

If the server responds: parse JSON and render ranked table (highest score first):

SCORE  STATUS           PROJECT              MEMORIES  STALE  CTX
  85   🟢 healthy        claude-config            142      3   4/4
  62   🟡 needs_attention my-app                   38     12   2/4
  31   🔴 neglected       old-project               9      9   0/4

Status: 🟢 ≥70 · 🟡 40–69 · 🔴 <40

Metric Weight
Memory freshness (accessed ≤30 days) 35%
Avg confidence 25%
Context coverage (goal/decision/gotcha/progress) 20%
Session activity (any access ≤14 days) 20%

If the server is NOT running, show: (graph server offline — start with /openltm:admin server)


Activity (last 24 h)

Prefer ltm.jsonl (structured JSONL log) when available; fall back to hooks.log.

bun --eval "
import { readFileSync, existsSync, statSync } from 'fs';
import { join } from 'path';
import { homedir } from 'os';

const PLUGIN_DATA = process.env.CLAUDE_PLUGIN_DATA ?? join(homedir(), '.claude', 'plugins', 'data', 'OpenLtm-openltm');
const JSONL_LOG = join(PLUGIN_DATA, 'logs', 'ltm.jsonl');
const HOOKS_LOG = join(homedir(), '.claude', 'logs', 'hooks.log');

const LABELS = {
  'session.start':     'Sessions started',
  'session.evaluated': 'Sessions evaluated',
  'context.updated':   'Context updates',
  'compact.pre':       'Compactions',
  'recall.hit':        'Recall hits',
  'learn.write':       'Memories learned',
  'wizard.complete':   'Wizard completions',
  'git.commit':        'Git commits tracked',
  'server.notify':     'Server notifies',
};

const cutoff = Date.now() - 24 * 60 * 60 * 1000;
const counts = {};
const hookCounts = {};
const errors = [];

if (existsSync(JSONL_LOG)) {
  // Primary: ltm.jsonl — structured LtmEvent lines
  readFileSync(JSONL_LOG, 'utf-8').trim().split('\n').slice(-100).forEach(line => {
    try {
      const e = JSON.parse(line);
      if (!e.event || !e.ts) return;
      if (new Date(e.ts).getTime() < cutoff) return;
      counts[e.event] = (counts[e.event] ?? 0) + 1;
      if (e.hook) hookCounts[e.hook] = (hookCounts[e.hook] ?? 0) + 1;
      if (e.level === 'error') errors.push(e);
    } catch {}
  });
} else if (existsSync(HOOKS_LOG)) {
  // Fallback: hooks.log — event-level entries only
  readFileSync(HOOKS_LOG, 'utf-8').trim().split('\n').forEach(line => {
    try {
      const e = JSON.parse(line);
      if (e.level !== 'event' || !e.event) return;
      if (new Date(e.ts).getTime() < cutoff) return;
      counts[e.event] = (counts[e.event] ?? 0) + 1;
      if (e.hook) hookCounts[e.hook] = (hookCounts[e.hook] ?? 0) + 1;
    } catch {}
  });
} else {
  console.log('No log files yet — hooks have not fired.');
  process.exit(0);
}

console.log('Activity (last 24 h)');
console.log('────────────────────');
const eventKeys = Object.keys(LABELS);
const anyEvent = eventKeys.some(k => counts[k]);
if (!anyEvent) { console.log('  No hook events yet.'); }
else { eventKeys.forEach(k => { if (counts[k]) console.log('  ' + (LABELS[k] ?? k).padEnd(26) + counts[k]); }); }

if (Object.keys(hookCounts).length) {
  console.log('');
  console.log('Per-hook counts');
  console.log('───────────────');
  Object.entries(hookCounts).sort((a,b) => b[1]-a[1]).forEach(([h,n]) => console.log('  ' + h.padEnd(22) + n));
}

if (errors.length) {
  console.log('');
  console.log('Last errors (up to 5)');
  console.log('─────────────────────');
  errors.slice(-5).forEach(e => console.log('  [' + e.ts + '] ' + e.hook + ': ' + (e.detail ?? e.event)));
}
"

Read the full file on GitHub · 200 lines

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. 8d ago First seen · 200 lines · 37 tokens per session scan A 94019be83f19

Subscribe to this mod's changes

health is a command published in the GitHub repository RohiRIK/OpenLtm (26 stars, last pushed 7d ago), licensed MIT. It adds 37 tokens to every session and 2,117 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.