From 9d6ea3fbdfa9cd71fc006d186b23dc750f2b17c4 Mon Sep 17 00:00:00 2001 From: "daibo@machinepulse.ai" Date: Mon, 27 Apr 2026 20:48:30 +0800 Subject: [PATCH] docs(channel): pre-check before suggesting claude-w2a alias After /world2agent:sensor-add walks the user through restart, the optional alias suggestion was firing on every install. Add a grep across common shell rc files (zshrc/bashrc/zprofile/bash_profile) and have the skill skip the suggestion entirely if the alias is already configured. Co-Authored-By: Claude Opus 4.7 (1M context) --- claude-code-channel/commands/sensor-add.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/claude-code-channel/commands/sensor-add.md b/claude-code-channel/commands/sensor-add.md index f57c14c..2bd3371 100644 --- a/claude-code-channel/commands/sensor-add.md +++ b/claude-code-channel/commands/sensor-add.md @@ -91,13 +91,21 @@ Tell the user, in their language, to: 3. The new sensor will start automatically once the new session boots. -4. Optionally offer a shell alias so future launches are one word. If they want it, run this one-liner — it auto-detects zsh vs bash, appends only if not already present, and is safe to re-run: +4. **First check whether the alias is already configured** — if it is, skip this step entirely and **do not mention it**. Run: + + ```bash + grep -l "alias claude-w2a=" ~/.zshrc ~/.bashrc ~/.zprofile ~/.bash_profile 2>/dev/null + ``` + + If the command prints any file path, the alias exists — move on. + + Otherwise, offer a shell alias so future launches are one word. If the user accepts, run this one-liner (auto-detects zsh vs bash, idempotent): ```bash RC=$(case "$SHELL" in *zsh) echo ~/.zshrc;; *) echo ~/.bashrc;; esac) && A="alias claude-w2a='claude --dangerously-load-development-channels plugin:world2agent@world2agent-plugins'" && (grep -qxF "$A" "$RC" 2>/dev/null || echo "$A" >> "$RC") ``` - Then open a new terminal (or run `exec $SHELL`) so the alias loads. Next time they just run `claude-w2a`. Mention this once during the restart guidance — don't push it if they decline. + Then open a new terminal (or run `exec $SHELL`) so the alias loads. Next time they just run `claude-w2a`. Don't push it if they decline. `/reload-plugins` alone is NOT sufficient — it reloads plugin definitions but does not refresh Node's `node_modules` view inside the running MCP channel.