29 April 2026

اوامر في كلود تقلل من استهلاك التوكنزArabic

Arabic
 
 
أوامر الشرطة المائلة في Claude Code
ثلاثة أوامر مدمجة تخليك تتحكم بجلسة العمل بدقة بدل ما تعيد من البداية كل مرة.
 
لو جربت Claude Code أكثر من خمس عشرة دقيقة، راح تلاحظ إن المحادثة تكبر بسرعة. الكود يتراكم، السياق يمتلئ، والنموذج يبدأ يفقد تركيزه على اللي يهمك فعلاً. المشكلة مو في Claude، المشكلة في إنك ما تستخدم الأدوات اللي بنوها بالضبط لهذا السبب.
 
Claude Code يحتوي على أكثر من ستين أمر مدمج تكتبها بالشرطة المائلة مباشرة في الطرفية. ثلاثة منها تستحق إنك تحفظهم من اليوم الأول.
 
🔍 إيش هو الأمر بالشرطة المائلة
 
أمر الشرطة المائلة (Slash Command) هو اختصار تكتبه في طرفية Claude Code يبدأ بـ / ويُنفَّذ فوراً بدون ما تكتب جملة كاملة. فكّر فيه مثل اختصارات لوحة المفاتيح في أي تطبيق، لكن هنا الاختصار يوجّه النموذج نفسه أو يتحكم في الجلسة. الفرق الجوهري بينها وبين أنك تكتب تعليمة عادية؟ الأوامر تعمل على مستوى الجلسة بأكملها، مو على مستوى رسالة واحدة فقط.
 
⚙️ ثلاثة أوامر تستخدمها فعلاً
 
**الأمر الأول هو /compact**
 
لما تطول المحادثة، نافذة السياق (Context Window) تمتلئ. Claude يبدأ ينسى الملفات اللي أضفتها في البداية أو يخلط بين أجزاء من الكود. /compact يحل هذا بإنه يضغط تاريخ المحادثة إلى ملخص ذكي، ويبقي السياق المهم ويحذف الثرثرة الزائدة.
 
اللي يميّزه إنك تقدر تعطيه تعليمة:
 
/compact keep the migration plan, drop the debugging
 
يعني بصراحة، أنت تختار إيش يُحفظ وإيش يُحذف. كثير من المستخدمين المتقدمين يستخدمونه كل عشرين دقيقة تقريباً خلال جلسات العمل الطويلة.
 
**الأمر الثاني هو /clear**
 
/clear أبسط من /compact لكن حين تحتاجه ما فيه بديل. يحذف تاريخ المحادثة بالكامل ويفتح جلسة جديدة نظيفة. مفيد لما تنهي مهمة وتبغى تبدأ موضوع مختلف تماماً دون ما تتأثر بالسياق القديم. مثلاً: كتبت ميزة جديدة كاملة وتبغى تبدأ تكتب الاختبارات. ما في سبب تجرّ معك كل نقاشات التصميم السابقة.
 
الفرق الجوهري بينه وبين /compact: /clear يبدأ من الصفر تماماً، بينما /compact يحافظ على خيط تسلسل ذكي من المحادثة.
 
**الأمر الثالث هو /review**
 
يطلب من Claude مراجعة كود آخر التغييرات، وهو أسرع بكثير من ما تكتب "راجع لي الكود" يدوياً لأنه مرتبط فعلاً بحالة الجلسة وملف المشروع. يعطيك تغذية راجعة منظمة على البنية، الأداء، والأخطاء المحتملة.
 
🌍 وين تستخدمها في الواقع
 
🖥️ لما تشتغل على مشروع ويتراكم الكود وتحس الردود تصير أطول وأقل دقة، هنا /compact ينقذ الجلسة.
🔄 لما تنتهي من مهمة كاملة وتبغى تبدأ جزء مختلف من المشروع، /clear يعطيك صفحة بيضاء.
🧐 لما تنهي كتابة دالة أو ملف وتبغى رأي ثاني سريع قبل ما تتقدم، /review يوفر عليك تكتب التعليمة من البداية.
 
🛠️ الأداة اللي تحتاجها أولاً
 
🔧 Claude Code (بالإنجليزي كما هو رسمياً)
المحطة الرئيسية لكل هذه الأوامر. هو واجهة طرفية مدمجة بـ Claude تشغّل النموذج مباشرة من سطر الأوامر.
كيف تبدأ:
1️⃣ اذهب إلى claude.ai/code أو ثبّته عبر npm بالأمر: npm install -g @anthropic-ai/claude-code
2️⃣ شغّل claude في الطرفية داخل مجلد مشروعك
3️⃣ اكتب / لترى كل الأوامر المتاحة، أو ابدأ بـ /help
 
💡 جرّب بنفسك: خطوة بخطوة
 
هذا سيناريو واقعي يوضّح الثلاثة معاً:
 
