setup

A setup command that connects the idle-guard plugin to Claude Code’s status bar, the line that displays session information. It first checks any existing status-bar command and verifies whether it can safely be extended.

In plain words
What is it for?
Use it to configure idle-guard’s status indicator in Claude Code and handle conflicts with an existing status-bar script or program.
Why use it?
It helps avoid replacing or breaking an existing status-bar integration when adding idle-guard’s indicator.

Command

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.

agentmods
npx agentmods add commands/raulk/idle-guard/setup
Clone the repo
git clone --depth 1 https://github.com/raulk/idle-guard
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 840 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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 $0.00012 $0.00840
Opus 5 $0.00006 $0.00420
Sonnet 5 $0.00002 $0.00168
Haiku 4.5 $0.00001 $0.00084

Measured yesterday against content hash fed6604ae427, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

setup scanned grade B 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 yesterday.

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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

1. Read `~/.claude/settings.json`.
commands/setup.md · 79 lines

What it actually says

You are configuring the idle-guard plugin's status bar integration.

Your task

  1. Read ~/.claude/settings.json.

  2. Find the installed path of the idle-guard status script:

    ls ~/.claude/plugins/cache/*/idle-guard/*/hooks/status 2>/dev/null \
      || ls ~/.claude/plugins/cache/*/*/idle-guard/*/hooks/status 2>/dev/null
    

    Use the path of the most recently installed version (newest directory by modification time). Call this $STATUS_SCRIPT.

  3. Inspect settings.statusLine.command (the field may be absent):

    Case A — an existing statusLine command is present:

    Investigate what it does before touching it:

    a. Read the command string and identify any plugin or binary being invoked (e.g. a bun/node script, a shell script, a compiled binary).

    b. If it invokes a plugin, locate the plugin's installed source and read its code to understand how it works — specifically whether it provides a documented and actually implemented integration point for appending extra output (e.g. a CLI flag, a config field, a hook). Do not trust documentation or flag names alone; verify the integration point is wired up in the code that runs. Dead flags and unimplemented features are common.

    c. If a working integration point exists, use it. If none exists, use the universal fallback: run $STATUS_SCRIPT as a separate command after the existing command and append its label as a plain output line.

    In either case, the final command must:

    • Read stdin once into a variable (INPUT=$(cat)) and pass it to any command that needs it, since stdin can only be consumed once.
    • Extract transcript_path: TRANSCRIPT=$(printf '%s' "$INPUT" | jq -r '.transcript_path // empty')
    • End with ; true so the command always exits 0. A non-zero exit code causes Claude Code to hide the entire status bar silently.

    The universal fallback structure (fill in real paths):

    bash -c 'INPUT=$(cat); TRANSCRIPT=$(printf "%s" "$INPUT" | jq -r ".transcript_path // empty"); printf "%s" "$INPUT" | <existing-command>; "$STATUS_SCRIPT" "$TRANSCRIPT" | jq -r ".label // empty" | grep -v "^$"; true'
    

    The new command must be a single bash -c '...' string. Write the actual resolved path to $STATUS_SCRIPT, not a shell variable reference, since settings.json does not expand environment variables.

    Case B — no statusLine present:

    Set a minimal statusLine that runs only the status script:

    {
      "type": "command",
      "command": "bash -c 'INPUT=$(cat); TRANSCRIPT=$(printf \"%s\" \"$INPUT\" | jq -r \".transcript_path // empty\"); /real/path/to/idle-guard/hooks/status \"$TRANSCRIPT\" | jq -r \".label // empty\" | grep -v \"^$\"; true'",
      "refreshInterval": 60
    }
    

    In both cases (A and B), set "refreshInterval": 60 on the statusLine object. idle-guard tracks elapsed idle time, so the status bar must refresh on a timer to show the warning as soon as the cache expires — not only when Claude responds to a message.

  4. Write the updated settings.json back.

  5. Report exactly what you changed and, if you investigated a plugin, what you found about its integration surface.

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. yesterday First seen · 79 lines · 12 tokens per session scan B fed6604ae427

Subscribe to this mod's changes

setup is a command published in the GitHub repository raulk/idle-guard (2 stars, last pushed 4mo ago), licensed MIT. It adds 12 tokens to every session and 840 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.