Skip to content

Conversation

@callicles
Copy link
Collaborator

@callicles callicles commented Jan 30, 2026

Summary

This PR adds automatic setup for Claude Code remote (web) environments by introducing a SessionStart hook that installs required system dependencies and documents environment limitations.

Key Changes

  • Added .claude/settings.json: Configures a SessionStart hook to automatically run the setup script when Claude Code remote sessions start
  • Added scripts/claude-remote-setup.sh: Bash script that installs critical system dependencies:
    • protobuf-compiler for Rust builds (prost/tonic)
    • librdkafka-dev, libcurl4-openssl-dev, libsasl2-dev for Kafka native modules
    • python3.12+ for moose-cli pip package and E2E tests
  • Updated AGENTS.md: Added documentation section explaining:
    • Which dependencies are auto-installed and why
    • Limitations of Claude Code remote (no Docker support)
    • Guidance on which tests can run remotely vs. in CI/locally

Implementation Details

  • The setup script only executes in Claude Code remote environments (checks CLAUDE_CODE_REMOTE env var)
  • Gracefully handles missing apt-get and skips if not available
  • Uses deadsnakes PPA to install Python 3.12 if needed
  • Provides clear output showing what was installed and next steps
  • Includes helpful notes about Docker limitations and test execution guidance

This enables developers to work effectively in Claude Code remote environments while being aware of constraints around containerized services.

https://claude.ai/code/session_0135cswZZnwLDYtR9f3FkBNa


Note

Medium Risk
Adds an auto-run SessionStart hook that executes a privileged apt-get/repo-setup script; risk is mainly around unexpected environment side effects and network/package availability, not product logic.

Overview
Automates Claude Code remote setup. Adds .claude/settings.json to run scripts/claude-remote-setup.sh on SessionStart (guarded by CLAUDE_CODE_REMOTE=true).

The setup script installs build/test prerequisites via apt-get (Docker/Compose, protobuf-compiler, Kafka native deps, and optionally Python 3.12 via deadsnakes), with best-effort fallbacks and a summary output.

Updates AGENTS.md to document what gets installed in remote sessions and the Docker availability limitation, plus guidance on which tests to run remotely vs. in Docker-capable environments.

Written by Cursor Bugbot for commit f57cea2. This will update automatically on new commits. Configure here.

This adds automatic installation of system dependencies when running
in Claude Code remote (web) environments:
- protobuf-compiler for Rust protobuf compilation
- librdkafka-dev and related libs for Kafka JavaScript module
- Python 3.12 for moose-cli pip package

Note: Docker is not available in Claude Code remote environments,
so E2E tests requiring Docker must run in CI or locally.

https://claude.ai/code/session_0135cswZZnwLDYtR9f3FkBNa
@vercel
Copy link

vercel bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs-v2 Ready Ready Preview, Comment Jan 30, 2026 11:27pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

Walkthrough

This PR introduces automated setup for Claude Code remote environments by adding a SessionStart hook configuration, documentation of pre-installed dependencies, and a comprehensive Bash script that installs Docker, system libraries, protobuf-compiler, Kafka dependencies, and Python 3.12+ with configuration.

Changes

Cohort / File(s) Summary
Remote Environment Configuration
.claude/settings.json
New SessionStart hook executes remote setup script on session initialization.
Documentation
AGENTS.md
Added "Claude Code Remote Environment" section documenting automatically installed dependencies (Docker, protobuf-compiler, librdkafka-dev, libcurl, libsasl2-dev, Python 3.12+) and limitations in remote environments.
Setup Script
scripts/claude-remote-setup.sh
New Bash script for remote environment configuration. Installs system dependencies via apt-get, Docker with fallback versioning, protobuf-compiler, Kafka native libraries, and ensures Python 3.12+ via deadsnakes PPA with alternatives configuration. Includes environment enforcement and completion summary.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐋 A remote setup awakens,
Scripts dancing with Docker and Python,
Hooks whisper, dependencies bloom,
MooseStack takes flight in the cloud.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed Title directly summarizes the main change: adding automated setup for Claude Code remote environments via SessionStart hook and setup script.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly relates to the changeset, detailing the SessionStart hook addition, setup script installation, and AGENTS.md documentation updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/run-e2e-tests-ACwsT

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- Add VERSION CONSTANTS section at top of script for easy updates
- Add Docker and Docker Compose installation with fallback handling
- Update AGENTS.md to reflect Docker installation attempt

https://claude.ai/code/session_0135cswZZnwLDYtR9f3FkBNa
Copy link
Contributor

