Skip to content

fix(diffr): faulty detection of claude on PATH - #1071

Merged
sidkmenon merged 4 commits into
mainfrom
sm/diffr-claude-on-path
Oct 9, 2026
Merged

sidkmenon merged 4 commits into
mainfrom
sm/diffr-claude-on-path

Conversation

@sidkmenon

@sidkmenon sidkmenon commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the onboarding gaps from testing curl -fsSL https://install.dev.fast/diffr | sh end to end.

claude not on PATH

  • config init treated Claude Code as installed when ~/.claude existed, then ran claude. If claude wasn't on PATH, setup died with could not run claude plugin marketplace list --json: No such file or directory.
  • Now Claude Code is offered only when claude is on PATH. Without it, setup prints one line saying it skipped the Claude Code plugin and how to add it later, then finishes successfully.
  • If the plugin was recorded as installed and claude is now gone, the record is left alone.
  • --json lists Claude Code only when claude is on PATH, and the detected field is gone.

Re-running the install script never re-ran setup

  • Before, a re-run only swapped the binary when diffr already existed. So installing Claude Code after diffr, or retrying a failed setup, did nothing.
  • Now install.sh runs config init every time. Its defaults are the current state.
  • diffr upgrade sets DIFFR_SKIP_SETUP=1, because it upgrades the plugins itself.

/diffr couldn't find diffr when Claude Code's PATH didn't include ~/.local/bin

  • I reproduced this: it failed with ENOENT … install diffr with: curl …, and following that advice changed nothing.
  • It happens when Claude Code is installed by Homebrew or npm and runs in a terminal opened before install.sh changed PATH, or when the PATH prompt was declined.
  • For script installs, config init now sets the plugin's diffr option to the absolute path, via claude plugin configure diffr@devfast --values-stdin. Homebrew, Cargo and Whiteboard copies keep diffr, since their real paths change with each version and they're on PATH anyway.
  • The plugin's could-not-run error now also says to run diffr config init.

Smaller fixes

  • install.sh died on ${SHELL##*/} under set -u when SHELL was unset (dash, as in Docker or CI). It now uses ${SHELL:-}.
  • For a shell it doesn't recognise, install.sh prints the exact line to add to PATH.
  • A failed interactive setup now ends with "Run diffr config init to try again".

Testing

  • cargo test. The CLI tests cover the missing-claude cases and check that the absolute path reaches plugin configure.
  • Ran install.sh locally:
    • under dash with no SHELL and no terminal: it completes;
    • re-run in a pty: setup starts;
    • with DIFFR_SKIP_SETUP=1: setup doesn't start.
  • Ran interactive config init with no claude on PATH. It skips, finishes, and exits 0.
  • In an isolated CLAUDE_CONFIG_DIR, claude plugin configure --values-stdin sets the option for an installed plugin.

https://claude.ai/code/session_01HTHD79i4QdthzVCkDZ26gd

`config init` counted Claude Code as installed when ~/.claude existed,
then ran `claude`. With the folder there but `claude` off PATH (the
desktop app alone, or a fresh install in an old shell), setup failed
with "could not run claude plugin marketplace list --json: No such file
or directory". Claude Code is now found only when `claude` is on PATH,
and choosing it anyway says how to fix it.

Claude-Session: https://claude.ai/code/session_01HTHD79i4QdthzVCkDZ26gd
Agent-Session: cac10624-9b5a-46ba-b261-1e0359c62796
Claude Code is offered only when `claude` is on PATH. Without it,
`config init` says it skipped the plugin and why, leaves out the agents
question, and finishes. A plugin recorded as installed is left alone
when `claude` is gone, since there is nothing to remove it with.

Claude-Session: https://claude.ai/code/session_01HTHD79i4QdthzVCkDZ26gd
Agent-Session: cac10624-9b5a-46ba-b261-1e0359c62796
Agent-Session: 8881e3f3-a916-4405-9706-bb6e3a2f193d
@sidkmenon sidkmenon changed the title fix(diffr): find Claude Code by its claude command fix(diffr): skip Claude Code in config init when claude is not on PATH Oct 9, 2026
- install.sh runs `config init` on every run, not only the first, so
  running it again repairs or changes the setup. `diffr upgrade` sets
  DIFFR_SKIP_SETUP, since it upgrades the plugins itself.
- install.sh no longer stops at an unset SHELL (dash under `set -u`),
  and prints the line to add to PATH for a shell it does not know.
- `config init` sets the Claude Code plugin's `diffr` option to this
  diffr's path for a script install, so /diffr works when Claude Code's
  PATH lacks ~/.local/bin.
- A failed setup ends saying to run `diffr config init` again, and the
  plugin's could-not-run error names `diffr config init` as well as
  installing.

Claude-Session: https://claude.ai/code/session_01HTHD79i4QdthzVCkDZ26gd
Agent-Session: cac10624-9b5a-46ba-b261-1e0359c62796
Agent-Session: 8881e3f3-a916-4405-9706-bb6e3a2f193d
Agent-Session: 5fddfa2a-e3c2-401d-bf87-2f6650ad81d0
@sidkmenon sidkmenon changed the title fix(diffr): skip Claude Code in config init when claude is not on PATH fix(diffr): onboarding that recovers, with or without claude on PATH Oct 9, 2026
Claude-Session: https://claude.ai/code/session_01HTHD79i4QdthzVCkDZ26gd
Agent-Session: cac10624-9b5a-46ba-b261-1e0359c62796
Agent-Session: 8881e3f3-a916-4405-9706-bb6e3a2f193d
Agent-Session: 5fddfa2a-e3c2-401d-bf87-2f6650ad81d0
@sidkmenon
sidkmenon merged commit 127ff9b into main Oct 9, 2026
10 checks passed
@sidkmenon
sidkmenon deleted the sm/diffr-claude-on-path branch October 9, 2026 18:18
@sidkmenon sidkmenon changed the title fix(diffr): onboarding that recovers, with or without claude on PATH fix(diffr): faulty detection of claude on PATH Oct 9, 2026
sidkmenon added a commit that referenced this pull request Oct 9, 2026
Bumps diffr to 0.1.19, the same set of files as #1069. This ships
#1071's onboarding fixes to `install.sh` users.

https://claude.ai/code/session_01HTHD79i4QdthzVCkDZ26gd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants