Skip to content

feat(fish): add clrc and clwrc abbreviations for remote-control - #1211

Merged
shunkakinoki merged 2 commits into
mainfrom
feat/fish-clrc-clwrc-abbreviations
Mar 19, 2026
Merged

feat(fish): add clrc and clwrc abbreviations for remote-control#1211
shunkakinoki merged 2 commits into
mainfrom
feat/fish-clrc-clwrc-abbreviations

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Mar 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add clrc abbreviation → _clrc_function (stable claude remote-control)
  • Add clwrc abbreviation → _clwrc_function (remote-control in workspace git worktree)
  • Register both functions in the fish config function file list

Test plan

  • clrc runs claude remote-control with stable realpath binary
  • clwrc runs claude remote-control --worktree with stable realpath binary
  • Home-manager switch deploys both function files

🤖 Generated with Claude Code


Summary by cubic

Add fish abbreviations clrc and clwrc to run claude remote-control via a stable binary path (using realpath), with clwrc supporting --worktree. Also hardens the repo updater to fall back to git pull --rebase when a fast-forward isn’t possible.

  • New Features

    • clrc_clrc_function; runs claude remote-control via node using realpath of claude.
    • clwrc_clwrc_function; adds --worktree.
    • Registers both functions in home-manager fish config.
  • Bug Fixes

    • In scripts/update-local-binaries.sh, try git pull --ff-only, then fall back to git pull --rebase on diverged branches.

Written for commit e4b1d4d. Summary will update on new commits.

shunkakinoki and others added 2 commits March 20, 2026 01:02
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 7b75defaf526
Copilot AI review requested due to automatic review settings March 19, 2026 16:07
@mesa-dot-dev

mesa-dot-dev Bot commented Mar 19, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the developer experience by adding convenient Fish shell abbreviations for interacting with Claude remote-control, allowing for quick access to both stable and worktree versions. Additionally, it refines the repository update script to handle Git pulls more robustly, ensuring smoother integration of upstream changes by attempting a fast-forward merge before resorting to a rebase.

Highlights

  • New Fish Shell Abbreviations: Introduced clrc and clwrc as new abbreviations for claude remote-control commands within the Fish shell configuration. clrc is for the stable version, and clwrc is for the worktree version.
  • New Fish Function File: Added a new Fish function file, _clwrc_function.fish, which defines the logic for running claude remote-control --worktree with a stable binary.
  • Improved Git Pull Strategy: Modified the update-local-binaries.sh script to enhance its git pull behavior. It now attempts a fast-forward only pull (--ff-only) first, and if that fails, it falls back to a rebase pull (--rebase) to integrate changes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mesa-dot-dev

mesa-dot-dev Bot commented Mar 19, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Added clrc and clwrc fish shell abbreviations for claude remote-control.

What changed?

  • Added clrc abbreviation → _clrc_function (stable claude remote-control)
  • Add clwrc abbreviation → _clwrc_function (remote-control in workspace git worktree)
  • Registered both functions in the fish config function file list

Description generated by Mesa. Update settings

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces two new fish shell abbreviations, clrc and clwrc, for interacting with claude remote-control. The implementation is straightforward, adding the abbreviations and their corresponding function definitions. I've suggested an improvement to the new fish function to make it more robust by adding error handling for cases where the claude command might not be found.

Additionally, there's an unrelated change to the update-local-binaries.sh script which modifies the git pull strategy. While the intention to use --ff-only and then --rebase is good, the rebase operation can hang the script if conflicts occur. I've provided a suggestion to make this process non-interactive and prevent the script from getting stuck.

Overall, the changes are good, but addressing these points will improve the robustness of the shell functions and scripts.

Comment on lines +242 to +246
if ! (cd "$repo_dir" && git pull --rebase 2>&1); then
log_error " Git pull failed"
FAILURES+=("$repo_name (git pull failed)")
return 1
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

git pull --rebase can enter an interactive state if there are merge conflicts, which would cause this script to hang. To make the script more robust, you should handle this case by aborting the rebase if the pull fails. This ensures the script can continue or exit gracefully without requiring user intervention.

Suggested change
if ! (cd "$repo_dir" && git pull --rebase 2>&1); then
log_error " Git pull failed"
FAILURES+=("$repo_name (git pull failed)")
return 1
fi
if ! (cd "$repo_dir" && git pull --rebase 2>&1); then
log_error " Git pull with rebase failed. Aborting rebase..."
# Abort any rebase that might have been started to avoid leaving the repo in a bad state.
(cd "$repo_dir" && git rebase --abort &>/dev/null) || true
FAILURES+=("$repo_name (git pull failed)")
return 1
fi

Comment on lines +7 to +8
set -l claude_real (realpath (which claude))
node $claude_real remote-control --worktree $argv

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current implementation lacks robust error handling. If the claude command is not found, which claude will fail, leading to a cascade of errors from realpath and node, which can be confusing for the user. It's better to explicitly check if the command exists and provide a single, clear error message.

  set -l claude_path (command -v claude)
  if test -z "$claude_path"
    echo "Error: 'claude' command not found." >&2
    return 1
  end
  set -l claude_real (realpath "$claude_path")
  node "$claude_real" remote-control --worktree $argv

@coderabbitai

coderabbitai Bot commented Mar 19, 2026

Copy link
Copy Markdown
📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Added new shell abbreviations that provide convenient shortcuts for Claude Code remote-control operations within Git worktree environments
  • Chores

    • Enhanced repository synchronization by implementing a smarter git pull strategy that first attempts fast-forward-only updates and automatically retries with rebase-based pulling if needed

Walkthrough

Added two new fish abbreviations (clrc and clwrc) that invoke corresponding functions for running Claude Code remote-control. Added _clwrc_function to resolve the Claude binary path and invoke the remote-control subcommand. Modified git update strategy to attempt fast-forward pull first, with rebase fallback.

Changes

Cohort / File(s) Summary
Fish Abbreviations & Functions
home-manager/programs/fish/default.nix, home-manager/programs/fish/functions/_clwrc_function.fish
Added two new shell abbreviations (clrc, clwrc) mapped to fish functions. Implemented _clwrc_function to resolve the Claude executable path and execute remote-control with worktree arguments.
Git Update Strategy
scripts/update-local-binaries.sh
Changed update_repo function to attempt git pull --ff-only before falling back to git pull --rebase on failure, with warning/error logging preserved.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

