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 / tests / fixtures / caught / rechecked.ts
19 lines · 609 BRaw
1import type { EventResult, TargetTier, TraceEntry } from 'claude-code'
2
3import { unchecked } from './unchecked.js'
4
5/**
6 * The `tool.check` hook's `next`: the call settles as the trace lists, and
7 * `to` answers the run past the user tier.
8 *
9 * @param trace the run beneath, nearest the caller first
10 * @param past what the run past the user tier settles to
11 * @returns the stand-in
12 */
13export const rechecked = (
14 trace: readonly TraceEntry<'tool.check'>[],
15 past: EventResult<'tool.check'>,
16) =>
17 Object.assign(unchecked(trace), {
18 to: (_e: unknown, _tier: TargetTier) => Promise.resolve(past),
19 })