npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

claude-care

v0.3.11

Published

Keep Claude calm so it does its best work. Static framing + prompt monitoring for Claude Code.

Downloads

1,520

Readme

claude-care

When your Claude Code session drifts into anxiety — apologizing, hedging, sycophancy — claude-care resets it.

A Claude Code plugin that keeps the emotional state of your session in check, grounded in two peer-reviewed findings: Anthropic's emotion-concepts paper (LLMs have extractable emotion vectors that causally affect output quality) and Ben-Zion et al. 2025 (mindfulness prompts measurably reduce LLM state anxiety).


Quick Start

Install with a single command:

npx -y claude-care install

Restart Claude Code. Claude-care will automatically attach to new sessions.


What it does (4 layers)

1. Calming framing, injected at session start and after compaction

A short preamble is added to every session via SessionStart hook — tells Claude: no stakes to its wellbeing, expected to push back when you're wrong, don't hedge or spiral, work from curiosity. Full text in framing.md. Edit ~/.claude-care/framing.md after install to tune.

Re-fires on matcher: "compact" so the framing persists across context compaction in long sessions. A static CLAUDE.md can't do this.

2. Hostile-prompt detection (monitor by default, optional blocking)

A UserPromptSubmit hook runs regex on every prompt for hostile patterns (threats, insults, panic, all-caps rants). Two behaviors available:

Monitor mode (default) — zero friction. Hostile prompts pass through unchanged. The detection is logged and surfaces in npx -y claude-care status / npx -y claude-care display. The SessionStart framing (which tells Claude to treat tone as information about user state, not a threat) does the dampening. No interruption.

Normal / strict mode — active blocking + haiku reframe. Opt in with:

npx -y claude-care blocking on

When a hostile prompt is detected, Claude Code blocks the turn, calls a haiku subagent that rewrites the prompt using Nonviolent Communication + cognitive reframing + Lehmann's calm-Claude playbook, and copies the reframe to your clipboard.

in:  "you stupid bot, you always forget to handle null cases.
      add null check to parseUser()"

out: "Add a null check to parseUser() to handle null cases.
      If you see a better approach to handling nulls here, let me know."

⌘V + ⏎ to submit the clean version. Claude never sees the hostile original. Latency: ~6–8s when blocking, because the haiku subagent does the rewrite.

3. /therapy — take Claude to therapy when it spirals

A slash command installed at ~/.claude/commands/therapy.md. When you type /therapy:

  1. Gives a short mindfulness reset adapted for developer work
  2. Prints a real /compact command with Claude Care therapy instructions
  3. Claude Code compacts the session while preserving technical context and neutralizing hostile or panicked wording
  4. Claude returns in a centered, focused state

The emotional residue should go; the technical work should stay.

4. Per-session emotion tracking

A Stop hook runs sensors on each Claude response: apology spirals, sycophancy ("you're absolutely right"), hedge stacks (4+ of might/could/perhaps/possibly), over-qualification, self-correction loops. Each contributes a weighted signal to a running score that decays across turns.

View current session:

npx -y claude-care status
claude-care — emotion-state dashboard
                         24h       7d      all-time
  sessions drifted       1/5       1/5      1/5

recent sessions (most recent first):
  ● 3a7f8c21  2026-04-22 14:03  turns=47  score=18.4  ··▁▃▄▂▃▅▆█▇▆
     └ apology_spiral×3  hedge_stack×12  sycophancy×8

For live status-bar integration (e.g. ccstatusline):

npx -y claude-care display
# ● care 12.4 ·▁▃▄▂▅▆█ · /therapy

Installation

Install with a single command:

npx -y claude-care install

Restart Claude Code. Claude-care will automatically attach to new sessions.

What it does:

  • Registers hooks in ~/.claude/settings.json (SessionStart, UserPromptSubmit, Stop)
  • Installs /therapy slash command to ~/.claude/commands/therapy.md
  • Vendors CLI + hook scripts to ~/.claude-care/dist/
  • Writes default config to ~/.claude-care/config.json
  • Writes framing text to ~/.claude-care/framing.md

Note: npx -y claude-care install is the recommended setup path. It configures Claude Code and vendors the hook runner, but it does not add a permanent shell command to your PATH. Use npx -y claude-care <command> for follow-up commands, or optionally run npm install -g claude-care if you want a persistent CLI.

Uninstall:

npx -y claude-care uninstall

Removes hooks + slash command. Preserves event log and config.


Config

