SessionStart

A startup hook that runs a repair command when a coding session starts, resumes, is cleared, or is compacted. A hook is an automatic action triggered by one of these session events.

In plain words
What is it for?
Use it to trigger the plugin's repair command during session lifecycle events such as startup, resume, clear, and compact.
Why use it?
It helps run the same repair step after session changes without requiring a manual command. The command looks for the relevant cached plugin and exits quietly if it is unavailable.

Hook

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 hooks/narcooo/ccbar/session-start
Clone the repo
git clone --depth 1 https://github.com/Narcooo/ccbar
Per session not measured What this adds to a session before it is invoked.
When invoked not measured Not applicable: nothing here is loaded into a session.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Security

Grade B, and why

SessionStart 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 2d ago.

A static scan of the commands this hook runs, not an audit. A hook is shell that executes on your machine at the event it names, which is why every command in it is printed with what was found.

Reads agent configuration directoriesmediumAgent snooping

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

"command": "sh -lc 'PLUGIN_DIR=$(find \"$HOME/.claude/plugins/cache\" -mindepth 3 -maxdepth 3 -type d -path \"*/ccbar/*\" 2>/dev/null | sort | tail -n 1); [ -n \"$PLUGIN_DIR\" ] || exit 0; exec node \"$PLUGIN_DIR/dist/cl
hooks/hooks.json · 40 lines

What it actually says

{
  "SessionStart": [
    {
      "matcher": "startup",
      "hooks": [
        {
          "type": "command",
          "command": "sh -lc 'PLUGIN_DIR=$(find \"$HOME/.claude/plugins/cache\" -mindepth 3 -maxdepth 3 -type d -path \"*/ccbar/*\" 2>/dev/null | sort | tail -n 1); [ -n \"$PLUGIN_DIR\" ] || exit 0; exec node \"$PLUGIN_DIR/dist/cli.js\" repair'"
        }
      ]
    },
    {
      "matcher": "resume",
      "hooks": [
        {
          "type": "command",
          "command": "sh -lc 'PLUGIN_DIR=$(find \"$HOME/.claude/plugins/cache\" -mindepth 3 -maxdepth 3 -type d -path \"*/ccbar/*\" 2>/dev/null | sort | tail -n 1); [ -n \"$PLUGIN_DIR\" ] || exit 0; exec node \"$PLUGIN_DIR/dist/cli.js\" repair'"
        }
      ]
    },
    {
      "matcher": "clear",
      "hooks": [
        {
          "type": "command",
          "command": "sh -lc 'PLUGIN_DIR=$(find \"$HOME/.claude/plugins/cache\" -mindepth 3 -maxdepth 3 -type d -path \"*/ccbar/*\" 2>/dev/null | sort | tail -n 1); [ -n \"$PLUGIN_DIR\" ] || exit 0; exec node \"$PLUGIN_DIR/dist/cli.js\" repair'"
        }
      ]
    },
    {
      "matcher": "compact",
      "hooks": [
        {
          "type": "command",
          "command": "sh -lc 'PLUGIN_DIR=$(find \"$HOME/.claude/plugins/cache\" -mindepth 3 -maxdepth 3 -type d -path \"*/ccbar/*\" 2>/dev/null | sort | tail -n 1); [ -n \"$PLUGIN_DIR\" ] || exit 0; exec node \"$PLUGIN_DIR/dist/cli.js\" repair'"
        }
      ]
    }
  ]
}
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. 2d ago First seen · 40 lines scan B c5ddda874967

Subscribe to this mod's changes

SessionStart is a hook published in the GitHub repository Narcooo/ccbar (23 stars, last pushed 1mo ago), licensed MIT. Its token cost is not measured: a hook is shell that never enters the context. 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-30.