Skip to content

Open docs linked from a plan #1443

Description

@bendrucker

A plan often links supporting documents beside it, like [evidence](foo-evidence.md). Clicking one in plan review returns 404. The link resolves against the review root, which is the working directory, while the plan itself lives in ~/.claude/plans/.

Cause

Claude Code's ExitPlanMode input carries both plan and planFilePath, and planFilePath is an absolute path under ~/.claude/plans/. The file is written about a second before the hook fires and matches the inline plan exactly. apps/hook/server/index.ts reads only Gemini's plan_filename and plan_path and drops the Claude Code field.

Proposal

Thread planFilePath into ServerOptions, trusted only when the file on disk holds the plan under review. The path is model-generated tool input. Without that content check an injected agent could name ~/.ssh/plan.md and pick its own containment root.

Then let getTrustedBaseDir accept the attested plan directory as a base without promoting it to a root. Sibling documents the plan names become readable. The rest of ~/.claude/plans/ stays unreachable.

#1437 moves containment into isPathAllowed in packages/shared/doc-resolve.ts. Part of the intent there was to enable this feature by consolidating duplicate path authorization checks.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions