Skip to main content

Module snapshot

Module snapshot 

Source
Expand description

Resolve the pre-edit content for a PostToolUse event.

Lookup order for <root>/<session_id>/<tool_use_id>:

  1. snapshot file -> Content
  2. <id>.absent marker -> Absent (file did not exist before the edit)
  3. anything else -> tool_response.originalFile if present, else the edit strings for Edit/MultiEdit, else Unavailable.

The hook also writes <id>.after (and <id>.after.absent) at PostToolUse; see resolve_after.

Enums§

Before

Functions§

marker_path
<base>.<suffix>. Appends rather than replacing an extension: a tool_use_id like toolu_01.x would otherwise have its own suffix overwritten.
resolve
resolve_after
Post-edit content as captured by the hook at PostToolUse.
snapshot_path