From fb6e33f3360b3ad490076b165d52105fb8200467 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 6 Oct 2026 08:32:55 +0000 Subject: [PATCH 1/2] chore: bootstrap Safe Chain for Claude Code on the web Co-authored-by: Jared Wray --- .claude/hooks/session-start.sh | 17 +++++++++++++++++ .claude/settings.json | 15 +++++++++++++++ .devcontainer/devcontainer.json | 1 + .gitignore | 6 ++++-- DEFENSE_IN_DEPTH.md | 4 ++-- 5 files changed, 39 insertions(+), 4 deletions(-) create mode 100755 .claude/hooks/session-start.sh create mode 100644 .claude/settings.json diff --git a/.claude/hooks/session-start.sh b/.claude/hooks/session-start.sh new file mode 100755 index 00000000..dee0e53e --- /dev/null +++ b/.claude/hooks/session-start.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# SessionStart hook for Claude Code on the web: bootstrap Aikido Safe Chain and +# install dependencies through its shims, as .devcontainer and .cursor do. +# +# Hook stdout is injected into the session, so the install log goes to stderr. +# Shim PATH is written by setup-cloud-environment.sh before that script can fail +# (CLAUDE_ENV_FILE). Do not append it here after the bootstrap: a failed hook +# would then leave the package managers unshimmed. +set -euo pipefail + +if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then + exit 0 +fi + +cd "$CLAUDE_PROJECT_DIR" + +bash ./scripts/setup-cloud-environment.sh >&2 diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 00000000..1833e5e2 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,15 @@ +{ + "hooks": { + "SessionStart": [ + { + "hooks": [ + { + "type": "command", + "command": "bash \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/session-start.sh", + "timeout": 600 + } + ] + } + ] + } +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 184bb317..a73f3756 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,6 +2,7 @@ "name": "Node.js", "image": "mcr.microsoft.com/devcontainers/javascript-node:5.2.1-24-trixie@sha256:7a81958053c4e3b5b20fa122f7a422d32dd0eebe87a6726f7b14483585ea60fd", "features": { + "ghcr.io/devcontainers/features/github-cli:1": {}, "ghcr.io/devcontainers/features/docker-in-docker:4": { "moby": false } diff --git a/.gitignore b/.gitignore index b2984bed..14bbb06b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,10 @@ out # Lock Files yarn.lock -# AI -.claude +# AI (keep the shared Claude Code settings and hooks; ignore local state) +.claude/* +!.claude/settings.json +!.claude/hooks/ # Dist dist diff --git a/DEFENSE_IN_DEPTH.md b/DEFENSE_IN_DEPTH.md index f400e80c..4323a660 100644 --- a/DEFENSE_IN_DEPTH.md +++ b/DEFENSE_IN_DEPTH.md @@ -9,8 +9,8 @@ Profile: npm library · public - [x] `DEFENSE_IN_DEPTH.md` present (this file) — PR #1698 ## 2. CODEOWNERS and cloud bootstrap -- [ ] `.github/CODEOWNERS` covers `/.github/`, `/.vscode/`, `/.cursor/`, `/.devcontainer/`, `/.claude/`, `/.codex/`, `/scripts/` with owners the maintainer names (PR #1734 pending) -- [ ] Codespaces, Cursor Cloud Agents, and Claude Code on the web bootstrap Aikido Safe Chain via scripts/setup-cloud-environment.sh (--ci shims, frozen lockfile); Claude Code runs it from `.claude/hooks/session-start.sh` (web sessions only, install log on stderr, 600s timeout) and `.gitignore` keeps `.claude/settings.json` and `.claude/hooks/` tracked +- [x] `.github/CODEOWNERS` covers `/.github/`, `/.vscode/`, `/.cursor/`, `/.devcontainer/`, `/.claude/`, `/.codex/`, `/scripts/` with owners the maintainer names — PR #1734 +- [ ] Codespaces, Cursor Cloud Agents, and Claude Code on the web bootstrap Aikido Safe Chain via scripts/setup-cloud-environment.sh (--ci shims, frozen lockfile); Claude Code runs it from `.claude/hooks/session-start.sh` (web sessions only, install log on stderr, 600s timeout) and `.gitignore` keeps `.claude/settings.json` and `.claude/hooks/` tracked (PR pending) - [ ] Codex cloud environments use Manual setup with `bash ./scripts/setup-cloud-environment.sh` as the setup and maintenance script (manual) - [ ] Claude Code on the web environments allow `malware-list.aikido.dev` (Custom network access plus the default package-manager list) (manual) - [x] Dev Container `image` pinned by digest (`name:@sha256:`; not a floating tag) — PR #1718 From ebf89595e956b4ee09ae293babbad8524cb6ea16 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 6 Oct 2026 08:33:16 +0000 Subject: [PATCH 2/2] chore: record the Safe Chain pull request number Co-authored-by: Jared Wray --- DEFENSE_IN_DEPTH.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEFENSE_IN_DEPTH.md b/DEFENSE_IN_DEPTH.md index 4323a660..594feb7e 100644 --- a/DEFENSE_IN_DEPTH.md +++ b/DEFENSE_IN_DEPTH.md @@ -10,7 +10,7 @@ Profile: npm library · public ## 2. CODEOWNERS and cloud bootstrap - [x] `.github/CODEOWNERS` covers `/.github/`, `/.vscode/`, `/.cursor/`, `/.devcontainer/`, `/.claude/`, `/.codex/`, `/scripts/` with owners the maintainer names — PR #1734 -- [ ] Codespaces, Cursor Cloud Agents, and Claude Code on the web bootstrap Aikido Safe Chain via scripts/setup-cloud-environment.sh (--ci shims, frozen lockfile); Claude Code runs it from `.claude/hooks/session-start.sh` (web sessions only, install log on stderr, 600s timeout) and `.gitignore` keeps `.claude/settings.json` and `.claude/hooks/` tracked (PR pending) +- [ ] Codespaces, Cursor Cloud Agents, and Claude Code on the web bootstrap Aikido Safe Chain via scripts/setup-cloud-environment.sh (--ci shims, frozen lockfile); Claude Code runs it from `.claude/hooks/session-start.sh` (web sessions only, install log on stderr, 600s timeout) and `.gitignore` keeps `.claude/settings.json` and `.claude/hooks/` tracked (PR #1735 pending) - [ ] Codex cloud environments use Manual setup with `bash ./scripts/setup-cloud-environment.sh` as the setup and maintenance script (manual) - [ ] Claude Code on the web environments allow `malware-list.aikido.dev` (Custom network access plus the default package-manager list) (manual) - [x] Dev Container `image` pinned by digest (`name:@sha256:`; not a floating tag) — PR #1718