@onelesd onelesd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪🏼

- Add version constants for protobuf-compiler, librdkafka-dev,
  libcurl4-openssl-dev, and libsasl2-dev
- Use versioned package installation with fallback to latest
- Show actual installed versions in summary output

https://claude.ai/code/session_0135cswZZnwLDYtR9f3FkBNa
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@AGENTS.md`:
- Line 95: Add a single trailing newline at end of AGENTS.md so the file ends
with one newline (fixes Markdownlint MD047); open AGENTS.md and ensure that
after the final line "Run full E2E tests (`cd apps/framework-cli-e2e && pnpm
test`) in environments with Docker support" there is exactly one newline
character at EOF.
- Around line 82-95: Add a new short section titled "Agent architecture / design
patterns" to AGENTS.md (place it after the "Claude Code Remote Environment"
section) that either summarizes the canonical agent architecture or links to the
authoritative design doc; include one-paragraph descriptions of the recommended
patterns to follow: message-passing vs shared-memory, controller/worker
separation, stateless vs stateful agents and state persistence, retry/backoff
and error-handling conventions, and observability/metrics/logging practices,
plus a link to the primary design document or RFC for deeper details.

In `@scripts/claude-remote-setup.sh`:
- Around line 30-34: The apt-get guard should also check for sufficient
privileges before attempting package installation; update the logic around the
existing apt-get check in the script (scripts/claude-remote-setup.sh) to first
verify the script is running as root (UID 0) and if not, either attempt to use
sudo (if sudo is available) for apt-get commands or skip system package
installation and exit 0 gracefully—ensure this privilege check runs before the
current "if ! command -v apt-get" block and that any error paths do not trigger
set -e to abort the entire setup.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1541e74 and 3f92b0d.

📒 Files selected for processing (3)
  • .claude/settings.json
  • AGENTS.md
  • scripts/claude-remote-setup.sh
🧰 Additional context used
📓 Path-based instructions (1)
AGENTS.md

📄 CodeRabbit inference engine (CLAUDE.md)

Document agent architecture and design patterns in AGENTS.md

Files:

  • AGENTS.md
🧠 Learnings (4)
📚 Learning: 2025-12-16T23:08:46.806Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: packages/protobuf/CLAUDE.md:0-0
Timestamp: 2025-12-16T23:08:46.806Z
Learning: Applies to packages/protobuf/**/AGENTS.md : Review AGENTS.md for coding standards and guidelines

Applied to files:

  • AGENTS.md
📚 Learning: 2025-12-16T23:08:39.003Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/CLAUDE.md:0-0
Timestamp: 2025-12-16T23:08:39.003Z
Learning: Document agent implementations in AGENTS.md file

Applied to files:

  • AGENTS.md
📚 Learning: 2025-12-16T23:08:34.942Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-16T23:08:34.942Z
Learning: Applies to AGENTS.md : Document agent architecture and design patterns in AGENTS.md

Applied to files:

  • AGENTS.md
📚 Learning: 2025-12-16T23:08:31.521Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T23:08:31.521Z
Learning: Ensure all tests pass: `cargo test` for Rust components and appropriate test commands for TS/JS

Applied to files:

  • AGENTS.md
🪛 markdownlint-cli2 (0.20.0)
AGENTS.md

[warning] 95-95: Files should end with a single newline character

(MD047, single-trailing-newline)

🪛 Shellcheck (0.11.0)
scripts/claude-remote-setup.sh

[info] 61-61: Not following: /etc/os-release was not specified as input (see shellcheck -x).

(SC1091)

🔇 Additional comments (1)
.claude/settings.json (1)

5-10: The code is correct. Claude Code automatically injects CLAUDE_PROJECT_DIR and expands environment variables in hook commands, which run as regular shell commands. The escaped quotes are the correct JSON syntax for embedding a shell command with variable expansion. No changes needed.

Likely an incorrect or invalid review comment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +82 to +95
## Claude Code Remote Environment

When running in Claude Code remote (web) environments, system dependencies are automatically installed via the SessionStart hook in `.claude/settings.json`. The setup script (`scripts/claude-remote-setup.sh`) installs:

- **Docker & Docker Compose**: Required for E2E tests (ClickHouse, Kafka, Temporal containers)
- **protobuf-compiler**: Required for Rust build (prost/tonic protobuf compilation)
- **librdkafka-dev**: Required for `@514labs/kafka-javascript` native module
- **libcurl4-openssl-dev, libsasl2-dev**: Additional Kafka dependencies
- **Python 3.12+**: Required for `moose-cli` pip package in Python E2E tests

**Limitations in Claude Code Remote:**
- **Docker may not be available**: Docker requires privileged container access which may not be supported in all environments
- Run unit tests (`cargo test`, `pnpm test` in ts-moose-lib) and linting in remote environments
- Run full E2E tests (`cd apps/framework-cli-e2e && pnpm test`) in environments with Docker support No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add agent architecture/design patterns section

This update doesn’t document agent architecture/design patterns as required; please add a short section or link to the authoritative doc.
As per coding guidelines: Document agent architecture and design patterns in AGENTS.md.

🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 95-95: Files should end with a single newline character

(MD047, single-trailing-newline)

🤖 Prompt for AI Agents
In `@AGENTS.md` around lines 82 - 95, Add a new short section titled "Agent
architecture / design patterns" to AGENTS.md (place it after the "Claude Code
Remote Environment" section) that either summarizes the canonical agent
architecture or links to the authoritative design doc; include one-paragraph
descriptions of the recommended patterns to follow: message-passing vs
shared-memory, controller/worker separation, stateless vs stateful agents and
state persistence, retry/backoff and error-handling conventions, and
observability/metrics/logging practices, plus a link to the primary design
document or RFC for deeper details.

**Limitations in Claude Code Remote:**
- **Docker may not be available**: Docker requires privileged container access which may not be supported in all environments
- Run unit tests (`cargo test`, `pnpm test` in ts-moose-lib) and linting in remote environments
- Run full E2E tests (`cd apps/framework-cli-e2e && pnpm test`) in environments with Docker support No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add trailing newline at EOF

Markdownlint MD047 expects a single trailing newline after Line 95.

Proposed fix
- - Run full E2E tests (`cd apps/framework-cli-e2e && pnpm test`) in environments with Docker support
+ - Run full E2E tests (`cd apps/framework-cli-e2e && pnpm test`) in environments with Docker support
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Run full E2E tests (`cd apps/framework-cli-e2e && pnpm test`) in environments with Docker support
- Run full E2E tests (`cd apps/framework-cli-e2e && pnpm test`) in environments with Docker support
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 95-95: Files should end with a single newline character

(MD047, single-trailing-newline)

🤖 Prompt for AI Agents
In `@AGENTS.md` at line 95, Add a single trailing newline at end of AGENTS.md so
the file ends with one newline (fixes Markdownlint MD047); open AGENTS.md and
ensure that after the final line "Run full E2E tests (`cd apps/framework-cli-e2e
&& pnpm test`) in environments with Docker support" there is exactly one newline
character at EOF.

Comment on lines +30 to +34
# Check if we have apt-get available
if ! command -v apt-get &> /dev/null; then
echo "apt-get not found, skipping system package installation"
exit 0
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Guard against non-root execution before apt-get

With set -e, running the hook without root will abort setup; add a privilege check (or sudo path) and skip gracefully when not root.

Proposed fix
 if ! command -v apt-get &> /dev/null; then
     echo "apt-get not found, skipping system package installation"
     exit 0
 fi
+if [ "$(id -u)" -ne 0 ]; then
+    echo "Insufficient privileges to install packages; skipping setup."
+    exit 0
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Check if we have apt-get available
if ! command -v apt-get &> /dev/null; then
echo "apt-get not found, skipping system package installation"
exit 0
fi
# Check if we have apt-get available
if ! command -v apt-get &> /dev/null; then
echo "apt-get not found, skipping system package installation"
exit 0
fi
if [ "$(id -u)" -ne 0 ]; then
echo "Insufficient privileges to install packages; skipping setup."
exit 0
fi
🤖 Prompt for AI Agents
In `@scripts/claude-remote-setup.sh` around lines 30 - 34, The apt-get guard
should also check for sufficient privileges before attempting package
installation; update the logic around the existing apt-get check in the script
(scripts/claude-remote-setup.sh) to first verify the script is running as root
(UID 0) and if not, either attempt to use sudo (if sudo is available) for
apt-get commands or skip system package installation and exit 0
gracefully—ensure this privilege check runs before the current "if ! command -v
apt-get" block and that any error paths do not trigger set -e to abort the
entire setup.

The deadsnakes PPA may be blocked by network proxies in some
environments. Update the script to catch this failure and
continue with a warning instead of failing the entire setup.

https://claude.ai/code/session_0135cswZZnwLDYtR9f3FkBNa
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.

4 participants