🐰 Two abbreviations hop into view,
clrc and clwrc, both shiny and new!
With stable binary paths resolved with care,
And git pulls that rebase when fast-forward won't dare.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding two fish abbreviations (clrc and clwrc) for remote-control functionality.
Description check ✅ Passed The description is well-related to the changeset, providing clear summary of the new abbreviations, their purpose, test plan, and noting an additional git pull hardening change.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/fish-clrc-clwrc-abbreviations
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/update-local-binaries.sh`:
- Around line 240-246: The git pull --rebase failure handler leaves an
in-progress rebase; update the failure branch so that after a failed (cd
"$repo_dir" && git pull --rebase ...) you first run a cleanup (e.g., git rebase
--abort and/or git reset --hard to leave the repo in a clean state) before
calling log_error and appending to FAILURES, to ensure subsequent automation
runs are not left with a broken rebase; locate the block around the git pull
--rebase call that references repo_dir, log_error, and FAILURES and add the
abort/reset cleanup there.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 15b77e70-0dcf-40f3-8adc-77781b18c792

📥 Commits

Reviewing files that changed from the base of the PR and between f9e6077 and e4b1d4d.

📒 Files selected for processing (3)
  • home-manager/programs/fish/default.nix
  • home-manager/programs/fish/functions/_clwrc_function.fish
  • scripts/update-local-binaries.sh

Comment on lines +240 to +246
if ! (cd "$repo_dir" && git pull --ff-only 2>&1); then
log_warn " Fast-forward failed; rebasing onto remote..."
if ! (cd "$repo_dir" && git pull --rebase 2>&1); then
log_error " Git pull failed"
FAILURES+=("$repo_name (git pull failed)")
return 1
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether the rebase failure path includes cleanup.
rg -n -C3 'git pull --rebase|git rebase --abort' scripts/update-local-binaries.sh

Repository: shunkakinoki/dotfiles

Length of output: 388


Add rebase cleanup on failure to prevent automation breakage.

At line 242, when git pull --rebase fails, the function returns without aborting the in-progress rebase state. This leaves the repository in a broken state for subsequent automation runs, which can cause them to fail or hang until manual intervention.

Suggested fix
   if ! (cd "$repo_dir" && git pull --ff-only 2>&1); then
     log_warn "  Fast-forward failed; rebasing onto remote..."
     if ! (cd "$repo_dir" && git pull --rebase 2>&1); then
+      # Ensure repo is left in a clean state for future runs
+      (cd "$repo_dir" && git rebase --abort >/dev/null 2>&1 || true)
       log_error "  Git pull failed"
       FAILURES+=("$repo_name (git pull failed)")
       return 1
     fi
   fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if ! (cd "$repo_dir" && git pull --ff-only 2>&1); then
log_warn " Fast-forward failed; rebasing onto remote..."
if ! (cd "$repo_dir" && git pull --rebase 2>&1); then
log_error " Git pull failed"
FAILURES+=("$repo_name (git pull failed)")
return 1
fi
if ! (cd "$repo_dir" && git pull --ff-only 2>&1); then
log_warn " Fast-forward failed; rebasing onto remote..."
if ! (cd "$repo_dir" && git pull --rebase 2>&1); then
# Ensure repo is left in a clean state for future runs
(cd "$repo_dir" && git rebase --abort >/dev/null 2>&1 || true)
log_error " Git pull failed"
FAILURES+=("$repo_name (git pull failed)")
return 1
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/update-local-binaries.sh` around lines 240 - 246, The git pull
--rebase failure handler leaves an in-progress rebase; update the failure branch
so that after a failed (cd "$repo_dir" && git pull --rebase ...) you first run a
cleanup (e.g., git rebase --abort and/or git reset --hard to leave the repo in a
clean state) before calling log_error and appending to FAILURES, to ensure
subsequent automation runs are not left with a broken rebase; locate the block
around the git pull --rebase call that references repo_dir, log_error, and
FAILURES and add the abort/reset cleanup there.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Fish abbreviations and function wiring for Claude Code “remote-control” commands, and adjusts a repo update script to prefer fast-forward pulls with a rebase fallback.

Changes:

  • Update update_repo() to try git pull --ff-only first, then fall back to git pull --rebase.
  • Add Fish function _clwrc_function to run claude remote-control --worktree via a realpath-resolved binary.
  • Register clrc/clwrc abbreviations and include the function names in the Home Manager Fish function list.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
scripts/update-local-binaries.sh Changes git pull strategy to ff-only with rebase fallback.
home-manager/programs/fish/functions/_clwrc_function.fish Introduces a new Fish function to run remote-control in a worktree using a resolved binary path.
home-manager/programs/fish/default.nix Registers new abbreviations and adds function names to the managed function list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.


# Function-based abbreviations
cliproxyapi = "_cliproxyapi_function";
clrc = "_clrc_function";
})
[
"_cliproxyapi_function"
"_clrc_function"
Comment on lines +7 to +8
set -l claude_real (realpath (which claude))
node $claude_real remote-control --worktree $argv
Comment on lines +240 to +246
if ! (cd "$repo_dir" && git pull --ff-only 2>&1); then
log_warn " Fast-forward failed; rebasing onto remote..."
if ! (cd "$repo_dir" && git pull --rebase 2>&1); then
log_error " Git pull failed"
FAILURES+=("$repo_name (git pull failed)")
return 1
fi
@shunkakinoki
shunkakinoki merged commit cf7a413 into main Mar 19, 2026
31 of 39 checks passed
@shunkakinoki
shunkakinoki deleted the feat/fish-clrc-clwrc-abbreviations branch March 19, 2026 16:37
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