Problem
On Windows with Git Bash, each hook invocation spawns a new process, making unique per call. This breaks the marker in , causing guidance to be injected on every tool call instead of once per session.
Proposed Solution
Use a session-scoped file written during instead of to identify the session:
- ****: On startup, write a session ID file (e.g. ) to or a temp dir.
- ****: Read this file on init to get a stable that persists across hook invocations within the same session.
Option: detect the new shell spawn by checking if a session marker file already exists — if it does, reuse the same ID rather than creating a new one each call.
Use Case
Users on Windows Git Bash get spammed with "use ctx_execute instead" reminders on every tool call (200+ chars × 50+ calls), breaking multi-step agent tasks.
Fixes #298
Problem
On Windows with Git Bash, each hook invocation spawns a new process, making unique per call. This breaks the marker in , causing guidance to be injected on every tool call instead of once per session.
Proposed Solution
Use a session-scoped file written during instead of to identify the session:
Option: detect the new shell spawn by checking if a session marker file already exists — if it does, reuse the same ID rather than creating a new one each call.
Use Case
Users on Windows Git Bash get spammed with "use ctx_execute instead" reminders on every tool call (200+ chars × 50+ calls), breaking multi-step agent tasks.
Fixes #298