Skip to content

Add Claude Code bootstrap configuration and setup script#58

Merged
evantahler merged 2 commits into
mainfrom
claude/explore-codebase-8htiW
Feb 5, 2026
Merged

Add Claude Code bootstrap configuration and setup script#58
evantahler merged 2 commits into
mainfrom
claude/explore-codebase-8htiW

Conversation

@evantahler

Copy link
Copy Markdown
Member

Summary

This PR adds automatic environment setup for the bun-actionhero project when running in Claude Code's cloud environment. It includes a SessionStart hook configuration and a comprehensive bootstrap script that initializes all required services and dependencies.

Changes

  • .claude/settings.json (new): Adds Claude Code hook configuration that automatically runs the bootstrap script on session startup and resume
  • scripts/bootstrap.sh (new): Comprehensive bootstrap script that:
    1. Starts PostgreSQL service (with fallback for different system configurations)
    2. Starts Redis service in daemon mode
    3. Creates required PostgreSQL databases (bun and bun-test)
    4. Installs project dependencies using bun
    5. Sets up environment files from .env.example templates
    6. Configures session environment variables for database and Redis connections

Implementation Details

  • The bootstrap script is idempotent—it safely handles cases where services are already running or databases already exist
  • Includes health checks with timeouts (30s for PostgreSQL, 10s for Redis) to ensure services are ready
  • Gracefully handles missing services with warnings rather than failing
  • Supports multiple PostgreSQL startup methods (pg_ctlcluster and pg_ctl) for compatibility across different Linux distributions
  • Exports environment variables via CLAUDE_ENV_FILE for the entire session
  • Provides helpful output showing service status and available commands after bootstrap completes

Benefits

  • Eliminates manual setup steps when starting a new Claude Code session
  • Ensures consistent development environment across sessions
  • Reduces friction for new developers or when resuming work
  • All services and dependencies are ready to use immediately after session starts

https://claude.ai/code/session_01AHDskyzDT97ySQfpVmoKpQ

- Add scripts/bootstrap.sh to set up development environment:
  - Starts PostgreSQL and Redis services
  - Creates bun and bun-test databases
  - Installs dependencies with bun
  - Copies .env.example files if needed
  - Exports environment variables for the session

- Add .claude/settings.json with SessionStart hook configuration
  that runs bootstrap.sh on both startup and resume

This enables Claude Code in the cloud to run tests and boot the
server without requiring Docker.

https://claude.ai/code/session_01AHDskyzDT97ySQfpVmoKpQ
Check CLAUDE_CODE_REMOTE environment variable and exit early if not
set to "true". This prevents the bootstrap script from running on
local machines where docker compose is used instead.

https://claude.ai/code/session_01AHDskyzDT97ySQfpVmoKpQ
@evantahler evantahler enabled auto-merge (squash) February 5, 2026 05:42
@evantahler evantahler merged commit dd93313 into main Feb 5, 2026
5 checks passed
@evantahler evantahler deleted the claude/explore-codebase-8htiW branch February 5, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants