Skip to content

Commit 492df44

Browse files
committed
Update sandbox comments to match current hook flow
1 parent f20945b commit 492df44

4 files changed

Lines changed: 22 additions & 13 deletions

File tree

XcodeBuildTools/bin/swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
# direct agent invocations and nested calls from build scripts
77
# (Makefiles, fastlane, shell scripts, etc.) are sandboxed transparently.
88
#
9-
# Reads $SANDBOX_PACKAGES (exported by the PreToolUse inject-session-id.py
10-
# hook into every Bash command) and passes it as --cache-path to
11-
# subcommands that accept SwiftPM flags (build, test, run). Other
12-
# subcommands pass through unmodified. If $SANDBOX_PACKAGES is unset
9+
# Reads $SANDBOX_PACKAGES (exported by hooks/write-env.sh through
10+
# $CLAUDE_ENV_FILE) and passes it as --cache-path to subcommands that
11+
# accept SwiftPM flags (build, test, run). Other subcommands pass through
12+
# unmodified. If $SANDBOX_PACKAGES is unset
1313
# (e.g. the wrapper was invoked from a shell outside a hosted Bash-tool
1414
# context), the wrapper falls through to an unsandboxed exec.
1515
#

XcodeBuildTools/bin/xcodebuild

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
# both direct agent invocations and nested calls from build scripts
77
# (Makefiles, fastlane, shell scripts, etc.) are sandboxed transparently.
88
#
9-
# Reads $SANDBOX_DERIVED_DATA and $SANDBOX_PACKAGES (exported by the
10-
# PreToolUse inject-session-id.py hook into every Bash command) and
11-
# passes them to /usr/bin/xcodebuild as -derivedDataPath and
12-
# -clonedSourcePackagesDirPath. If neither env var is set (e.g. the
9+
# Reads $SANDBOX_DERIVED_DATA and $SANDBOX_PACKAGES (exported by
10+
# hooks/write-env.sh through $CLAUDE_ENV_FILE) and passes them to
11+
# /usr/bin/xcodebuild as -derivedDataPath and -clonedSourcePackagesDirPath.
12+
# If neither env var is set (e.g. the
1313
# wrapper was invoked from a shell outside a hosted Bash-tool context),
1414
# the wrapper falls through to an unsandboxed exec.
1515
#

XcodeBuildTools/hooks/setup-sandbox.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# Creates per-session sandbox directories for DerivedData and SPM cache,
66
# isolating CLI builds from Xcode's own storage. The wrapper scripts in
77
# bin/ (xcodebuild, swift) read $SANDBOX_DERIVED_DATA and $SANDBOX_PACKAGES
8-
# at runtime and inject the appropriate isolation flags; those env vars
9-
# are set on every Bash tool command by hooks/inject-session-id.py from
10-
# the hook payload's session_id (stable across contexts unlike $PPID).
8+
# at runtime and inject the appropriate isolation flags. hooks/write-env.sh
9+
# writes those env vars to $CLAUDE_ENV_FILE during SessionStart so every
10+
# later Bash tool command inherits the same sandbox paths.
1111
#
1212
# Each agent session gets its own sandbox keyed by the session ID
1313
# from the SessionStart hook's stdin payload.

tests/test_repository_integrity.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,17 @@ def test_agent_facing_docs_avoid_known_stale_terms(self):
212212
"iOSSimulator/skills/ios-simulator/SKILL.md": ["Read tool"],
213213
"iOSSimulator/skills/ios-simulator/references/script-details.md": ["Read tool"],
214214
"XcodeBuildTools/session-start.md": ["Claude session", "Claude sessions"],
215-
"XcodeBuildTools/bin/xcodebuild": ["Claude invocations", "Claude Bash"],
216-
"XcodeBuildTools/bin/swift": ["Claude invocations", "Claude Bash"],
215+
"XcodeBuildTools/hooks/setup-sandbox.sh": ["inject-session-id.py"],
216+
"XcodeBuildTools/bin/xcodebuild": [
217+
"Claude invocations",
218+
"Claude Bash",
219+
"inject-session-id.py",
220+
],
221+
"XcodeBuildTools/bin/swift": [
222+
"Claude invocations",
223+
"Claude Bash",
224+
"inject-session-id.py",
225+
],
217226
}
218227

219228
for relative_path, stale_terms in checks.items():

0 commit comments

Comments
 (0)