Skip to content

Commit e5fa92d

Browse files
tikazyqclaude
andauthored
chore: install onsager-ai/dev-skills on SessionStart in cloud (#303)
* chore: install onsager-ai/dev-skills on SessionStart in cloud Adds a web-only SessionStart hook (.claude/hooks/session-start.sh) that runs `npx skills add -g onsager-ai/dev-skills --skill '*' -a claude-code` so Claude Code on the web sessions land with the cross- repo dev-skills bundle already installed under ~/.claude/skills/. Gated on $CLAUDE_CODE_REMOTE=true so local terminal sessions stay untouched. * chore: make dev-skills install best-effort and drop double -y - Wrap `npx skills add` in `if !` so a transient npm/registry/GitHub failure logs a warning and lets the session continue without the bundle (was: hook would exit non-zero under `set -e`). - Drop the trailing `-y` (now passed only to `npx`); the `skills` CLI's agent-detect already installs non-interactively under Claude Code. Addresses Copilot review feedback on the parallel PRs in onsager-ai/onsager#424, onsager-ai/duhem#57, #303, onsager-ai/onsager-skills#20, and onsager-ai/telegramable#65. --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2eca457 commit e5fa92d

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.claude/hooks/session-start.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Cloud-only: in Claude Code on the web, every container starts fresh, so we
5+
# install the onsager-ai/dev-skills bundle into ~/.claude/skills/ on each
6+
# session start. Local terminal sessions are skipped so a developer's
7+
# hand-installed skills are left alone.
8+
if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
9+
exit 0
10+
fi
11+
12+
# Best-effort: a transient npm/registry/GitHub blip shouldn't fail the whole
13+
# session start. On failure we log a warning and let the session continue
14+
# without the bundle.
15+
echo "--- installing onsager-ai/dev-skills globally ---"
16+
if ! npx -y skills add -g onsager-ai/dev-skills --skill '*' -a claude-code; then
17+
echo "warning: onsager-ai/dev-skills install failed; session will start without the bundle." >&2
18+
fi

.claude/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"hooks": [
66
{
77
"type": "command",
8-
"command": "echo '--- codervisor hooks: no setup needed ---'"
8+
"command": "bash .claude/hooks/session-start.sh"
99
}
1010
]
1111
}

0 commit comments

Comments
 (0)