Skip to main content
statuslinesSource-backedReview first Safety Privacy

Cache Efficiency Monitor - Statuslines

A Claude Code statusline that reads prompt-cache token metrics from session JSON and renders a color-coded hit-rate bar with an estimated token-savings readout.

by JSONbored·added 2025-10-25·
HarnessClaude Code
Language:bash
Review first review before installing

Open the source and read safety notes before installing.

Citation facts

Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.

Source URLs
https://code.claude.com/docs/en/statusline, https://github.com/JSONbored/awesome-claude/blob/main/content/statuslines/cache-efficiency-monitor.mdx
Safety notes
Runs a bash script on every status-line refresh (about every 2 seconds) that pipes session JSON through jq and bc; it is read-only and makes no network calls or file writes, but status-line commands execute with your shell's permissions, so review the script before adding it to settings.json.
Privacy notes
Reads Claude Code session cost and token metrics from the status-line JSON on stdin and prints them to your terminal; no data leaves the machine, but the displayed figures may be visible to anyone viewing your screen or a terminal recording.
Author
JSONbored
Claim status
unclaimed
Last verified
2025-10-25

Decision playbook

Review trust signals before you adopt

Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.

Compare context
Selected

0

Current score

78

Baseline

Delta

No baseline selected

No major trust-signal divergence detected in the current selection.

Source and provenance checks

Complete

Confirm ownership and provenance before trusting install instructions.

  • Source link availableRequired

    Open the canonical repository and verify ownership.

    Done
  • Source provenance statusRequired

    Marked as source-backed.

    Done
  • Metadata reviewed

    Registry metadata indicates a reviewed listing.

    Done

Safety and privacy checks

Complete

Validate risk disclosures before installation or API wiring.

  • Safety notes presentRequired

    Review the listed safety guidance before running commands.

    Done
  • Privacy notes presentRequired

    Review data handling notes before connecting accounts or secrets.

    Done
  • Trust level risk gateRequired

    Trust level does not block evaluation.

    Done

Package and install checks

Needs review

Check package metadata and artifact integrity signals.

  • Install payload available

    Install or copy payload is available for review.

    Done
  • Package verification flag

    No package verification flag provided.

    Pending
  • Checksum metadata

    No checksum provided for downloaded artifact.

    Pending

Compare-driven decision checks

Needs review

Use compare context to validate trade-offs before adoption.

  • Compare tray has multiple entries

    Add at least one more entry to compare trust differences.

    Pending
  • Baseline comparison available

    No baseline peer selected yet.

    Pending
  • Diverging trust signals identified

    No major trust-signal divergence found.

    Pending

Setup at a glance

Config edit

Copy-ready — paste the snippet to get started.

Install command

Not provided

Config snippet

Provided

Copy snippet

Provided

Prerequisites

6 to clear

Platforms

1 listed

Difficulty

7/100

Adoption plan

Balanced adoption plan

Current risk score 16/100. Use staged verification before broader rollout.

Risk 16

Pre-adoption checks

Validate source and review signals before any execution.

  • Confirm source provenanceRequired

    Source URL/provenance metadata is present.

    Done
  • Confirm metadata review state

    Listing has review metadata.

    Done
  • Verify install payload

    Install/config payload exists and can be inspected.

    Done

Security checks

Confirm safety, privacy, and package integrity signals.

  • Review safety notesRequired

    Safety notes are present.

    Done
  • Review privacy notesRequired

    Privacy notes are present.

    Done
  • Verify package integrity metadata

    No package verification/checksum metadata.

    Pending

Rollout

Adopt in controlled steps based on the selected plan.

  • Run in isolated sandbox firstRequired

    Use a constrained sandbox and observe behavior across multiple tasks.

    Pending
  • Roll out graduallyRequired

    Roll out to a small cohort before wider usage.

    Pending
  • Set monitoring and fallback

    Define rollback path and monitor errors after adoption.

    Pending

Evidence readiness

Evidence readiness matrix · balanced

Required evidence gates are covered (5/6 signals complete).

Risk 15

Source provenance

Present

Source repository/provenance is listed.

Required in this preset

Metadata review

Present

Review metadata is present.

Required in this preset

Safety notes

Present

Safety notes are present.

Required in this preset

Privacy notes

Present

Privacy notes are present.

Optional in this preset

Package integrity

Missing

Package integrity metadata is missing.

Optional in this preset

Install payload

Present

Install payload is available.

Required in this preset

Required evidence gates are covered for this preset.

Decision timeline

Decision timeline · balanced

5/6 steps complete with no blocking gaps for this preset.

Risk 14

triage

Confirm source provenanceRequired

Source/provenance metadata is available.

Done

triage

Check metadata review statusRequired

Review metadata is available.

Done

verify

Review safety notesRequired

Safety notes are available.

Done

verify

Review privacy notes

Privacy notes are available.

Done

verify

Validate package integrity metadata

Package integrity metadata is missing.

Pending

rollout

Verify install payload and commandsRequired

Install payload is available.

Done

No required blockers for this timeline preset.

Prerequisite readiness

Prerequisite readiness

6 prerequisites to line up before setup. Have accounts and credentials ready first.

0/6 ready
Account & credentials1Install & runtime1Network & hosting1General3

Safety & privacy surface

Safety & privacy surface

1 safety and 1 privacy notes across 1 risk area. Review closely: credentials & tokens.

1 area
  • SafetyCredentials & tokensRuns a bash script on every status-line refresh (about every 2 seconds) that pipes session JSON through jq and bc; it is read-only and makes no network calls or file writes, but status-line commands execute with your shell's permissions, so review the script before adding it to settings.json.
  • PrivacyCredentials & tokensReads Claude Code session cost and token metrics from the status-line JSON on stdin and prints them to your terminal; no data leaves the machine, but the displayed figures may be visible to anyone viewing your screen or a terminal recording.

Safety notes

  • Runs a bash script on every status-line refresh (about every 2 seconds) that pipes session JSON through jq and bc; it is read-only and makes no network calls or file writes, but status-line commands execute with your shell's permissions, so review the script before adding it to settings.json.

Privacy notes

  • Reads Claude Code session cost and token metrics from the status-line JSON on stdin and prints them to your terminal; no data leaves the machine, but the displayed figures may be visible to anyone viewing your screen or a terminal recording.

Prerequisites

  • Claude Code CLI installed and configured
  • Bash shell available (bash 4.0+ recommended for arithmetic operations)
  • jq command-line JSON processor (jq 1.6+ recommended for safe extraction with // defaults)
  • bc calculator (bc 1.07+ optional for precise savings calculations, script falls back to integer math)
  • Terminal with ANSI color code support (256-color mode recommended for color-coded efficiency indicators)
  • Claude Code version with cache metrics support (cache_read_input_tokens, cache_creation_input_tokens fields in JSON)

Schema details

Install type
config
Reading time
2 min
Difficulty score
7
Troubleshooting
Yes
Breaking changes
No
Skill and platform metadata
Retrieval sources
https://code.claude.com/docs/en/statuslinehttps://platform.claude.com/docs/en/build-with-claude/prompt-caching
Runtime and command metadata
Script language
bash
Script body
#!/usr/bin/env bash

# Cache Efficiency Monitor for Claude Code
# Tracks prompt caching performance and cost savings

# Read JSON from stdin
read -r input

# Extract cache metrics (if available in JSON)
cache_read_tokens=$(echo "$input" | jq -r '.cost.cache_read_input_tokens // 0')
cache_create_tokens=$(echo "$input" | jq -r '.cost.cache_creation_input_tokens // 0')
regular_input_tokens=$(echo "$input" | jq -r '.cost.input_tokens // 0')

# Calculate total input tokens
total_input=$((cache_read_tokens + cache_create_tokens + regular_input_tokens))

# Avoid division by zero
if [ $total_input -eq 0 ]; then
  total_input=1
fi

# Calculate cache hit rate (percentage of tokens read from cache)
if [ $cache_read_tokens -gt 0 ]; then
  cache_hit_rate=$(( (cache_read_tokens * 100) / total_input ))
else
  cache_hit_rate=0
fi

# Calculate write efficiency (cache creation vs regular input)
if [ $cache_create_tokens -gt 0 ]; then
  write_percentage=$(( (cache_create_tokens * 100) / total_input ))
else
  write_percentage=0
fi

# Cache efficiency scoring
if [ $cache_hit_rate -ge 50 ]; then
  CACHE_COLOR="\033[38;5;46m"   # Green: Excellent caching (>50% hit rate)
  CACHE_ICON="✓"
  CACHE_STATUS="EXCELLENT"
elif [ $cache_hit_rate -ge 25 ]; then
  CACHE_COLOR="\033[38;5;226m"  # Yellow: Good caching (25-50% hit rate)
  CACHE_ICON="●"
  CACHE_STATUS="GOOD"
elif [ $cache_hit_rate -gt 0 ]; then
  CACHE_COLOR="\033[38;5;208m"  # Orange: Low caching (1-25% hit rate)
  CACHE_ICON="⚠"
  CACHE_STATUS="LOW"
else
  CACHE_COLOR="\033[38;5;250m"  # Gray: No caching
  CACHE_ICON="○"
  CACHE_STATUS="NONE"
fi

# Estimate cost savings (cache reads cost 90% less than regular input)
if [ $cache_read_tokens -gt 0 ]; then
  # Savings = cache_read_tokens * 0.9 (90% discount)
  savings_tokens=$(echo "scale=0; $cache_read_tokens * 0.9 / 1" | bc)
  savings_display="💰 ~${savings_tokens} tok saved"
else
  savings_display=""
fi

# Build cache hit rate bar (20 characters wide)
hit_bar_filled=$(( cache_hit_rate / 5 ))  # Each char = 5%
hit_bar_empty=$(( 20 - hit_bar_filled ))

if [ $hit_bar_filled -gt 0 ]; then
  hit_bar=$(printf "█%.0s" $(seq 1 $hit_bar_filled))$(printf "░%.0s" $(seq 1 $hit_bar_empty))
else
  hit_bar="░░░░░░░░░░░░░░░░░░░░"
fi

# Optimization recommendation
if [ $cache_hit_rate -eq 0 ] && [ $cache_create_tokens -eq 0 ]; then
  RECOMMENDATION="(Enable caching?)"
elif [ $cache_hit_rate -lt 25 ] && [ $write_percentage -gt 50 ]; then
  RECOMMENDATION="(More reads needed)"
else
  RECOMMENDATION=""
fi

RESET="\033[0m"

# Output statusline
if [ -n "$savings_display" ]; then
  echo -e "${CACHE_ICON} Cache: ${CACHE_COLOR}${hit_bar}${RESET} ${cache_hit_rate}% | ${savings_display} ${RECOMMENDATION}"
else
  echo -e "${CACHE_ICON} Cache: ${CACHE_COLOR}${hit_bar}${RESET} ${cache_hit_rate}% ${RECOMMENDATION}"
fi
Full copyable content
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/cache-efficiency-monitor.sh",
    "refreshInterval": 2000
  }
}

About this resource

Features

  • Real-time prompt cache hit rate tracking (percentage of tokens read from cache)
  • Cache write efficiency monitoring (cache creation vs regular input ratio)
  • Cost savings estimation based on 90% cache read discount
  • Visual hit rate bar (20-char progress indicator, each █ = 5%)
  • Efficiency scoring (excellent >50%, good 25-50%, low 1-25%, none 0%)
  • Optimization recommendations (enable caching, increase reuse patterns)
  • Color-coded status (green excellent, yellow good, orange low, gray none)
  • Lightweight bash with bc for percentage calculations

Use Cases

  • Optimizing prompt caching strategy to reduce API costs
  • Identifying inefficient cache usage patterns (high writes, low reads)
  • Validating that prompt caching is properly enabled and working
  • Tracking cost savings from cache utilization
  • Debugging cache misses in long coding sessions
  • Comparing caching efficiency across different projects/workflows

Requirements

  • Claude Code CLI installed and configured
  • Bash shell available (bash 4.0+ recommended for arithmetic operations)
  • jq command-line JSON processor (jq 1.6+ recommended for safe extraction with // defaults)
  • bc calculator (bc 1.07+ optional for precise savings calculations, script falls back to integer math)
  • Terminal with ANSI color code support (256-color mode recommended for color-coded efficiency indicators)
  • Claude Code version with cache metrics support (cache_read_input_tokens, cache_creation_input_tokens fields in JSON)

Configuration

{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/cache-efficiency-monitor.sh",
    "refreshInterval": 2000
  }
}

Examples

Enhanced Cache Monitor with Write Efficiency Tracking

Extended version with detailed write efficiency metrics and recommendations

#!/usr/bin/env bash

# Enhanced Cache Efficiency Monitor with Write Efficiency

input=$(cat)

cache_read_tokens=$(echo "$input" | jq -r '.cost.cache_read_input_tokens // 0')
cache_create_tokens=$(echo "$input" | jq -r '.cost.cache_creation_input_tokens // 0')
regular_input_tokens=$(echo "$input" | jq -r '.cost.input_tokens // 0')

total_input=$((cache_read_tokens + cache_create_tokens + regular_input_tokens))

if [ $total_input -eq 0 ]; then
  total_input=1
fi

cache_hit_rate=$((cache_read_tokens > 0 ? (cache_read_tokens * 100) / total_input : 0))
write_percentage=$((cache_create_tokens > 0 ? (cache_create_tokens * 100) / total_input : 0))

if [ $cache_hit_rate -ge 50 ]; then
  CACHE_COLOR="\033[38;5;46m"
  CACHE_ICON="✓"
elif [ $cache_hit_rate -ge 25 ]; then
  CACHE_COLOR="\033[38;5;226m"
  CACHE_ICON="●"
elif [ $cache_hit_rate -gt 0 ]; then
  CACHE_COLOR="\033[38;5;208m"
  CACHE_ICON="⚠"
else
  CACHE_COLOR="\033[38;5;250m"
  CACHE_ICON="○"
fi

if [ $cache_read_tokens -gt 0 ]; then
  savings_tokens=$(echo "scale=0; $cache_read_tokens * 0.9 / 1" | bc 2>/dev/null || echo "$((cache_read_tokens * 9 / 10))")
  savings_display="💰 ~${savings_tokens} tok saved"
else
  savings_display=""
fi

hit_bar_filled=$((cache_hit_rate / 5))
hit_bar_empty=$((20 - hit_bar_filled))

if [ $hit_bar_filled -gt 0 ]; then
  hit_bar=$(printf "█%.0s" $(seq 1 $hit_bar_filled))$(printf "░%.0s" $(seq 1 $hit_bar_empty))
else
  hit_bar="░░░░░░░░░░░░░░░░░░░░"
fi

# Enhanced recommendations
if [ $cache_hit_rate -eq 0 ] && [ $cache_create_tokens -eq 0 ]; then
  RECOMMENDATION="(Enable caching?)"
elif [ $cache_hit_rate -lt 25 ] && [ $write_percentage -gt 50 ]; then
  RECOMMENDATION="(More reads needed - ${write_percentage}% writes)"
elif [ $write_percentage -gt 75 ]; then
  RECOMMENDATION="(Too many cache writes)"
else
  RECOMMENDATION=""
fi

RESET="\033[0m"

if [ -n "$savings_display" ]; then
  echo -e "${CACHE_ICON} Cache: ${CACHE_COLOR}${hit_bar}${RESET} ${cache_hit_rate}% | Write: ${write_percentage}% | ${savings_display} ${RECOMMENDATION}"
else
  echo -e "${CACHE_ICON} Cache: ${CACHE_COLOR}${hit_bar}${RESET} ${cache_hit_rate}% | Write: ${write_percentage}% ${RECOMMENDATION}"
fi

Cache Monitor with Custom Efficiency Thresholds

Configurable efficiency thresholds for different caching strategies

#!/usr/bin/env bash

# Cache Efficiency Monitor with Custom Thresholds

EXCELLENT_THRESHOLD=${CACHE_EXCELLENT_THRESHOLD:-50}
GOOD_THRESHOLD=${CACHE_GOOD_THRESHOLD:-25}

input=$(cat)

cache_read_tokens=$(echo "$input" | jq -r '.cost.cache_read_input_tokens // 0')
cache_create_tokens=$(echo "$input" | jq -r '.cost.cache_creation_input_tokens // 0')
regular_input_tokens=$(echo "$input" | jq -r '.cost.input_tokens // 0')

total_input=$((cache_read_tokens + cache_create_tokens + regular_input_tokens))

if [ $total_input -eq 0 ]; then
  total_input=1
fi

cache_hit_rate=$((cache_read_tokens > 0 ? (cache_read_tokens * 100) / total_input : 0))
write_percentage=$((cache_create_tokens > 0 ? (cache_create_tokens * 100) / total_input : 0))

