session-start.sh 758 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. set -euo pipefail
  3. # Only run in remote (Claude Code on the web) environments
  4. if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
  5. exit 0
  6. fi
  7. cd "$CLAUDE_PROJECT_DIR"
  8. # Install all workspace dependencies.
  9. # turbo (root devDependency) and all workspace packages will be installed.
  10. pnpm install
  11. # Install turbo globally (mirrors devcontainer postCreateCommand.sh) so it is
  12. # available as a bare `turbo` command in subsequent Claude tool calls.
  13. # Falls back to adding node_modules/.bin to PATH if the pnpm global store is
  14. # not yet configured in this environment.
  15. if ! command -v turbo &> /dev/null; then
  16. pnpm install turbo --global 2>/dev/null \
  17. || echo "export PATH=\"$CLAUDE_PROJECT_DIR/node_modules/.bin:\$PATH\"" >> "$CLAUDE_ENV_FILE"
  18. fi