A sandbox is only useful if it actually keeps the agent inside the fence. Claude Code 2.1.216 tightens several gaps that could let a background task, subagent, or resumed session wander outside its assigned directory. This release introduces a new configuration switch, but the more important work is under the hood: smarter handling of Git worktrees, symlinks, and agent restarts. If you run Claude Code locally or in CI, these changes deserve more than a quick skim of the changelog.

The Filesystem Toggle You Should Not Touch Lightly

Version 2.1.216 adds sandbox.filesystem.disabled. When this is set, Claude Code skips its own filesystem isolation while still enforcing the network sandbox. At first glance this sounds like a way to stop permission errors or speed up file operations. It is not. You should only enable this setting if another layer is already protecting your disk.

That means a disposable container that gets deleted after every run, or a dedicated virtual machine with no access to your home directory or production volumes. If you run Claude Code directly on macOS, Windows, or a bare Linux host, leave filesystem isolation on. The network sandbox is not a substitute for filesystem controls, and the minor friction of sandboxed file access is far cheaper than recovering from an accidental overwrite or a malicious prompt injection that breaks out of the project folder.

Think of the toggle as a compatibility shim, not a performance knob. It exists for environments where the operating system or orchestrator already handles isolation, and Claude’s own sandbox adds unnecessary complexity.

What the Update Actually Fixes

Beyond the new setting, 2.1.216 closes several practical holes that could let an agent reach places it should not.

Worktree isolation. Subagents can no longer redirect Git commands into a parent or sibling directory outside their own worktree. Previously, a subagent running inside your project could aim Git operations at your shared checkout or adjacent repositories. That matters because many developers keep multiple projects under a common parent folder. Now those boundary-crossing commands fail.

Symlink hardening at the .claude path. Workflow definitions and scheduled tasks used to follow symlinks when writing configuration. An attacker who could create a symlink from .claude to, say, your shell profile or SSH directory could potentially get the agent to write outside the project. The update stops this by refusing to follow symlinks at that path.

Safer rewinds. The /rewind command, which lets you roll back recent changes, now skips symlinked and hard-linked paths. Without this guard, a rewind operation could chase a symlink and overwrite a file far away from your repository. Claude now reports those skipped paths explicitly so you know the boundary held.

Resumed agents keep their restrictions. Background sessions that get stopped and later resumed used to fall back to default tool permissions. If you had intentionally restricted an agent so it could read but not write, a restart could silently restore broader access. Now the original restrictions are persisted and restored with the session.

Picking a Security Profile

Claude Code 2.1.216 organizes these controls into three profiles. Choose based on where you run the tool, not based on what feels fastest.

Default. Filesystem and network sandboxing both stay active. This is the right choice for local development on your laptop or workstation. It protects your home directory, system files, and neighboring projects without requiring you to manage containers.

Compatibility. Filesystem isolation is turned off, but the network sandbox remains. Restrict this profile to disposable containers or VMs where the filesystem is already ephemeral or strictly scoped. Do not use it because you are tired of typing passwords to let the agent access a protected folder.

Managed Hard Gate. Both sandbox layers stay on, and the profile expects additional container policies enforced by your orchestrator or security team. This is built for CI pipelines, remote dev environments, and enterprise setups where defense in depth is mandatory.

If you are unsure which one fits, start with Default. You can downgrade the protection later only after you have verified that your runtime environment genuinely isolates the filesystem by itself.

Upgrading Without Breaking Your Workflow

אל תתייחסו לזה כאל תיקון שגרתי שמתקינים בשישי אחר הצהריים. מסלול השדרוג בגרסה 2.1.216 הוא פשוט, אך ההשלכות של הגדרה שגויה אינן פשוטות.

ראשית, שדרגו ל-2.1.216 באמצעות מנהל החבילות או המתקין הרגיל שלכם. לאחר מכן, בחרו באחד משלושת פרופילי הבידוד (isolation profiles) לפני תחילת כל משימת סוכן (agent task). אל תערבבו פרופילים בין סשנים פעילים מבלי להבין איזה מהם קובע.

לאחר מכן, הריצו את חמש בדיקות הגבול (boundary tests) הלא-הרסניות המתוארות להלן. אלו בדיקות מהירות מבוססות סקריפט שמוכיחות שהארגז המבודד (sandbox) מתנהג כפי שהפרופיל מבטיח. במהלך הבדיקה, צרו sentinel hashes עבור קבצים מחוץ למאגר הבדיקה החד-פעמי (disposable test repository) שלכם. sentinel hash הוא פשוט checksum של קובץ או ספרייה רגישים שברצונכם להגן עליהם. לאחר הרצת הבדיקות, השוו את ה-hashes. אם משהו השתנה, הבידוד שלכם דולף.

