-
Notifications
You must be signed in to change notification settings - Fork 26
Add Claude Code remote environment setup automation #3421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
- 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
onelesd
left a comment
There was a problem hiding this 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
There was a problem hiding this 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.
📒 Files selected for processing (3)
.claude/settings.jsonAGENTS.mdscripts/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 injectsCLAUDE_PROJECT_DIRand 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.
| ## 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| - 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.
| # 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| # 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
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
.claude/settings.json: Configures a SessionStart hook to automatically run the setup script when Claude Code remote sessions startscripts/claude-remote-setup.sh: Bash script that installs critical system dependencies:protobuf-compilerfor Rust builds (prost/tonic)librdkafka-dev,libcurl4-openssl-dev,libsasl2-devfor Kafka native modulespython3.12+for moose-cli pip package and E2E testsAGENTS.md: Added documentation section explaining:Implementation Details
CLAUDE_CODE_REMOTEenv var)apt-getand skips if not availableThis 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.jsonto runscripts/claude-remote-setup.shon SessionStart (guarded byCLAUDE_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.mdto 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.