# Custom thresholds
if [ $cache_hit_rate -ge $EXCELLENT_THRESHOLD ]; then
  CACHE_COLOR="\033[38;5;46m"
  CACHE_ICON="✓"
elif [ $cache_hit_rate -ge $GOOD_THRESHOLD ]; then
  CACHE_COLOR="\033[38;5;226m"
  CACHE_ICON="●"
elif [ $cache_hit_rate -gt 0 ]; then
  CACHE_COLOR="\033[38;5;208m"
  CACHE_ICON="⚠"
else
  CACHE_COLOR="\033[38;5;250m"
  CACHE_ICON="○"
fi

if [ $cache_read_tokens -gt 0 ]; then
  savings_tokens=$(echo "scale=0; $cache_read_tokens * 0.9 / 1" | bc 2>/dev/null || echo "$((cache_read_tokens * 9 / 10))")
  savings_display="💰 ~${savings_tokens} tok saved"
else
  savings_display=""
fi

hit_bar_filled=$((cache_hit_rate / 5))
hit_bar_empty=$((20 - hit_bar_filled))

if [ $hit_bar_filled -gt 0 ]; then
  hit_bar=$(printf "█%.0s" $(seq 1 $hit_bar_filled))$(printf "░%.0s" $(seq 1 $hit_bar_empty))
else
  hit_bar="░░░░░░░░░░░░░░░░░░░░"
fi

RESET="\033[0m"

if [ -n "$savings_display" ]; then
  echo -e "${CACHE_ICON} Cache: ${CACHE_COLOR}${hit_bar}${RESET} ${cache_hit_rate}% | ${savings_display}"
else
  echo -e "${CACHE_ICON} Cache: ${CACHE_COLOR}${hit_bar}${RESET} ${cache_hit_rate}%"
fi

Cache Efficiency Monitor Installation Example

Complete setup script with cache field verification

#!/bin/bash
# Installation script for Cache Efficiency Monitor

mkdir -p .claude/statuslines

# Check for bc (optional, for savings calculation)
if ! command -v bc &> /dev/null; then
  echo "Note: bc not found. Savings calculation will use integer math."
  echo "Install bc for precise calculations: brew install bc (macOS), apt install bc (Linux)"
fi

cat > .claude/statuslines/cache-efficiency-monitor.sh << 'SCRIPT_EOF'
#!/usr/bin/env bash
# Paste the full statusline script from the primary example above before running this installer.
SCRIPT_EOF

chmod +x .claude/statuslines/cache-efficiency-monitor.sh

# Add to settings.json
if [ ! -f .claude/settings.json ]; then
  echo '{"statusLine":{"type":"command","command":"$CLAUDE_PROJECT_DIR/.claude/statuslines/cache-efficiency-monitor.sh","refreshInterval":2000}}' > .claude/settings.json
else
  jq '.statusLine = {"type":"command","command":"$CLAUDE_PROJECT_DIR/.claude/statuslines/cache-efficiency-monitor.sh","refreshInterval":2000}' .claude/settings.json > .claude/settings.json.tmp
  mv .claude/settings.json.tmp .claude/settings.json
fi

echo "Cache Efficiency Monitor installed successfully!"
echo "Note: Requires Claude Code version with cache metrics support (cache_read_input_tokens, cache_creation_input_tokens)."
echo "Verify cache fields exist: echo '{"cost":{}}' | jq '.cost.cache_read_input_tokens'"

Troubleshooting

Cache hit rate always showing 0% despite caching enabled

Verify cache fields exist in JSON: echo '$input' | jq '.cost | {cache_read: .cache_read_input_tokens, cache_create: .cache_creation_input_tokens}'. If fields missing, Claude Code version may not expose cache metrics. Check official docs for required version. Caching requires Claude 3.5 Sonnet or Opus with prompt caching feature enabled. Verify prompt caching is configured in Claude Code settings.

Cost savings calculation showing unrealistic numbers

Script estimates savings using 90% discount formula (cache reads cost 10% of regular input). Verify cache*read_tokens value: echo '$input' | jq .cost.cache_read_input_tokens. Formula: savings = cache_read_tokens * 0.9. Adjust discount percentage in script if Claude pricing changes. Check bc calculation: echo 'scale=0; 1000 _ 0.9 / 1' | bc (should return 900).

