Back to blog

Clawk gives your coding agent its own disposable Linux machine

Clawk is an open-source CLI that runs Claude Code, Codex, or a shell inside a disposable Linux VM, keeping the host machine outside the agent's reach.

What happens when you give a coding agent full permission to install packages, run services, edit files, and execute commands? It usually works faster. But one mistake also happens directly on your real machine, not in an isolated environment. Clawk takes a different approach: it runs the coding agent inside a disposable Linux VM instead of letting it operate directly on your laptop.

The idea is simple but useful. Your project repository is mounted into the temporary machine, and the agent gets a workspace that behaves like a separate computer. If something goes wrong, you can destroy the VM and create a fresh one while your project files and agent conversations remain on the host.

The problem is not only the agent

Coding agents can now do much more than write a file. They install dependencies, run tests, start background services, and use the network. That is exactly why they are useful, and also why they are risky. On your own computer, you either approve every command and babysit the agent, or give it broad permissions and hope it does not touch something sensitive.

Clawk moves the boundary from written instructions to a whole machine. The agent owns a Linux guest environment, while your host filesystem and keys remain outside it unless you explicitly share them.

What Clawk does

Clawk is an open-source command-line tool. Run `clawk` from a project directory and it boots a disposable Linux VM with Claude Code attached. You can also run Codex or a regular shell in the same sandbox. You do not need to write a Dockerfile or install the Docker daemon. The guest can use any OCI image as its root filesystem.

Inside the VM, the agent has broad privileges: it can install packages, change system settings, and run services. The important difference is that those privileges apply to the guest, not to your host machine. You can stop and reattach to a sandbox later, create a snapshot, or destroy the VM and start fresh if it becomes messy.

A real boundary, with real limits

The isolation is not just a prompt telling the agent not to touch a file. The guest runs its own Linux kernel, and the host filesystem is invisible except for the directories you mount. Outbound networking is restricted by an allow-list, and denied connection attempts can be inspected. SSH-agent forwarding lets Git operations work without putting your private SSH keys inside the VM.

That does not make the sandbox magic. Anything you mount or allow is exposed to the agent. If you forward an SSH agent, the agent may still push to repositories it can reach. Review changes before merging or deploying.

🔧 Try it now

Clawk currently targets macOS 14 or later on Apple silicon. Linux support is experimental, and Windows is not supported. On a compatible Mac, install it with `brew install clawkwork/tap/clawk`, enter a test repository, and run `clawk`. Then try `clawk run shell` or `clawk run claude`. Before using an important project, share as little as possible and inspect `clawk network denials` to see blocked connections.

Clawk is still pre-1.0 and changing quickly, but its core idea is compelling: give the coding agent its own disposable machine instead of asking your real computer to trust it.

📚 Sources

  1. Official Clawk repository
  2. Official README
  3. Clawk security model
  4. Networking documentation

Sources

Arabic version

Clawk: خلّي وكيل البرمجة يشتغل بعيد عن جهازك

Clawk أداة مفتوحة المصدر بتعطي وكيل البرمجة جهاز Linux مؤقت خاص فيه، حتى يشتغل براحة بدون ما يلمس ملفات جهازك الأساسي.

شو بيصير إذا عطيت وكيل البرمجة صلاحية كاملة يركّب حزم، يشغّل سيرفر، يعدّل ملفات، وينفّذ أوامر؟ غالباً رح يشتغل أسرع. بس بنفس الوقت، أي غلطة منه بتصير على جهازك الحقيقي، مو بمكان معزول. هون بيجي Clawk: أداة مفتوحة المصدر بتشغّل وكيل البرمجة جوّا جهاز Linux مؤقت، بدل ما تخلّيه يتحرّك مباشرة على لابتوبك.

الفكرة بسيطة بس قوية: كود مشروعك بينركّب داخل الجهاز المؤقت، والوكيل بياخد مساحة يشتغل فيها كأنّو عنده جهاز مستقل. إذا خرب شي، بتدمّر الجهاز المؤقت وبتعمل واحد جديد، بينما ملفات مشروعك ومحادثات الوكيل بيضلّوا عندك.

المشكلة مو بالوكيل لحالو

وكلاء البرمجة صاروا قادرين يعملوا أكتر من كتابة ملف. فيهم ينزّلوا مكتبات، يشغّلوا اختبارات، يفتحوا خدمات بالخلفية، ويستخدموا الشبكة. هاد بالضبط سبب فائدتهم، وهو كمان سبب القلق منهم. لما يكون الوكيل على جهازك، لازم تختار بين خيارين مزعجين: توافق على كل أمر وبتضل تراقبه، أو تعطيه صلاحيات واسعة وتأمل ما يلمس شي حساس.

