Skip to content

guidanceOnce() throttle fails on Windows Git Bash — use session ID file instead of process.ppid #336

@fuleinist

Description

@fuleinist

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:

  1. ****: On startup, write a session ID file (e.g. ) to or a temp dir.
  2. ****: 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions