Skip to content

v7.33.0

Choose a tag to compare

@github-actions github-actions released this 30 Nov 22:45
· 2 commits to main since this release
4b76ee2

Changed

  • Both write guards are now wired in exec form, as the Stop guard has been since 6.12.0, so no shell sits between
    Claude Code and either guard (CORE-625).
    The shipped .claude/settings.json wires protect-trusted-paths.cjs and
    enforce-writes-scope.cjs as "command": "node" with "args": ["${CLAUDE_PROJECT_DIR}/.claude/hooks/<guard>.cjs"]
    and "onFailure": "block", under the unchanged matcher. In the old shell form,
    node "${CLAUDE_PROJECT_DIR}"/.claude/hooks/<guard>.cjs, the placeholder was substituted into a sh -c string
    (Git Bash or PowerShell on Windows), so a project path containing ", a backtick, $ or \ could stop the guard
    from starting, or run text from the directory name. In exec form Claude Code starts node directly with the path as
    one argument. What the guards decide does not change, and no hook script changed. hook-wiring.test.cjs now spawns
    the committed entries without a shell on every platform (it no longer skips the guards on Windows, though CI runs on
    Linux only). Each entry denies a trusted-doc write from a subdirectory, and also from a project whose path holds a
    space, $, a backtick and ". The negative controls: a relative args path does not start, the old shell-form
    string fails the pin, and in that project the shell form does not start, while with only a space in the path it does.
    pharn/LIMITS.md §7 replaces the path-character bound with the exec-form bullet. A project path containing \ is
    still not claimed, because the guards' own path folding reads a backslash as a separator.

    Exec form needs Claude Code 2.1.139 or later, the release whose changelog adds hook args. onFailure came in
    2.1.295, so every client that blocks on a failed guard also has args. An older client was not measured. If it
    ignores args, it starts bare node, which reads the hook payload on stdin as a script and exits 1 (measured with
    Node 24.13.1), and the write goes through. On such a client, upgrade Claude Code, or keep the shell-form lines.

    Existing installs: pharn update first, then the wiring; roll back in the reverse order. pharn update never
    edits settings.json, so an install keeps its shell-form lines, which still work, with the path bound above. Measured
    with pharn-cli 0.23.0's own diffHookWiring (its src/lib/hook-wiring.ts) on a 7.32.2 settings.json against this
    one: pharn status reports the hook wiring missing for both guards, prints a REPLACE note showing your line and
    the shipped one for each, and pharn status --strict exits 1 until both are replaced. A pre-7.3.0 line without
    onFailure gets the same two REPLACE lines, so one edit per guard clears both changes. For an install made on 6.0.0
    this is the fourth hand edit of settings.json: anchoring (6.1.0), the Stop entry (6.12.0), onFailure (7.3.0),
    and this. No other hand edit is in this release.

    Why minor: the shipped wiring changed, and every install must copy it again for pharn status --strict to pass.
    Nothing an existing install runs stops working, so it is not major. MIN_CLI is unchanged, because pharn-cli writes
    settings.json only when it is absent. The settings change and the LIMITS.md edit were applied by the maintainer
    outside the agent loop, before the build's reconciliation anchor (L68, L88). Record:
    .dev/features/guard-exec-wiring/.