spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / sec-default / hooks / caught / past-users-caught.ts
15 lines · 566 BRaw
1import type Types from './types'
2
3/**
4 * The failure handler of a hook whose refusal is the run past the user tier
5 * (`classic.*`, `settings.read`, `tool.list`, `ui.log`), with no call on `$`.
6 *
7 * Where the failed hook had already continued, that call's answer comes
8 * back in its place.
9 *
10 * @param e the event's input
11 * @param next the handler's continuation
12 * @returns the run past the user tier, or the failed hook's last call
13 */
14export const pastUsersCaught = <E, R>(e: E, next: Types.CaughtNext<E, R>) =>
15 next.called ? next(e) : next.to(e, 'append')