Skip to content

autoplan: phase-publication-hook ownPath() rejects forward-slash / MSYS absolute paths on Windows #2986

Closed

Description

@CharlesBerg85

Summary

On Windows, /autoplan's publication hook fails with Native parent project directory is unavailable. (or Native parent hook identity is unavailable.) whenever CLAUDE_PROJECT_DIR, cwd or transcript_path is spelled with forward slashes or in MSYS/Git Bash form.

Where

autoplan/bin/phase-publication-hook.ts (v1.89.0.0):

const ownPath = (value: unknown): value is string =>
  typeof value === 'string' && path.isAbsolute(value) && path.normalize(value) === value;

and its callers, e.g. if (!ownPath(projectCwd)) fail('Native parent project directory is unavailable.');

Why

On win32, path.normalize rewrites separators, so the equality check rejects valid absolute paths:

input path.win32.normalize ownPath
C:/Users/x/proj C:\Users\x\proj false
/c/Users/x/proj \c\Users\x\proj false
C:\Users\x\proj C:\Users\x\proj true

Hooks run under Git Bash on Windows commonly receive the forward-slash or MSYS spellings, so the hook refuses and /autoplan can't publish.

Suggested fix

Compare canonical forms instead of requiring the input to already be normalized, e.g. path.isAbsolute(v) && !path.normalize(v).split(path.sep).includes('..'). Or normalize before use and reject only on .. traversal. Add a win32 test with forward-slash input.

Environment

Windows 11, Git Bash, Claude Code desktop, gstack v1.89.0.0.

Activity

  1. CharlesBerg85 commented on Oct 1, 2026

    @CharlesBerg85
    ContributorAuthor

    Reproduced on Windows 11, Git Bash, bun 1.3.14, gstack 1.89.0.0 (06ed920). The hook gets CLAUDE_PROJECT_DIR=C:/..., while cwd, transcript_path and every journal cwd are C:\.... Fixing ownPath alone isn't enough: lib/claude-public-transcript.ts also compares cwd as raw strings (owned root check, origin seeding, admission). A fix that folds separators and drive-letter case on both sides, on win32 only, without path.resolve (so .. and . are still rejected), gets a real session journal to ready. It also needs #3009. The init argv has the same problem: gstack-paths prints /c/Users/... and the hook rewrote that to \c\Users\....

    Fixed with tests in #3010, along with the other blockers a real end-to-end Windows run hit: Desktop worktree ownership, CRLF plans, and gbrain-rendered phase entries.

  2. capy-ai commented on Oct 2, 2026

    @capy-ai
    Contributor

    Fixed in v1.91.13.0 (#3013, merged as f30b7b7): Windows forward-slash and MSYS (/c/...) spellings are folded before validation in the hook and the transcript reader, and '..' is still rejected. Run /gstack-upgrade, then start a new Claude Code session. Thanks for the report. Reopen if you still see it after upgrading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions