{"version":"2.1.328","anchor":"spawn-runner-hook-can-pass-a-user-message-and-session-labels","canonical_anchor":"spawn-runner-hook-can-pass-a-user-message-and-session-labels","heading":"Self-hosted runners gain --hook-label and hook user messages","tier":"use","area":"Self-Hosted Runner","scope":"org","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.328\/e\/spawn-runner-hook-can-pass-a-user-message-and-session-labels","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.328","markdown":"### Self-hosted runners gain --hook-label and hook user messages\n\nSelf-hosted runners can route sessions to hooks by label with --hook-label, pass labels as CLAUDE_RUNNER_META_ variables, and relay a hook message\n\n**Unclear.** The marker a hook's line must start with is not known, so it is not clear how a hook marks its message.\n\n**What**\n\nA self-hosted runner is a machine you run yourself that picks up Claude Code sessions. A hook is a script the runner calls at set points; the spawn-runner hook runs when a session starts. This release adds label routing and a way for that hook to talk to the user.\n\n- `--hook-label <label>=<values>`: a new option taking words (`label=words`) or a range (`label=low..high`). Each label is checked against the session's own label values, and the hook is skipped for sessions with other values. A value outside the allowed set raises an error.\n\n- Label variables: accepted values are passed to the hook as `CLAUDE_RUNNER_META_<LABEL>` environment variables, and the spawn-runner hook also receives the session's labels.\n\n- User message: a hook output line that starts with a marker prefix is now relayed to the session's user. Lines containing control characters or anything that looks like a secret are withheld, and a log line says so.\n\n- `--min-idle`: `--hook-label` cannot be used with `--min-idle`, which must be 0. The error explains that a standby runner ignores the labels of the session it takes.\n\n**Why**\n\nRunner operators can send sessions to the right hook by label and give users feedback from that hook. If you already keep warm idle runners with `--min-idle`, you need to choose between that and label routing.\n\n- Area: Self-Hosted Runner\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 2\/5\n- Scope: org\n- Heads-up: no"}