Skip to content

Commit bdbf90e

Browse files
committed
chore: add SessionStart hook for Claude Code on the web
Set up dev environment automation so remote Claude Code sessions automatically install dependencies and build packages on startup. - Add .claude/hooks/session-start.sh (pnpm install + pnpm build) - Add .claude/settings.json to register the SessionStart hook - Add pnpm.onlyBuiltDependencies for esbuild and @parcel/watcher https://claude.ai/code/session_0153jtsmYXCuyedMWwv88aWP
1 parent a3d9a9e commit bdbf90e

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

.claude/hooks/session-start.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Only run in remote (Claude Code on the web) environments
5+
if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
6+
exit 0
7+
fi
8+
9+
cd "$CLAUDE_PROJECT_DIR"
10+
11+
# Install all workspace dependencies
12+
pnpm install
13+
14+
# Build all packages (downstream packages depend on upstream builds)
15+
pnpm build

.claude/settings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"hooks": {
3+
"SessionStart": [
4+
{
5+
"hooks": [
6+
{
7+
"type": "command",
8+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh"
9+
}
10+
]
11+
}
12+
]
13+
}
14+
}

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,11 @@
1616
},
1717
"devDependencies": {
1818
"@changesets/cli": "^2.29.8"
19+
},
20+
"pnpm": {
21+
"onlyBuiltDependencies": [
22+
"@parcel/watcher",
23+
"esbuild"
24+
]
1925
}
2026
}

0 commit comments

Comments
 (0)