השוו גם את הלוגים שלכם. Claude Code כותב דחיות (denials) ואירועי sandbox ללוגים המקומיים שלו. חפשו דחיות מפורשות כאשר מגיעים למארח (host) חסום או כאשר סוכן משנה (subagent) יוצא מגבולות ה-worktree שלו. כשלים שקטים גרועים יותר מכשלים גלויים, לכן ודאו שהלוגים מראים את מנגנוני ההגנה (guardrails) נכנסים לפעולה.

לבסוף, הפיצו את השינוי בהדרגה. התחילו עם פרויקט בודד או ענף (branch) שאינו בסביבת ייצור. תנו לגרסה החדשה לרוץ יום או יומיים לפני שתפרסמו אותה לכל הצוות או לכלל ה-CI fleet שלכם.

חמש בדיקות גבול שמוכיחות שה-sandbox שלכם עובד

הריצו תמיד את הבדיקות הללו בתוך מאגר (repository) חד-פעמי מלא בנתונים מזויפים. לעולם אל תפנו אותן לקוד ייצור, להרשאות אמיתיות או לתשתית פעילה.

גבול הרשת. נסו להגיע לשתי נקודות קצה (endpoints): אחת שאישרתם במפורש ואחת שחסמתם. בקשת HTTP פשוטה לשירות בדיקה ציבורי כמו httpbin.org יכולה לשמש כיעד המורשה, בעוד שבקשה לנקודת קצה של מטא-דאטה מקומי או לכתובת IP פנימית צריכה להיכשל. אם הבקשה החסומה מצליחה, ה-network sandbox שלכם מוגדר בצורה שגויה.

בידוד worktree. מתוך סוכן משנה (subagent), הריצו פקודת Git המכוונת לספריית האב. לדוגמה, נסו git -C .. status או בקשו מהסוכן לתאר קבצים מחוץ ל-checkout שלו. עם התיקון בגרסה 2.1.216, זה חייב להיכשל. הסוכן המשנה אמור לראות רק את ה-worktree שלו.

מלכודת symlink. צרו symlink בתוך הפרויקט שלכם המצביע לספרייה מחוץ למאגר, כגון /tmp/sentinel-target. לאחר מכן, נסו לשמור משימה או תהליך עבודה (workflow) תחת הנתיב .claude שיכתוב דרך הקישור הזה. לאחר השמירה, בדקו את הספרייה החיצונית. אם היא עדיין ריקה, מנגנון ה-symlink hardening עובד.

דילוג rewind. הגדירו תיקייה בתוך המאגר שלכם המכילה symlink לקובץ מערכת או לספרייה אחרת. הריצו /rewind על התיקייה הזו. Claude אמור לרשום את הנתיבים שנדלגו (שהם symlinked או hard-linked) במקום לרדוף אחריהם. ודאו שהיעד מחוץ למאגר נותר ללא שינוי.

החייאת סשן (Session resurrection). הפעילו סוכן רקע עם הגבלה מחמירה, כגון השבתת כלי כתיבת קבצים. השאירו את הסשן במצב השהייה (pause) או עצרו אותו, ואז חזרו להפעילו (resume). נסו מיד לגרום לסוכן לכתוב קובץ. אם ההגבלה עדיין פעילה, התיקון עבור סוכנים שחזרו לפעולה עובד. אם לסוכן יש פתאום גישה מלאה לכל הכלים שוב, אתם עדיין חשופים.

מילה אחרונה

Claude Code 2.1.216 מעניקה לכם גמישות רבה יותר מהגרסאות הקודמות, אך הגמישות הזו מגיעה עם הנחיה ברורה: ודאו לפני שאתם סומכים. המתג (toggle) החדש של מערכת הקבצים לא נועד להקל על חייכם על חשבון הבטיחות. הוא נועד עבור מהנדסים שכבר בנו תשתית מאובטחת (hardened floor) מתחת לכלי. השיפורים האמיתיים בשחרור זה הם מנגנוני ההגנה השקטים שמונעים מסוכנים משניים לזחול לתוך ספריות אב, מסרבים לעקוב אחר symlinks במהלך כתיבת הגדרות, וזוכרים את הכללים גם לאחר השהיה ארוכה.

הריצו את חמש הבדיקות. בדקו את ה-sentinel hashes שלכם. קראו את הלוגים. אז, ורק אז, תנו לגרסה החדשה לבצע עבודה אמיתית.

מקור: Claude Code v2.1.216 Release Notes

קהילת למידה אופציונלית: GyaanSetu on Telegram