8 June 2026

مسح أو ضغط للذاكرة — Clear Versus CompactArabic

Arabic
مسح أو ضغط للذاكرة
تعرّف متى تمسح المحادثة ومتى تضغطها، وكل جلسة تصير أسرع وأرخص.
 
كل رسالة ترسلها لـ Claude تكلّفك مال. مو بس الرسالة اللي كتبتها الحين، بل كل شيء قبلها في نفس المحادثة. كلما طالت المحادثة كلما دفعت أكثر على كل رد، حتى لو سؤالك البسيط نفسه. الحل مو إنك توقف تستخدم Claude، الحل إنك تعرف متى تمسح ومتى تضغط.
 
🧩 إيش هو بالضبط
Claude عنده ذاكرة تسمى "نافذة السياق" (context window). هذي النافذة تحتوي كل شيء في المحادثة الحالية، كلامك وكلام Claude من أول رسالة لآخر رسالة. كل ما ترسل رسالة جديدة، Claude يقرأ كل هذا من الأول. يعني المحادثة اللي فيها 50 رسالة أغلى بكثير من اللي فيها 5 رسائل، حتى لو السؤال نفسه.
 
عندك خيارين لما تحس المحادثة صارت ثقيلة:
 
🗑️ المسح (Clear): تبدأ محادثة جديدة نظيفة. Claude ينسى كل شيء بدون رجعة.
🗜️ الضغط (Compact): Claude يلخّص المحادثة السابقة ويحتفظ بالمهم فقط، بدون ما تخسر الخيط.
 
⚙️ كيف يشتغل
الفكرة بسيطة لما تفهم كيف Claude يحسب التكلفة:
 
1️⃣ كل رسالة ترسلها تحتوي الرسالة الجديدة بالإضافة لكل تاريخ المحادثة
2️⃣ Claude يعالج هذا كله مع كل رد
3️⃣ كلما كبر التاريخ كلما كبر عدد التوكنز (tokens) المستهلكة
4️⃣ التوكنز هي العملة الحقيقية، وكل ألف منها لها سعر محدد
 
لما تضغط المحادثة، Claude يكتب ملخصاً دقيقاً لما حدث ويحذف التفاصيل الزائدة. الناتج: سياق أقصر بكثير مع الحفاظ على الفهم الكامل. المسح أبسط وأرخص لكنه يحذف كل شيء فوراً.
 
🌍 وين تشوفه في حياتك
هذا الموضوع يمسّك مباشرة في مواقف كثيرة:
 
💻 لما تكتب كود مع Claude وتريد تكمل على نفس المشروع بعد ساعات
📝 لما تنقّح نص طويل وترسل مسودات متعددة في نفس المحادثة
🔍 لما تبحث عن معلومة مستقلة وما عندك حاجة تتذكّر جلسة سابقة
🏗️ لما تبني شيئاً معقداً على مراحل وكل مرحلة تعتمد على قرارات سبقتها
 
🛠️ الأدوات اللي تستخدمها فعلاً
 
🔧 Claude.ai
الواجهة الرسمية لـ Claude عبر المتصفح أو الجوال. فيها زر "New chat" لبدء محادثة جديدة، وخيار الضغط (Compact) موجود في إعدادات المحادثة حسب نوع حسابك.
كيف تبدأ:
1️⃣ روح على claude.ai وسجّل دخول
2️⃣ افتح أي محادثة طويلة
3️⃣ اضغط على القائمة الجانبية وشوف خيارات إدارة المحادثة
 
🔧 Claude Code
أداة سطر الأوامر من Anthropic، مبنية للمطورين. الأوامر هنا مباشرة وواضحة.
كيف تبدأ:
1️⃣ ثبّت Node.js من nodejs.org
2️⃣ شغّل في الطرفية: npm install -g @anthropic-ai/claude-code
3️⃣ داخل أي جلسة، اكتب /clear للمسح الكامل أو /compact للضغط مع الحفاظ على السياق
 
💡 جرّب بنفسك: خطوة بخطوة
سيناريو: أنت تكتب كود مع Claude منذ ساعة. المحادثة وصلت 30 رسالة وتريد تكمل بدون ما تدفع تكلفة السياق الكاملة على كل رد.
 
1️⃣ ابقَ في نفس المحادثة الحالية في Claude Code أو Claude.ai
2️⃣ اكتب /compact أو شغّل خيار التلخيص في الواجهة
3️⃣ Claude يولّد ملخصاً دقيقاً للجلسة كلها، يحتفظ بالقرارات والكود والاتجاه العام
4️⃣ كمّل من نفس النقطة بالضبط، لكن السياق الحين خفيف جداً
 
النتيجة: نفس الفهم والاستمرارية، بربع التكلفة تقريباً.
 
وش تسوي بعد ذا
✅ بعد كل مهمة منتهية مع Claude، افتح محادثة جديدة بدل ما تكمل في نفس الخيط
✅ إذا كنت في منتصف مشروع وتحتاج تكمل، استخدم /compact بدل /clear حتى ما تخسر القرارات السابقة
✅ اسأل نفسك قبل كل رسالة: هل Claude يحتاج فعلاً يتذكر كل اللي قبل؟
 
أغلى عادة في استخدام AI مو الأسئلة الصعبة، بل المحادثات اللي تركتها مفتوحة.
 
———— English ————
 
Clear Versus Compact
One small habit separates people who burn through Claude credits from people who stretch them far.
 
Every message you send to Claude carries the full weight of your conversation history. Not just your latest question, but everything from the first message to now. The longer that history grows, the more you pay per reply, even when your actual question is short. The fix is not using Claude less. It is knowing when to wipe and when to compress.
 
What it actually is
Claude has a memory called a context window. It holds the entire conversation you are in, your messages and Claude's replies, from start to finish. Every time you send a new message, Claude reads all of it again from the top. A fifty message conversation costs dramatically more per response than a five message one, even if the underlying question is identical.
 
You have two tools for managing this:
 
🗑️ Clear: a fresh start. New conversation, blank slate. Claude remembers nothing from before.
🗜️ Compact: a summarization pass. Claude distills the conversation into a tight, accurate summary and discards the verbose history, keeping the thread alive without the bulk.
 
How it works
The economics are straightforward once you see them:
 
1️⃣ Every message you send includes your new text plus the full conversation history
2️⃣ Claude processes all of that on every single response
3️⃣ The longer the history, the more tokens consumed per reply
4️⃣ Tokens are the actual unit of cost, priced per thousand
 
When you compact, Claude writes a precise summary of what has been decided, built, or discussed, then drops the verbose back and forth. The result is a much shorter context with the key information intact. Clearing is simpler and cheaper but permanently discards everything with no recovery.
 
Where you see it
The choice shows up constantly in real use:
 
💻 Continuing a coding session hours after you last left it
📝 Revising a long document across multiple draft cycles in the same thread
🔍 Asking a quick standalone question that has nothing to do with earlier work
🏗️ Building something complex in stages where each phase depends on decisions made earlier
 
🛠️ Tools you actually use
 
🔧 Claude.ai
The official web and mobile interface for Claude. It includes a "New chat" button for clearing, and the compact or summarize option appears in conversation settings depending on your account tier.
How to get started:
1️⃣ Go to claude.ai and sign in
2️⃣ Open any long conversation
3️⃣ Look for the conversation options menu to find the compact or summarize action
 
🔧 Claude Code
The command line tool from Anthropic, built for developers. The commands here are direct and unambiguous.
How to get started:
1️⃣ Install Node.js from nodejs.org
2️⃣ Run in your terminal: npm install -g @anthropic-ai/claude-code
3️⃣ Inside any active session, type /clear to wipe everything or /compact to compress without losing continuity
 
💡 Try it yourself: step by step
Scenario: you have been writing code with Claude for an hour. The conversation is thirty messages deep. You want to keep going without paying the full context cost on every reply.
 
1️⃣ Stay inside your current conversation in Claude Code or Claude.ai
2️⃣ Type /compact or trigger the summarize option in the interface
3️⃣ Claude generates a precise summary of the full session, preserving decisions, code direction, and any open questions
4️⃣ Continue exactly where you left off, but now your context is lean
 
The result: same continuity, roughly a quarter of the ongoing token cost.
 
What to do next
✅ After any completed task with Claude, open a new chat rather than continuing in the same thread
✅ When you are in the middle of a project and need continuity, use /compact instead of /clear so past decisions stay accessible
✅ Before each message, ask yourself whether Claude actually needs to remember everything that came before it
 
The most expensive habit in AI use is not asking hard questions. It is leaving conversations open when they should have been closed.

Most value

Start building with me now

We sit together, break down your problem, and I build the AI solution with you step by step

60minutes
  • A private session with you
  • Real building during the session
  • Results you take with you when we finish
Book a build session

100% free

A free consultation about your problem

Start

The full path · Monthly subscription

Full access to every guide (29) for 249 AED/month