Skip to content

fleet-state reads $HOME as project context when the shell and the OS spell it differently #1982

Description

@kyle-sexton

What

plugins/claude-ops/skills/plugins/scripts/fleet-state.sh excludes $HOME from
project context — that directory is USER scope, and reading
$HOME/.claude/settings.json as the project map duplicates the user map. The
exclusion does not hold.

It compares the native path pwd -W reports against $HOME exactly as the
environment carries it. Those are two spellings of one directory, and an MSYS
mount alias has no drive letter for the normalizer to reconcile: $HOME=/tmp/x
never equals the C:/Users/…/Temp/x that pwd -W reports for the same place.
The comparison fails, PROJECT_ROOT is set to $HOME, and the thing the block
exists to prevent happens silently.

Split out of #1972, which found it in the same sweep and correctly flagged it as
a different root cause from that ticket's two ruff failures.

Reproducing

plugins/claude-ops/skills/plugins/scripts/fleet-state.test.sh already covers
it — the case named home exclusion: $HOME with .claude is user scope, not project context reports expected: null, actual: false.

false rather than true is not the exclusion partly working: it means a
project root WAS resolved (so the exclusion did not fire) and then failed to
match the record's own spelling. Both halves are the same defect.

Why CI never caught it

The case is load-bearing only where mktemp -d yields a path the shell and the
OS spell differently — Git Bash. On the Linux runner both sides already agree,
so the case passes there whether or not the exclusion works. A green
plugin-gate is not evidence about this behavior, which is why it survived.

Fix

Spell both sides with the same command before comparing. Normalizing harder
cannot work: the two inputs disagree before the normalizer sees them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions