Skip to content

Add ~/.local/bin to PATH for user-installed binaries#4

Merged
davidkreps merged 2 commits intomainfrom
fix-local-bin-path-v2
Feb 24, 2026
Merged

Add ~/.local/bin to PATH for user-installed binaries#4
davidkreps merged 2 commits intomainfrom
fix-local-bin-path-v2

Conversation

@davidkreps
Copy link
Copy Markdown
Owner

@davidkreps davidkreps commented Feb 23, 2026

Summary

  • Add ~/.local/bin to PATH in .zshrc so user-installed binaries (e.g. pip install --user, cargo install, claude) are available without manual PATH edits
  • Remove stale claude alias that pointed to ~/.claude/local/claude (old install path), which was causing zsh: no such file or directory errors after Claude Code moved to ~/.local/bin

Test plan

  • Open a new terminal and confirm claude resolves via which claude to ~/.local/bin/claude
  • Confirm no "no such file or directory" error when running claude
  • Run ./test.sh to verify no regressions

🤖 Generated with Claude Code

XDG-standard location used by pip --user, cargo, claude CLI, etc.
Guarded with existence check for graceful degradation on machines
where the directory doesn't exist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude Bot commented Feb 23, 2026

Claude finished @davidkreps's task in 1m 19s —— View job


PR Review

  • Gather context
  • Read changed files
  • Review against CLAUDE.md conventions
  • Post review feedback

LGTM. This is a clean, minimal, and correct change. Here's a checklist against the conventions in CLAUDE.md:

Convention Status Notes
Portability (macOS + Linux) ~/.local/bin is an XDG standard; used on both platforms
No hardcoded paths Uses $HOME
OS/tool guard [ -d "$HOME/.local/bin" ] silently skips if directory absent
Stdout-clean No echo or print side-effects
Trailing newline File ends with newline
install.sh consistency No new file — existing .zshrc symlink covers this
test.sh coverage Existing sourcing and hygiene tests cover this
Security No secrets; no external downloads
Idempotency PATH guard is a pure function of directory existence

One minor note: zsh/.zshrc ends with two blank lines (pre-existing, not introduced by this PR). The file hygiene test only checks for the presence of a trailing newline, so it passes — but you may want to trim the extra blank line at some point for tidiness.

The change follows the exact same pattern as the existing .npm-global/bin and VSCode PATH additions in the file. Positioning before .npm-global/bin is appropriate — user-local XDG binaries typically should take priority.

~/.local/bin is already on PATH, so no alias is needed.
The old ~/.claude/local/claude path caused "no such file or
directory" errors after Claude Code moved to ~/.local/bin.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude Bot commented Feb 23, 2026

Claude finished @davidkreps's task in 1m 7s —— View job


PR Review

  • Gather context
  • Read changed files
  • Review against CLAUDE.md conventions
  • Post review feedback

LGTM. Both commits are clean and correct. Here's the full checklist against CLAUDE.md conventions:

Convention Status Notes
Portability (macOS + Linux) ~/.local/bin is XDG standard; works on both platforms
No hardcoded paths Uses $HOME throughout
OS/tool guard [ -d "$HOME/.local/bin" ] silently skips if directory absent; no OS guard needed since ~/.local/bin is cross-platform
Stdout-clean No echo or print side-effects added
Trailing newline File ends with a newline (test passes)
install.sh consistency No new file — existing .zshrc symlink covers this
test.sh coverage No new symlinks; existing sourcing and hygiene tests cover this
Security No secrets; no external downloads
Idempotency PATH guard is a pure function of directory existence

Commit 1 (ad07abf): Adds ~/.local/bin to PATH with a directory existence guard. Positioned before .npm-global/bin, giving user-local XDG binaries appropriate priority. Follows the exact same pattern as the existing npm and VSCode PATH additions.

Commit 2 (2f8b9e8): Removes the stale claude alias. The removed guard was [ -x "$HOME/.claude/local/claude" ] && alias claude="..." — a conditional alias that was safe but now obsolete since the binary moved to ~/.local/bin (which is on PATH). Clean removal, no replacement needed.

Pre-existing minor notes (not introduced by this PR, not blocking):

  • zsh/.zshrc line 53: echo -ne '\e[5 q' runs unconditionally at shell init to set cursor shape. This emits an escape sequence to stdout on every shell start, which could technically interfere with scp/rsync (against the CLAUDE.md stdout rule). Worth a follow-up cleanup if that ever causes issues.
  • Both zsh/.zshrc and zsh/aliases.zsh end with two blank lines. Hygiene test passes (trailing newline present), but one blank line would be tidier.

@davidkreps davidkreps assigned davidkreps and unassigned davidkreps Feb 23, 2026
@davidkreps davidkreps merged commit 1d9ec38 into main Feb 24, 2026
2 checks passed
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.

1 participant