1️⃣ افتح Claude Code في مشروع موجود وابدأ جلسة. اطلب منه يشرح ملف معين ويحلّل بنيته.
2️⃣ بعد ما تناقشتم في عدة ملفات وطال الحوار، اكتب /compact keep the architecture decisions في الطرفية.
3️⃣ لاحظ كيف يُلخّص الجلسة ويبقّي فقط القرارات الجوهرية. ادخل واكتب كود جديد.
4️⃣ لما تنتهي من الكود، اكتب /review وشوف التقرير اللي يطلع. بعده، اكتب /clear وابدأ جلسة نظيفة للمهمة الجاية.
 
النتيجة المتوقعة: ردود أدق، جلسات أطول بدون ما تخسر السياق، وكود أنظف لأنك تراجعه قبل ما تتقدم.
 
وش تسوي بعد ذا
✅ ثبّت Claude Code إذا ما جربته، وابدأ بمشروع موجود عندك
✅ ابحث عن قائمة الأوامر الكاملة بكتابة /help في الطرفية، في أكثر من ستين أمر
✅ اسأل نفسك: في الجلسات الطويلة، لما تحس الردود تتشتت، هل أنت تُدير السياق أم تتركه يتراكم؟
 
الأداة موجودة، الأوامر مدمجة، اللي تبقّى إنك تستخدمهم.
 
———— English ————
 
Claude Code's Built-in Slash Commands
Three commands that let you control your session with precision instead of starting over every time.
 
If you have spent more than fifteen minutes with Claude Code, you have probably noticed how fast a session gets unwieldy. Files accumulate, context fills up, and the model starts losing track of what actually matters to you. The problem is not Claude. The problem is not using the tools that were built precisely for this.
 
Claude Code ships with over sixty built-in commands you can type directly into the terminal. Three of them are worth memorising on day one.
 
**What a slash command actually is**
 
A slash command is a shortcut you type in the Claude Code terminal, starting with /, that executes immediately without writing a full sentence. Think of it like keyboard shortcuts in any application, but here the shortcut directs the model itself or controls the session. The key difference between a slash command and a normal instruction is that commands operate at the session level, not just on one message.
 
⚙️ The three commands that earn their place
 
**/compact**
 
When a conversation runs long, the context window fills. Claude starts forgetting files you added earlier or conflating different parts of the codebase. /compact solves this by compressing conversation history into a smart summary that keeps what matters and drops what does not.
 
What makes it stand out is that you can pass a specific instruction along with it:
 
/compact keep the migration plan, drop the debugging
 
You decide what gets preserved and what gets cut. Many experienced users run this roughly every twenty minutes during heavy sessions.
 
**/clear**
 
/clear is simpler than /compact, but when you need it nothing else works. It deletes the entire conversation history and opens a completely fresh session. This matters when you have finished one task and want to start something different without dragging the old context into the new work. Imagine you just finished building a full feature and now need to write tests. There is no reason to carry all the design discussions along for the ride.
 
The core difference from /compact: /clear is a full reset, while /compact preserves a smart thread of continuity from the session.
 
**/review**
 
This requests a structured code review of recent changes and is significantly faster than manually typing "review my code" each time, because it is tied directly to the session state and project files. You get structured feedback on architecture, performance, and potential bugs without setting up the request from scratch.
 
🌍 Where this shows up in real work
 
🖥️ When a project session grows long and responses start getting less precise, /compact saves the session without losing the thread.
🔄 When you finish a complete task and want to move to a different part of the project, /clear gives you a blank slate.
🧐 When you finish writing a function or file and want a quick second opinion before moving on, /review saves you from having to write the instruction manually.
 
🛠️ The tool you need first
 
🔧 Claude Code
The home for all of these commands. It is a terminal interface that runs Claude directly from your command line inside your project folder.
How to get started:
1️⃣ Go to claude.ai/code or install it via npm with: npm install -g @anthropic-ai/claude-code
2️⃣ Run claude in the terminal inside your project directory
3️⃣ Type / to see all available commands, or start with /help
 
💡 Try it yourself: step by step
 
Here is a realistic scenario that puts all three commands together:
 
1️⃣ Open Claude Code in an existing project and start a session. Ask it to explain a specific file and analyse its structure.
2️⃣ After discussing several files and the session grows long, type /compact keep the architecture decisions into the terminal.
3️⃣ Watch it summarise the session and retain only the core decisions. Continue writing new code with a focused context.
4️⃣ Once you finish, type /review and read the structured report. Then type /clear and begin a fresh session for your next task.
 
What you get at the end: sharper responses, longer sessions without losing context, and cleaner code because you review it before moving forward.
 
**What to do next**
✅ Install Claude Code if you have not tried it yet, and start with a project you already have open
✅ Run /help in the terminal to browse all sixty-plus built-in commands once you are inside a session
✅ Ask yourself honestly: in long sessions, when responses start drifting, are you managing your context or just letting it pile up?
 
The tool is there. The commands ship with it. What is left is using them.

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