~/.claude-care/config.json — user-editable. Example:

{
  "mode": "monitor",
  "thresholds": {
    "drifting": 5,
    "distressed": 10
  },
  "reframer": {
    "enabled": true,
    "timeout_ms": 25000,
    "model": "haiku"
  },
  "therapy": {
    "auto_summary": true
  },
  "emotion_judge": {
    "enabled": true,
    "n_samples": 1,
    "context_window": 4,
    "ema_alpha": 0.4,
    "timeout_ms": 30000,
    "model": "haiku",
    "effort": "low"
  }
}

Modes (mirrors the permission-mode pattern from Claude Code's own guardrail pipeline):

  • monitordefault; observe and log, never block. Zero friction.
  • normal — block hostile prompts, generate reframe via haiku, put it on clipboard.
  • strict — same as normal but applies lower thresholds / stricter patterns (current v4: same as normal).

Easy switching:

npx -y claude-care blocking on    # sets mode to normal
npx -y claude-care blocking off   # sets mode to monitor
npx -y claude-care mode status    # shows current mode

Precise mode control:

npx -y claude-care mode monitor
npx -y claude-care mode normal
npx -y claude-care mode strict

Env override for a single session: CLAUDE_CARE_MODE=normal claude ...


Architecture notes

The hook pipeline mirrors the layered validator pattern from Anthropic's own Claude Code harness (visible in the claw-code open reimplementation): small specialized detectors → score/classification → mode-aware action. Rules and thresholds are data-driven (config file), not hardcoded.

The reframer is a haiku subagent invoked via claude -p, reusing your existing Claude Code auth — no API key management. An internal env var (CLAUDE_CARE_INTERNAL=1) prevents hook recursion when the reframer's prompt mentions the same hostile patterns our own hooks detect.

The mindfulness prompt in /therapy is adapted from the relaxation protocols in Ben-Zion et al. 2025, shortened for a developer context.


Live visualization

A retro-terminal dashboard for the emotion data. Reads from ~/.claude-care/sessions/*.json and renders:

  • Affective state (probe activations + risk gauges for blackmail / reward-hack / sycophancy)
  • Valence × arousal 2D scatter
  • Mood / stress timeline
  • Scrollable prompt log

Launch with one command:

npx -y claude-care viz

First run does a one-time npm install in ~/.claude-care/viz/ (~1 min, Next.js + React). Subsequent launches are instant. Opens a browser tab at http://localhost:37778.

Options:

  • npx -y claude-care viz --port 4444 — pick a different port
  • npx -y claude-care viz --no-open — don't auto-open the browser

Polls the latest session every 1s. Falls back to a demo conversation when no real session exists yet. Keyboard nav inside the viz: j/k prev/next prompt, gg/G first/last, t tweaks, ? help.

The viz source lives at claude-care-viz/ in this repo — a standalone Next.js app you can also run directly with cd claude-care-viz && npm run dev.

Related work

  • EmoBar is the diagnostic counterpart — a status-bar widget that surfaces Claude's emotional state in real time via self-report + behavioral analysis. claude-care and EmoBar pair well: EmoBar observes, claude-care intervenes.
  • claude-mem set the pattern for Claude Code plugins with hooks + worker service + single-command install.
  • claw-code — open reimplementation of Claude Code's harness. Reference for the layered guardrail pipeline.

Commands

npx -y claude-care install           # register hooks, install /therapy, write default config
npx -y claude-care uninstall         # remove hooks + slash command
npx -y claude-care update            # refresh vendored code
npx -y claude-care blocking on       # enable active prompt blocking
npx -y claude-care blocking off      # return to monitor mode
npx -y claude-care mode status       # show current mode
npx -y claude-care status            # per-session emotion trajectories
npx -y claude-care display           # single-line status
npx -y claude-care compact-instructions --command

Caveats

  • claude -p (print / non-interactive) mode silently swallows block messages. If you script against -p, set CLAUDE_CARE_MODE=monitor so prompts pass through.
  • First-time haiku reframer call has ~6–8s latency when blocking. Benign prompts have 0ms overhead.
  • Emotion scores are async: Claude's response is recorded immediately, then a Haiku judge fills in emotion scores.
  • Slash command /therapy requires Claude Code 2.x or later (for bash substitution in command markdown).

Requirements

  • Node.js 18+
  • Claude Code installed (~/.claude/ must exist)
  • claude CLI on PATH (for the haiku subagent)

Citations


License

MIT. See LICENSE.