كلود يخلّص شغلك وأنت نايم
المهام الطويلة ما تحتاج منك تكون صاحياً لتنتهي.
قبل ما تنام، تخيّل إنك تعطي كلود مهمة كاملة، تغلق اللابتوب، وتصحى على ملف جاهز للمراجعة. هذا مو خيال علمي، هذا بالضبط ما يقدر Claude Code يسويه الحين. السؤال اللي يدور في بالك: كيف أثق إن الشغل راح يكمل وأنا مو موجود؟
🧩 إيش هو بالضبط
Claude Code يقدر يشتغل بشكل مستقل على مهام برمجية طويلة، بدون ما تكون أنت مفتح الشاشة أو مراقب كل خطوة. يعني بدل ما تجلس ساعتين تعطيه تعليمات جملة بجملة، تكتب له المطلوب بوضوح وتتركه يشتغل.
فكّر فيه مثل ما تعطي مقاولاً مفتاح البيت وتقوله "عدّل المطبخ". ما تحتاج تقف جنبه وتشاهده يحفر. ترجع الصبح وتشوف الشغل.
الفرق الأساسي هنا إن Claude Code ما يكتفي بيكتب كود، بل يفتح ملفات ويشغّل أوامر في الطرفية (terminal) ويراجع نتائج الاختبارات (tests) ويعدّل على نفسه لو طلع خطأ، كل هذا بشكل تلقائي.
⚙️ كيف يشتغل
لما تعطيه مهمة وتتركه، Claude Code يشتغل بحلقة منطقية مستمرة:
1️⃣ يقرأ المهمة ويحللها ويرسم خطة تنفيذ في رأسه
2️⃣ يفتح الملفات المرتبطة ويفهم سياق الكود الموجود
3️⃣ يكتب التعديلات أو الميزة الجديدة خطوة بخطوة
4️⃣ يشغّل الاختبارات ويقرأ النتائج
5️⃣ لو فيه خطأ يعدّل ويحاول مرة ثانية، لوحده
6️⃣ لما ينتهي يحفظ كل شيء وينتظر مراجعتك
اللي يخلي هذا آمناً هو الخطوة السادسة. Claude Code ما يرفع الكود ولا يدمجه ولا ينشره لوحده. تصحى على diff نظيف 🧾 يعني ملف يوضح بالضبط كل سطر اتغيّر، ولا شيء يصير بشكل نهائي إلا لما تقرر أنت.
🌍 وين تشوفه في حياتك
هذا النوع من الشغل المستقل طوال الليل مناسب بشكل خاص لـ:
💻 المطورين اللي عندهم قائمة طويلة من المهام الصغيرة مثل كتابة unit tests أو تنظيف كود قديم
🚀 أصحاب المشاريع اللي يبون يضيفون ميزة جديدة بدون ما يوقفون يومهم كامل
🔁 الفرق اللي تشتغل على sprints وتبي تسرّع الإنجاز بين الاجتماعات
📦 أي شخص عنده مهمة "مهمة بس مو عاجلة" تراكمت لأسابيع
🛠️ الأدوات اللي تستخدمها فعلاً
🔧 Claude Code
هذا هو الأداة الأساسية. Claude Code يشتغل مباشرة في الطرفية ويقدر يقرأ ويكتب ويشغّل أوامر على جهازك. هو اللي يخلي كل هذا ممكناً.
كيف تبدأ:
1️⃣ روح على claude.ai/code وحمّل الأداة، أو ثبّتها بالأمر: npm install -g @anthropic-ai/claude-code
2️⃣ افتح مجلد مشروعك في الطرفية ثم اكتب: claude
3️⃣ اكتب مهمتك بوضوح واضغط Enter، ثم اتركه يشتغل
🔧 Git
Git هو نظام تتبع التغييرات (version control). بعد ما ينتهي Claude Code من شغله، تستخدم git diff عشان تشوف كل سطر اتغيّر قبل ما تقبل أي شيء. هذي هي طبقة الأمان اللي تخلّيك تتحكم في كل شيء.
كيف تبدأ:
1️⃣ لو ما عندك Git: حمّله من git-scm.com
2️⃣ في مجلد مشروعك اكتب: git diff عشان تشوف التغييرات
3️⃣ لو عجبك الشغل: git add . ثم git commit -m "وصف التغييرات"
🔧 tmux
tmux يخلي الطرفية تشتغل حتى لو أغلقت اللابتوب أو انقطع الاتصال. بدونه، إغلاق الغطا يوقف كل شيء. للمهام الليلية هذا هو اللي يضمن إن Claude Code يكمل شغله.
كيف تبدأ:
1️⃣ على Mac اكتب: brew install tmux أو على Linux: sudo apt install tmux
2️⃣ اكتب tmux لتفتح جلسة جديدة محمية
3️⃣ شغّل Claude Code داخل tmux، ثم اضغط Ctrl+B ثم D لتخرج بدون ما توقف الجلسة
💡 جرّب بنفسك: خطوة بخطوة
السيناريو: عندك ملف كود قديم فيه دوال ما عندها أي اختبارات، وتبي Claude يكتب لها unit tests كاملة وأنت نايم.
1️⃣ افتح الطرفية وروح لمجلد مشروعك، ثم اكتب tmux عشان تفتح جلسة محمية ما تنقطع
2️⃣ اكتب claude وانتظر ثواني حتى تظهر واجهة الإدخال
3️⃣ اكتب مهمة واضحة، مثال: "اكتب unit tests شاملة لكل الدوال في ملف utils.js باستخدام Jest، غطّ الحالات الطبيعية وحالات الخطأ والقيم الحدية، ولا تعدّل على utils.js نفسه"
4️⃣ اضغط Ctrl+B ثم D لتخرج من tmux بدون ما توقفه، وروح نام
الصبح: اكتب tmux attach لترجع للجلسة وتشوف ما أنجزه. اكتب git diff لتراجع كل سطر كتبه قبل ما تقبله.
وش تسوي بعد ذا
✅ جرّب اليوم: افتح مشروع عندك وحدّد مهمة واحدة واضحة وخلّ Claude Code يشتغل عليها لوحده
✅ تعلّم كيف تكتب تعليمة دقيقة للمهام الطويلة، الوضوح هنا يفرق فرقاً حقيقياً في جودة النتيجة
✅ اسأل نفسك: إيش المهام اللي تؤجّلها دايماً لأنها تاخذ وقت؟ هذي هي أول قائمتك
الثقة الحقيقية تجي لما تراجع أول diff وتلقى الشغل صح.
———— English ————
Claude Finishes Work While You Sleep
Long tasks do not need you watching for them to get done.
Most people use Claude as a back and forth tool. Ask, get an answer, ask again. That works fine for short things. But there is a completely different way to use it: hand it a real task at night, close your laptop, and wake up to finished work waiting for your review. The question worth asking is not whether it can do this — it already can — but whether you are setting it up correctly to trust the result.
🧩 What it actually is
Claude Code is Anthropic's AI coding tool that runs directly in your terminal. Unlike the chat interface, it does not just write text — it reads your files, runs commands, checks test output, and edits code on your machine. When you give it a clear task and let it run, it works through the problem on its own, the way a capable engineer would if you handed them a task and said "I'll check your work in the morning."
The analogy that fits: imagine hiring a contractor and giving them a key to your office. You do not stand over them while they work. You come back, inspect what they did, and decide what to accept. Claude Code works the same way, except the inspection is a clean git diff that shows you every single line it touched.
⚙️ How it works
Claude Code runs in a continuous reasoning loop when given a task. Here is what happens while you sleep:
1️⃣ It reads your task, breaks it into smaller steps, and maps the relevant files
2️⃣ It opens and reads the actual code to understand context before touching anything
3️⃣ It writes the changes, one logical piece at a time
4️⃣ It runs your tests and reads the output
5️⃣ If something fails it diagnoses the error and tries a corrected approach on its own
6️⃣ When finished it saves everything and stops, waiting for your review
What makes this trustworthy is step six. It does not merge, push, or deploy anything on its own. You wake up to a diff 🧾 — a precise record of every change — and nothing becomes permanent until you decide it does.
🌍 Where you see it
This kind of overnight autonomous work fits specific situations well:
💻 Developers with a real backlog of smaller tasks: writing tests, cleaning up legacy code, adding error handling to existing functions
🚀 Solo founders who want a feature built but cannot lose a full working day to it
🔁 Teams that want progress made between sprints without burning focused human time
📦 Anyone whose "important but not urgent" list has been sitting untouched for weeks
🛠️ Tools you actually use
🔧 Claude Code
This is the core tool. It runs in your terminal, reads and writes files, executes shell commands, and works through problems without needing you present. Everything described in this guide runs through Claude Code.
How to get started:
1️⃣ Go to claude.ai/code and follow the install instructions, or run: npm install -g @anthropic-ai/claude-code
2️⃣ Navigate to your project folder in the terminal and type: claude
3️⃣ Write your task clearly and press Enter, then leave it running
🔧 Git
Git is the version control system that makes overnight work safe to review. After Claude Code finishes, git diff shows you every line it changed before you accept anything. This is your inspection layer, and it is what keeps you fully in control.
How to get started:
1️⃣ If you do not have Git: download it from git-scm.com
2️⃣ In your project folder type: git diff to see all changes Claude made
3️⃣ If the work looks good: git add . then git commit -m "description of what changed"
🔧 tmux
tmux keeps your terminal session alive even after you close your laptop or disconnect from a server. Without it, closing the lid kills the process mid-task. For overnight work, tmux is what guarantees Claude Code actually finishes.
How to get started:
1️⃣ On Mac run: brew install tmux or on Linux: sudo apt install tmux
2️⃣ Type tmux to open a new protected session
3️⃣ Start Claude Code inside that session, then press Ctrl+B then D to detach without stopping it
💡 Try it yourself: step by step
Scenario: you have an existing file with several functions and no tests. You want Claude Code to write complete unit tests for it overnight.
1️⃣ Open your terminal, navigate to your project folder, and type tmux to start a session that survives after you close your laptop
2️⃣ Type claude and wait a few seconds for the input prompt to appear
3️⃣ Write a clear task: "Write comprehensive unit tests for every function in utils.js using Jest. Cover normal inputs, edge cases, and expected error conditions. Do not modify utils.js itself."
4️⃣ Press Ctrl+B then D to detach from the tmux session without stopping it, and go to sleep
In the morning: type tmux attach to return to the session and see what was completed. Run git diff to review every line before accepting anything.
What to do next
✅ Pick one real task from your backlog today and let Claude Code run it while you do something else — even a two hour errand is enough to see how it actually works
✅ Learn to write a precise task description: the clearer your instructions, the less Claude has to guess, and the cleaner the result you wake up to
✅ Check Claude Code's permission settings once so you know exactly what it can and cannot touch on your machine before you leave it running overnight
The first time you wake up to finished work is when the habit forms.