Repository navigation
refactor(claude): split cloud bootstrap out of the SessionStart hook - #476
Conversation
Claude Code builds its plugin/command/skill registry at process start and never re-reads it, so plugins a SessionStart hook installs are invisible to the session that ran the hook. Move .claude/hooks/install-plugins.sh to .claude/cloud-bootstrap.sh so the account environment's setup script can run it (with CLAUDE_CODE_REMOTE=true) after clone and before the session process launches - the only path that gets plugins loaded at turn one. The SessionStart hook (startup|resume) keeps running the same script as drift repair against a stale environment cache. - Guard the script on CLAUDE_CODE_REMOTE=true so it is a no-op outside cloud sessions, matching the split-layout contract. - Fix the repo-root fallback (.. instead of ../..) for the script's new location one directory higher. - Repoint the SessionStart hook command in .claude/settings.json. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FJb49tbTWHPXxBr5WCp514
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @kyle-sexton's task in 2m 34s —— View job Claude finished the code review
SummaryReviewed the two changed files ( No blocking or suggestion-level findings. The functional deltas in this diff are exactly the two the PR describes, and both check out:
Everything else in the diff is the Also checked, per the PR's own claim:
Note: I did not independently re-run the script in a cloud session with |
|
Claude finished @kyle-sexton's task in 1m 14s —— View job Claude Security Review
No security issues found. This PR is a mechanical refactor of the cloud-bootstrap plugin-install script (
No |
|
Last security-reviewed head: |
|
Claude has reviewed this PR 1 time. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
No linked issue
Related
Summary
Migrates the Claude Code cloud bootstrap from the SessionStart-hook layout to the split cloud-bootstrap layout. Claude Code builds its plugin/command/skill registry at process start and never re-reads it, so plugins installed by a SessionStart hook are invisible to the session that ran the hook. The account environments' setup scripts run the repo's committed bootstrap (with
CLAUDE_CODE_REMOTE=true) after clone and before the session process launches — that pre-launch call is what gets plugins loaded at turn one. The SessionStart hook stays registered and runs the same script per start/resume as drift repair against a stale environment cache.Changes
git mv .claude/hooks/install-plugins.sh .claude/cloud-bootstrap.sh— this repo's SessionStart script was namedinstall-plugins.sh(there was nosession-start.sh); it is the script serving the cloud-bootstrap role.CLAUDE_CODE_REMOTE=trueguard the split layout requires (the script previously had none and ran in local sessions too); provisioning logic and idempotency are unchanged.repo_rootfallback (..instead of../..) for the script's new location one directory higher — without this the fallback resolved outside the repo and the script saw 0 enabled plugins.CLAUDE_PROJECT_DIRremains the preferred root source.cloud-bootstrap:.startup|resume) in.claude/settings.jsonatbash "$CLAUDE_PROJECT_DIR/.claude/cloud-bootstrap.sh"; all other settings untouched.No other references to the old path exist in docs, CI, or scripts.
Verification
bash -npasses;shellchecknot available in the session container.CLAUDE_CODE_REMOTE=true: both reportcloud-bootstrap: 65 enabled, 0 newly installed; second run is a fast no-op (~1.7s, spent onclaude plugin list).CLAUDE_CODE_REMOTEunset: exits 0 in ~4ms with no output and no plugin/marketplace mutation (plugin count 65 before and after).CLAUDE_PROJECT_DIRunset,bash -xshows the fallback resolvingrepo_rootto the repo root, not its parent.🤖 Generated with Claude Code
https://claude.ai/code/session_01FJb49tbTWHPXxBr5WCp514
Generated by Claude Code