◆ Vibe EngineeringSMIT · AI Agentic Engineering English
Class 13 · 13.2

Native sandbox — /sandbox

Teenon mein sab se simple: sandbox jo Claude Code ke andar rehta aur aap ki machine par chalta hai. Ek command — /sandbox — aur Claude mehfooz kaamon ke liye permission maangna band kar deta hai.

🎯 Maqsad: safe local sandbox chalana⏱ Parhein: 14 min🤖 Qisam: hands-on

13.1 mein aap sandbox ka khayal mil chuka hai. Ab pehla aur asaan tareeqa: yeh Claude Code mein pehle se bana hua hai. Kuch install nahi, cloud mein kuch nahi — sirf ek command.

01Yeh kya hai (aur Docker se behtar kyun)

Native sandbox apna Docker container chalane jaisa hai — ek box ke andar doosra box — lekin yeh operating-system level par implemented hai, is liye bohot halka hai. Foran shuru hota, lagbhag koi overhead nahi leta aur raaste se hat jata hai.

DOCKER / DEV-CONTAINER guest OS image packages re-installed container runtime your code NATIVE SANDBOX a thin OS-level fence your code (same machine) instant · tiny overhead
Wohi hifazat, bohot kam bojh. Na image build karni hai na runtime boot — OS khud fence ka kaam karta hai.

Aap is pattern ko pehchan sakte hain: Cursor mein bhi aisa built-in sandbox hai jo apne box ke andar actions ko auto-approve karta hai. Claude Code ka version seedha CLI mein hai.

02On karein: /sandbox

Claude Code ke andar command type karein. Pehli baar yeh kehta hai “sandbox disabled — press enter to configure”. Claude samajh leta hai ke kya install karna hai aur aap ko process se guzarta hai.

/sandbox chalayein

Current setting (“no sandbox”) dikhata aur configure karne ka option deta hai.

Mode chunein

Do asal modes milte hain (neeche dekhein). Sandboxed-YOLO experience ke liye option 1 chunein.

Overrides aur Config review karein

Overrides = fallback par kya hota hai (sandbox se bahar nikalna ya sakht rehna). Config = wazeh allow / deny lists.

ModeWhat it doesFeels like
1 · recommendedCommands try to run in the sandbox automatically; anything that must reach outside falls back to normal permissions. Explicit deny rules are always respected.Sandboxed YOLO
2Allows bash / shell scripts to run, but keeps regular permission prompts.Cautious
0No sandbox (the old default).Manual
claude
> /sandbox
  Sandbox disabled. Press enter to configure…

  # choose:
  1) Sandboxed — auto-approve inside the box, fall back outside   ← pick this
  2) Allow bash + regular permissions
  0) No sandbox

  Sandbox mode is now ON.
  # Config shows sensible deny rules already in place — good.
Docs ka link wahin mojood hai

Har screen par sandbox documentation ka link hota hai. Jab aap fine-grained control chahein — jaise sirf khaas sites ko web access dena — tafseel wahin milegi.

03Kya muft chalta hai aur kya ab bhi poochta hai

prompt nahi

Box mein azaadi se chalta hai

bash / shell scripts chalana aur dil khol kar files read aur write karna — sab auto-approved.

ek baar poochta hai

Bahar pohanchna

Web searches ab bhi ek baar prompt karte hain. Approve karein aur Claude jari rakhta hai. Box se bahar nikalne wali cheez par fence apna kaam karta hai.

04Demo: teen docs par research, hands-off

Sandbox on karke instructor real task chalata hai aur phir bas… dekhta hai. Ghaur karein ke yeh kitna kam poochta hai:

claude — sandbox on
> Please carry out comprehensive research and write three documents
  to the planning directory:
   1. the market-data API from Massive (formerly Polygon)
   2. how we would build our market-data interface
   3. how we would build a market-data simulator

# It researches, thinks, reads & writes files — no permission prompts.
# It only pauses to ask about a web tool (Context7) it had not used before.
Done. 3 documents created in planning/.
Is haftay flow par bharosa karein

Instructor ne documents ko line-by-line review nahi kiya — box ke safe banane ke baad zyada trust karna hi poora nuqta hai. Aap important output (PR) review karein, har keystroke nahi.

05Windows / WSL ki baat

Windows par hain to yeh parhein

Mac (aur Linux) par native sandbox be-fikr hai. Filhaal Windows par WSL zaroori hai (Windows Subsystem for Linux — apne PC ke andar Linux machine chalana). Agar WSL pehle se use karte hain to shandar. Agar nahi to filhaal yeh tareeqa chhor dein aur baqi do (Purple aur Yellow) use karein — yeh har jagah kaam karte hain. WSL ke baghair native Windows support roadmap par hai aur shayad aap ke parhne tak live ho.

06Security aur docs

Agar native sandbox ko bohot use karna hai to documentation mein das minute lagayein. Is mein do qabil-e-ilm baatein hain:

  • Granular config — misal ke taur par sab ya kuch bhi nahi ke bajaye khaas sites ko web access dena.
  • Security considerations — auto-approved commands chalane ke asal caveats wazeh taur par. Sandbox risk kam karta hai; aap ko invincible nahi banata.

✓ Ahm baatein

  • /sandbox Claude Code mein bana hua tez OS-level box deta hai — Docker se halka.
  • Mode 1 sandboxed-YOLO hai: andar auto-approve, bahar fallback, deny-rules hamesha laagu.
  • Files aur bash azaad chalte hain; web search ek baar poochta hai.
  • Mac/Linux: be-fikr. Filhaal Windows ko WSL chahiye — warna cloud approaches use karein.
  • Granular allow-lists aur asal security caveats ke liye docs parhein.