Clawk بيحاول يغيّر المعادلة. بدل ما تحط كل الثقة داخل تعليمات مكتوبة للوكيل، بتحط حدّ فاصل على مستوى جهاز كامل. الوكيل بيكون مسؤول عن نظام Linux خاص فيه، وما بيشوف ملفات جهازك أو مفاتيحك إلا إذا أنت شاركتها معه صراحة.

شو بيعمل Clawk؟

Clawk هو أداة سطر أوامر مفتوحة المصدر. بتفوت على مجلد المشروع وبتشغّل `clawk`، فالأداة بتقلّع جهاز Linux مؤقت وبتشبك Claude Code عليه. وتقدر كمان تشغّل Codex أو جلسة shell عادية ضمن نفس البيئة. ما بدك تكتب Dockerfile أو ملف إعدادات طويل، وما بدك يكون Docker مركّب على جهازك حتى تبدأ.

الجهاز المؤقت مبني من صورة OCI، يعني فيك تختار بيئة فيها الأدوات المطلوبة لمشروعك. جوّاته الوكيل عنده صلاحيات واسعة: فيو يركّب حزم، يعدّل إعدادات النظام، ويشغّل خدمات. الفرق إن هالصلاحيات محصورة بالضيف، مو بنظام جهازك الأساسي.

وفيك توقف البيئة وترجع إلها لاحقاً، أو تعمل snapshot حتى تحفظ حالتها. وإذا صار التخريب أكبر من اللازم، الأمر `clawk destroy` بيحذف الجهاز المؤقت، وبعدها بتقدر تعمل إقلاع جديد مع نفس المشروع ومحادثة الوكيل.

الحماية مو وعد داخل التعليمات

أقوى جزء بالفكرة إن العزل مو مجرد جملة بتقول للوكيل: لا تلمس هالملف. الجهاز الضيف عنده نواة Linux منفصلة، وملفات جهازك ما بتكون موجودة فيه أصلاً إلا المجلدات اللي شاركتها. هاد بيخفف مساحة الضرر إذا الوكيل شغّل كود مش موثوق أو نفّذ أمر غلط.

الشبكة كمان مقيدة بقائمة سماح. الاتصالات الخارجة للمواقع غير المسموحة بتنحجب، وفيك تشوف محاولات الاتصال المرفوضة. بنفس الوقت، GitHub وبعض الخدمات الشائعة مسموحة مسبقاً، ووكيلك بيقدر يستخدم `ssh-agent` حتى يعمل `git push` من دون ما تدخل مفاتيح SSH نفسها إلى الجهاز المؤقت.

بس لازم تنتبه للحدود: أي شي شاركته مع الوكيل صار مكشوف إلو. وإذا سمحتله بالوصول لمستودع أو خدمة، بيقدر يتعامل معها. كمان `ssh-agent` ما بيمنع الوكيل من دفع تغييرات إذا عنده صلاحية الوصول. العزل قوي، بس ما بيعني إنك توقف مراجعة الكود قبل الدمج أو النشر.

لمين بتفيد الأداة؟

Clawk مناسبة للمطور الفردي أو الفريق الصغير، خصوصاً لما بدك وكيل يشتغل باستقلالية بدل ما توقفه عند كل أمر. بتفيدك إذا عم تجرب مكتبة جديدة، عم تشغّل مشروع فيه خدمات متعددة، أو عم تبني شي وبدك تترك الوكيل يعمل اختبارات وتنظيف وترتيب لفترة.

الشي المهم إن الأداة لسا قبل الإصدار 1.0 وعم تتطور بسرعة. النسخة الحالية موجهة بشكل أساسي لـ macOS 14 أو أحدث على أجهزة Apple silicon، ودعم Linux تجريبي. ما في دعم لـ Windows حالياً، فمو كل مطور رح يقدر يبلّش فيها اليوم.

🔧 كيف تجرّبها هلّق

إذا عندك Mac بمعالج Apple silicon، ثبّت الأداة عبر `brew install clawkwork/tap/clawk`. بعدها فوت على مجلد مشروع تجريبي وشغّل `clawk`. لما تفتح البيئة، جرّب `clawk run shell` لتفوت على Linux، أو `clawk run claude` حتى تشبك وكيل البرمجة.

قبل ما تعطيه مشروع مهم، جرّب بيئة صغيرة، شارك أقل قدر ممكن من الأسرار، وراقب قائمة الاتصالات المرفوضة عبر `clawk network denials`. وإذا حبيت تبدأ من الصفر، نفّذ `clawk destroy` وبعدها `clawk` من جديد. هيك بتختبر الفكرة بإيدك: وكيل عنده مساحة يشتغل فيها، وجهازك الأساسي بيضل بعيد عنه.

📚 المصادر

  1. المستودع الرسمي لـ Clawk
  2. README الرسمي
  3. نموذج الحماية في Clawk
  4. توثيق الشبكة وقائمة السماح
Back to all articles