Skip to content

Function: extractTouchedPathsFromHookInput() ​

ts
function extractTouchedPathsFromHookInput(hookPayload, workspaceRoot?): readonly string[];

Defined in: extract-touched-paths-from-hook-input.ts:268

Extracts and normalizes touched file paths, directory paths, and joined directory+glob patterns from Claude Code (PreToolUse/PostToolUse Read, Edit, MultiEdit, Write, NotebookEdit, Glob, Grep) and Antigravity (read_file, view_file, view_file_outline, view_code_item, edit_file, write_file, write_to_file, replace_file_content, multi_replace_file_content, find_by_name, grep_search) hook or transcript tool-step payloads (§7.1.1–§7.1.2).

Parameters ​

ParameterTypeDescription
hookPayloadunknownRaw hook input or transcript step object.
workspaceRoot?stringOptional workspace root directory used to normalize absolute paths into workspace-relative POSIX form.

Returns ​

readonly string[]

Frozen deduplicated array of normalized touched paths/globs in first-seen order.

Released under the MIT License.