Skip to content

resolve-paths.sh cannot resolve a project root on any host that does not set CLAUDE_PROJECT_DIR #411

Closed

Description

@fdaviddpt

Deferred out of #407 with a stated reason, and now unblocked as the next piece of Codex work. #406 is the epic.

The gap

pipeline/host.py reads the transcript path the host hands over, and scripts/resolve-paths.sh reads the plugin root under either name. The third field on the same payload -- cwd -- is still unused, so the project root is resolved from CLAUDE_PROJECT_DIR and from nothing else.

That variable is set by Claude Code. Codex does not set it, and Gemini CLI documents no environment variables for command hooks at all. So on any host but the one this plugin grew up on, resolve-paths.sh:121 finds nothing, the .claude/remember layout branch below it does not match a marketplace install, and resolution fails outright. Every hook then takes its || exit 0 and the plugin is silently inert.

This is the last resolution seam still reachable only through a Claude-specific variable.

Why it was deferred, and what has to be handled

scripts/session-start-hook.sh:75 sources resolve-paths.sh. HOOK_STDIN is not captured until line 124. The resolver runs before stdin has been read, so it cannot consult a field that has not arrived.

Neither obvious escape is free:

The judgement this needs

Where the nested-summarizer guard goes, and whether the hoist is the right shape at all. The obvious answer -- guard the capture with the same REMEMBER_NESTED_SUMMARIZER test -- duplicates a condition that currently lives in exactly one place, and this repo has a stated preference for one copy. An alternative worth weighing before writing code: have the hook capture stdin, export the fields, and source the resolver afterwards, leaving the resolver reading only the environment as it does today. That keeps the resolver stdin-free and moves nothing into it, at the cost of reordering two lines in each hook.

Whoever takes this should say which shape they chose and why, and is expected to disagree with the framing above if it is wrong.

Precedence

CLAUDE_PROJECT_DIR, then the stdin cwd, then the existing .claude/remember layout derivation, then the existing failure. A stdin cwd that disagrees with a set CLAUDE_PROJECT_DIR must not silently win -- the environment variable is the more specific signal on the host that sets it.

What this cannot establish

No Codex or Gemini binary is installed on the maintainer's machine. A test can unset CLAUDE_PROJECT_DIR and supply cwd on stdin, and that is a real test of the precedence chain -- but it simulates the host rather than exercising one. The nested-summarizer startup cost, by contrast, is measurable here and should be measured rather than reasoned about.

Say which claims are observed and which are reasoned. Do not describe this as verified Codex support.

Prior context

Metadata

Metadata

Assignees

Labels

priority:high

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions