Detect recent file interaction (Read/Write) and queue a one-shot workflow reminder that is injected on the next system prompt transform without mutating tool execution output.
createPostFileToolNudgeHook(options?) emits three handlers:
tool.execute.afterexperimental.chat.system.transformeventpendingSessionIds: Set<string> tracks sessions that recently ran file tools.FILE_TOOLS is the canonical set { 'Read', 'read', 'Write', 'write' }.options.shouldInject?: (sessionID) => boolean.session.deleted payload shapes (properties.sessionID and properties.info.id).tool.execute.after: if tool is file tool and has sessionID, add it to pendingSessionIds.experimental.chat.system.transform: if session has pending marker, remove it and append POST_FILE_TOOL_NUDGE (PHASE_REMINDER_TEXT) to output.system.shouldInject gate can consume without injecting.Read/Write events before the same transform collapse to one reminder due to set semantics.session.deleted event removes stale session IDs from the set.src/hooks/index.ts and activated in plugin lifecycle registration.output.system only, ensuring persisted file tool outputs remain untouched.inspect/edit loops).