Recommendation showing 'Enable caching?' when caching is on

Recommendation triggers when both cache_read_tokens and cache_create_tokens are 0. This means no cache activity detected. Verify prompt caching is configured in Claude Code settings. Check that prompts contain cacheable prefixes (system messages, long contexts). Short sessions may not benefit from caching. Verify cache fields are being read: echo '$input' | jq '.cost.cache_read_input_tokens'.

Hit rate bar not displaying correctly or showing as empty

Ensure terminal supports Unicode block characters (█ and ░). Test with: echo -e '█████░░░░░'. Bar uses hit_rate / 5 for scaling (each char = 5%). If hit_rate is 0, shows full empty bar (20x ░). Verify cache_hit_rate calculation: (cache_read_tokens * 100) / total_input. Check printf command works: printf '█%.0s' $(seq 1 5) (should show 5 blocks).

Write efficiency showing 'More reads needed' incorrectly

Recommendation appears when hit_rate <25% AND write_percentage >50% (creating more cache entries than using them). This indicates inefficient caching pattern. Solution: Reuse prompts more, reduce unique cache writes. Check if session involves many one-off queries vs repeated patterns. Verify write_percentage calculation: (cache_create_tokens * 100) / total_input.

Cache efficiency color always showing gray (NONE) even with cache activity

Check cache_hit_rate calculation: cache_hit_rate=$(( (cache_read_tokens * 100) / total_input )). Verify cache_read_tokens > 0: echo '$input' | jq .cost.cache_read_input_tokens. Ensure total_input includes all token types: total_input=$((cache_read_tokens + cache_create_tokens + regular_input_tokens)). Test threshold logic: if [ $cache_hit_rate -ge 50 ]; then echo "EXCELLENT"; fi.

Percentage calculations showing incorrect values (e.g., >100%)

Verify integer division is working correctly: echo $((100 * 50 / 100)) (should be 50). Check total_input > 0 before division. Test calculation: cache_hit_rate=$((cache_read_tokens * 100 / total_input)). Ensure values are numeric: echo "$cache_read_tokens" | grep -E '^[0-9]+$'. Check for integer overflow if values are very large. Verify total_input includes all components.

Savings display showing 'tok saved' with zero or missing value

Check cacheread_tokens > 0 before calculating savings. Verify bc calculation: echo 'scale=0; 1000 * 0.9 / 1' | bc (should return 900). If bc unavailable, script uses integer math: savingstokens=$((cache_read_tokens * 9 / 10)). Test: cache_read=1000; savings=$((cache_read * 9 / 10)); echo $savings (should be 900). Verify savings_display is set: if [ -n "$savings_display" ]; then echo "Has savings"; fi.

Source citations

Add this badge to your README

