diff --git a/.claude/scripts/worktree-create.sh b/.claude/scripts/worktree-create.sh deleted file mode 100755 index 4c9c83fda2b..00000000000 --- a/.claude/scripts/worktree-create.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# WorktreeCreate hook for Claude Code -# Creates a git worktree and mounts overlayfs over target/ and node_modules/ -# so that heavy build caches and dependencies are shared copy-on-write. -# -# Input (JSON on stdin): { "name": "...", "cwd": "...", ... } -# Output (stdout): absolute path to the created worktree - -INPUT=$(cat) -NAME=$(echo "$INPUT" | jq -r '.name') -MAIN_DIR=$(echo "$INPUT" | jq -r '.cwd') - -WORKTREE_DIR="$MAIN_DIR/.claude/worktrees/$NAME" -OVERLAY_BASE="$WORKTREE_DIR/.overlays" - -# 1. Create the git worktree -git -C "$MAIN_DIR" worktree add -b "claude/$NAME" "$WORKTREE_DIR" HEAD --quiet - -# 2. Mount overlayfs layers if fuse-overlayfs is available -if command -v fuse-overlayfs >/dev/null 2>&1; then - # Mount an overlayfs for a directory (relative path from repo root) - mount_overlay() { - local rel_path="$1" - local src="$MAIN_DIR/$rel_path" - local dst="$WORKTREE_DIR/$rel_path" - - [ -d "$src" ] || return 0 - - local key - key=$(echo "$rel_path" | sed 's|/|__|g') - local upper="$OVERLAY_BASE/$key/upper" - local work="$OVERLAY_BASE/$key/work" - - mkdir -p "$dst" "$upper" "$work" - fuse-overlayfs \ - -o "lowerdir=$src,upperdir=$upper,workdir=$work" \ - "$dst" - } - - # Rust build cache - mount_overlay "target" - - # node_modules directories (pnpm workspace) - while IFS= read -r nm_dir; do - mount_overlay "${nm_dir#"$MAIN_DIR"/}" - done < <(find "$MAIN_DIR" \ - -path "$MAIN_DIR/.claude" -prune -o \ - -name node_modules -type d -print -prune) -fi - -# 3. Print the worktree path (required by Claude Code) -echo "$WORKTREE_DIR" diff --git a/.claude/scripts/worktree-remove.sh b/.claude/scripts/worktree-remove.sh deleted file mode 100755 index ce437f85662..00000000000 --- a/.claude/scripts/worktree-remove.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# WorktreeRemove hook for Claude Code -# Unmounts all overlayfs layers and removes the git worktree. -# -# Input (JSON on stdin): { "worktree_path": "...", "cwd": "...", ... } - -INPUT=$(cat) -WORKTREE_DIR=$(echo "$INPUT" | jq -r '.worktree_path') -MAIN_DIR=$(echo "$INPUT" | jq -r '.cwd') - -# 1. Unmount all overlayfs mounts within the worktree (reverse order for safety) -mount | grep -F " on $WORKTREE_DIR/" | awk '{print $3}' | sort -r | while read -r mnt; do - fusermount3 -u "$mnt" 2>/dev/null || fusermount -u "$mnt" 2>/dev/null || true -done - -# 2. Extract branch name before removing worktree -BRANCH=$(git -C "$WORKTREE_DIR" rev-parse --abbrev-ref HEAD 2>/dev/null || true) - -# 3. Remove the git worktree -git -C "$MAIN_DIR" worktree remove --force "$WORKTREE_DIR" 2>/dev/null || rm -rf "$WORKTREE_DIR" - -# 4. Clean up the temporary branch -if [ -n "$BRANCH" ] && [[ "$BRANCH" == claude/* ]]; then - git -C "$MAIN_DIR" branch -D "$BRANCH" 2>/dev/null || true -fi diff --git a/.claude/settings.json b/.claude/settings.json deleted file mode 100644 index c25e55284a2..00000000000 --- a/.claude/settings.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "hooks": { - "WorktreeCreate": [ - { - "hooks": [ - { - "type": "command", - "command": "bash .claude/scripts/worktree-create.sh" - } - ] - } - ], - "WorktreeRemove": [ - { - "hooks": [ - { - "type": "command", - "command": "bash .claude/scripts/worktree-remove.sh" - } - ] - } - ] - } -} diff --git a/.gitignore b/.gitignore index 21578f46881..407dc7e5424 100644 --- a/.gitignore +++ b/.gitignore @@ -48,11 +48,6 @@ docs/.vitepress/.temp # TypeDoc generated API docs docs/api/ -# Overlay filesystem -.overlays/ -.overlay-upper/ -.overlay-work/ - # Benchmark output ts-output.json benches/verilator/obj_dir/ diff --git a/flake.nix b/flake.nix index f6fe96c30ac..f46b8578c74 100644 --- a/flake.nix +++ b/flake.nix @@ -71,7 +71,6 @@ pkgs.cmake pkgs.pkg-config pkgs.openssl - pkgs.fuse-overlayfs pkgs.cargo-insta pkgs.cargo-nextest pkgs.git