Skip to content
Development
Hook

Hooks

What cc-fleet runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.

From plugin
cc-fleet
2133 skills1 hook
Install
> /plugin marketplace add ethanhq/cc-fleet
> /plugin install cc-fleet@ethanhq

Ships with cc-fleet. Installing the plugin gets these hooks.

What fires, and when

SessionStart

Fires once when a session begins, and again after a context compaction. It is where a plugin sets up its environment, or restores state the compaction dropped.

  • Matchesstartupnode "${CLAUDE_PLUGIN_ROOT}/hooks/check-cc-fleet.js"
Read hooks/hooks.json

Where it lives

  • hooks/check-cc-fleet.jsRunsGitHub
    Read the script
    #!/usr/bin/env node
    // cc-fleet plugin · SessionStart binary check.
    //
    // This plugin ships ONLY the skill (+ this hook). The
    // native `cc-fleet` Go binary is installed SEPARATELY onto PATH — a plugin
    // can't compile or reliably ship a native binary (no install-time hook; the
    // plugin root path is ephemeral and would break the apiKeyHelper pin baked
    // into provider profiles).
    //
    // If the binary is missing, the skill can still route a request but every CLI
    // call it makes will fail, so we nudge once at session start.
    //
    // Contract: SessionStart hooks must NEVER block the session — we always exit 0.
    //   - binary present  -> print nothing (no context noise)
    //   - binary missing  -> one-line install hint on stdout (Claude Code folds it
    //                        into the session context and shows the user)
    //
    // Node ships with Claude Code, so this runs on every platform; on win32 the
    // PATH probe honors PATHEXT (cc-fleet.exe / .cmd / …).
    "use strict";
    
    const fs = require("fs");
    const path = require("path");
    
    function onPath() {
      const dirs = (process.env.PATH || "").split(path.delimiter).filter(Boolean);
      const win = process.platform === "win32";
      // On Windows a bare name resolves through PATHEXT; elsewhere it's the file
      // itself (an executable bit is not required for "is it findable").
      const exts = win
        ? (process.env.PATHEXT || ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean)
        : [""];
      for (const dir of dirs) {
        for (const ext of exts) {
          const candidate = path.join(dir, "cc-fleet" + ext);
          try {
            if (fs.statSync(candidate).isFile()) return true;
          } catch {
            // not here — keep looking
          }
        }
      }
      return false;
    }
    
    if (!onPath()) {
      console.log(
        "cc-fleet binary not found on PATH — the cc-fleet skills need it to spawn provider teammates/subagents. Install: go install github.com/ethanhq/cc-fleet/cmd/cc-fleet@latest  (or grab a release / see https://github.com/ethanhq/cc-fleet#install)."
      );
    }
    process.exit(0);
    

Read the script before you install anything that runs on your machine. This is the one part of a plugin that acts without being asked.

Ships withcc-fleet

🚢 Run Claude Code's ⚙️ Dynamic Workflows, 👥 Agent Teams & ⚡ Subagents on any third-party model — DeepSeek · GLM · Kimi · Qwen … or your Codex subscription. No Anthropic subscription needed. | 🚢 让 Claude Code 的 ⚙️ Dynamic Workflow、👥 Agent Team、⚡ Subagent 用上任意第三方模型 — DeepSeek · GLM · Kimi · Qwen…… 或你的 Codex 订阅,无需 Claude 订阅

Get the whole plugin
Stats
213
Stars
29
Forks
Maintained
Maintenance
Go
Language
Apache-2.0
License
1mo ago
Last commit
3mo ago
Created

Repo: ethanhq/cc-fleet