Show that Cache Efficiency Monitor - Statuslines is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/statuslines/cache-efficiency-monitor.svg)](https://heyclau.de/entry/statuslines/cache-efficiency-monitor)

How it compares

Cache Efficiency Monitor - Statuslines side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

1 trust signal differ across this comparison (Submitter).

Next steps differ across entries — use the actions in the table below to copy install commands and source links per resource.

Field

A Claude Code statusline that reads prompt-cache token metrics from session JSON and renders a color-coded hit-rate bar with an estimated token-savings readout.

Open dossier

Real-time burn rate monitor showing cost per minute, tokens per minute, and projected daily spend to prevent budget overruns during Claude Code sessions.

Open dossier

Claude Code statusline that summarizes MCP server count, remote endpoint count, and credential-surface hints without printing tokens, secrets, local paths, or full endpoint URLs.

Open dossier

Real-time MCP server monitoring statusline showing connected servers, active tools, and performance metrics for Claude Code MCP integration

Open dossier
Next stepsDiffers
Trust
Review statusReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewed
Package trustPackage not verifiedPackage not verifiedPackage not verifiedPackage not verified
Source provenanceSource-backedSource-backedSource-backedSource-backed
SubmitterDiffersJSONbored
Install riskReview firstReview firstReview firstReview first
Notes Safety Privacy Safety Privacy Safety Privacy Safety Privacy
Brand
Categorystatuslinesstatuslinesstatuslinesstatuslines
Sourcesource-backedsource-backedsource-backedsource-backed
AuthorJSONboredJSONboredJSONboredJSONbored
Added2025-10-252025-10-252026-06-052025-10-16
Platforms
Claude Code
Claude Code
Claude Code
Claude Code
Source repo
Safety notesRuns a bash script on every status-line refresh (about every 2 seconds) that pipes session JSON through jq and bc; it is read-only and makes no network calls or file writes, but status-line commands execute with your shell's permissions, so review the script before adding it to settings.json.Runs as a Claude Code statusline command on every refresh and depends on the local shell environment; a failure only affects status rendering, not your session.This statusline is advisory and should not be used as the only MCP authorization review. It intentionally avoids printing full URLs, local paths, header names, tokens, or environment variable values. Remote endpoints and credential hints should trigger a separate review of protected resource metadata, scopes, and token handling.Runs as a Claude Code statusline command on every refresh and depends on the local shell environment; a failure only affects status rendering, not your session.
Privacy notesReads Claude Code session cost and token metrics from the status-line JSON on stdin and prints them to your terminal; no data leaves the machine, but the displayed figures may be visible to anyone viewing your screen or a terminal recording.Reads the Claude Code statusline JSON from stdin (model, workspace path, token usage) and renders it in the local terminal; it does not send data off-machine.The statusline reads Claude Code session metadata from stdin and prints only counts plus a generic credential hint. Avoid modifying the script to print full server URLs, headers, tokens, local config paths, or account identifiers on shared screens.Reads the Claude Code statusline JSON from stdin (model, workspace path, token usage) and renders it in the local terminal; it does not send data off-machine.
Prerequisites
  • Claude Code CLI installed and configured
  • Bash shell available (bash 4.0+ recommended for arithmetic operations)
  • jq command-line JSON processor (jq 1.6+ recommended for safe extraction with // defaults)
  • bc calculator (bc 1.07+ optional for precise savings calculations, script falls back to integer math)
  • Claude Code CLI installed and configured
  • Bash shell available (bash 4.0+ recommended for arithmetic operations)
  • jq command-line JSON processor (jq 1.6+ recommended for safe extraction with // defaults)
  • bc calculator (bc 1.07+ required for floating point calculations - script will fail without bc)
  • Claude Code CLI with statusline support.
  • jq installed locally.
  • MCP server metadata available in the Claude Code statusline input.
  • Claude Code CLI installed and configured with MCP support
  • Bash shell available (bash 4.0+ recommended for associative arrays and string manipulation)
  • jq command-line JSON processor (jq 1.6+ recommended for safe extraction with // defaults)
  • base64 command (usually pre-installed, required for base64 encoding/decoding of server data)
Install
mkdir -p .claude/statuslines
tmp="$(mktemp .claude/statuslines/mcp-auth-surface.sh.XXXXXX)"
cat > "$tmp" <<'EOF'
#!/usr/bin/env bash
set -u

input=$(cat)
if ! command -v jq >/dev/null 2>&1; then
  printf 'MCP auth: jq unavailable\n'
  exit 0
fi

servers=$(printf '%s' "$input" | jq -c '.mcp.servers // []' 2>/dev/null || printf '[]')
server_count=$(printf '%s' "$servers" | jq 'length' 2>/dev/null || printf '0')
remote_count=$(printf '%s' "$servers" | jq '[.[] | select((.url // .endpoint // "") | test("^https?://"))] | length' 2>/dev/null || printf '0')
credential_hint=$(printf '%s' "$servers" | jq '[.[] | select((.auth // .authorization // .headers // .env // null) != null)] | length' 2>/dev/null || printf '0')

if [ "$credential_hint" -gt 0 ]; then
  state="credentials: review"
else
  state="credentials: none shown"
fi

printf 'MCP auth: %s servers | %s remote | %s\n' "$server_count" "$remote_count" "$state"
EOF
chmod 700 "$tmp"
mv -f "$tmp" .claude/statuslines/mcp-auth-surface.sh
Config
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/cache-efficiency-monitor.sh",
    "refreshInterval": 2000
  }
}
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/burn-rate-monitor.sh",
    "refreshInterval": 500
  }
}
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/mcp-auth-surface.sh"
  }
}
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/mcp-server-status-monitor.sh",
    "refreshInterval": 2000
  }
}
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed
Open 4 picks in the interactive comparison tool

Related guides

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.