What Is a Terminal? (Don't Be Scared)
The terminal sounds intimidating, but it's actually one of the simplest tools on your computer. Let's demystify it completely.
It's Just a Text Window
A terminal is a text-based window where you type commands to your computer. That's it. No magic, no hacking, no Matrix-style green characters raining down the screen. It's literally a window where you type words and your computer responds.
Think of it this way: the terminal is like texting your computer. You send a message (a command), and your computer responds with a result. You're already used to this concept from WhatsApp or Messenger — you type something, you get something back. Same idea.
The only difference is that instead of texting a person, you're texting your computer. And your computer is very literal — it does exactly what you ask, nothing more, nothing less. It won't guess what you mean. It won't assume. It just does exactly what you type.
Why Not Just Use the Regular Interface?
Great question. You're probably wondering: "I've been using my computer with clicks and buttons for years. Why would I ever type commands?" The answer is simple: some powerful tools only work through the terminal. Claude Code is one of them.
Think of it like driving. You usually drive automatic — easy, comfortable, gets you where you need to go. But some race cars only come in manual. The terminal is like a manual transmission — it gives you access to tools and capabilities that don't have a "click" version. Claude Code is one of those tools. It's built for the terminal because the terminal gives it direct access to your files, your APIs, and your system.
The good news? You don't need to become a terminal expert. You'll type a few commands during setup, and after that, Claude Code handles everything through natural conversation. You talk to it in plain English inside the terminal window.
What It's Called on Your Computer
- Mac: It's called "Terminal" — a built-in app that comes with every Mac.
- Windows: It's called "Command Prompt" (cmd) or "PowerShell" — also built-in. There's also "Windows Terminal" which you can download from the Microsoft Store for a nicer experience.
- Linux: Usually just called "Terminal" — if you're on Linux, you probably already know this.
How to Open It
Cmd + Space to open Spotlight Search. Type "Terminal" and press Enter. A window will appear with a blinking cursor. That's your terminal. Done.
Windows key on your keyboard. Type "cmd" or "PowerShell" and press Enter. A window will open with a blinking cursor. That's your terminal. Done.
What You'll See
When you open the terminal, you'll see a window — dark or light background — with a blinking cursor waiting for you to type. That's it. No buttons, no menus, no icons. Just a cursor.
It might show something like this before the cursor:
mazin@MacBook-Pro ~ %
Or on Windows:
C:\Users\Mazin>
This is just your computer telling you who you are and where you are (which folder you're in). You can completely ignore it. The important thing is the blinking cursor — that's where you type.
What If Something Goes Wrong?
The terminal can't break your computer. If you type something wrong, you'll get an error message — that's it. No harm done. Just read the error and try again. The most common "mistake" beginners make is typos. If you type LS instead of ls, you'll get a "command not found" error. That's normal. Commands are case-sensitive on Mac/Linux (lowercase matters). Just retype correctly and move on.
If you ever feel "stuck" in the terminal — like it's not responding or something weird is happening — just press Ctrl + C. That's the universal "cancel" button in the terminal. It stops whatever is running and gives you your cursor back.
Common Commands (Don't Memorize — Just Know They Exist)
You don't need to memorize any of these. You'll copy-paste the few commands you need during setup. But here are the most basic ones so they don't surprise you:
ls(Mac/Linux) ordir(Windows) — lists the files in your current folder. Like opening a folder and looking at what's inside.cd folder-name— goes into a folder. Like double-clicking a folder to open it.cd ..— goes back one folder. Like clicking the "back" button.mkdir name— creates a new folder. Like right-clicking and choosing "New Folder".
That's the entire list of commands you need to know. Four commands. Everything else, Claude Code handles for you through natural conversation.
You don't need to become a terminal expert. You'll literally type 3-4 commands to set everything up, and then Claude Code handles the rest through conversation. The terminal is just where Claude Code lives — think of it as Claude Code's home address.
Claude Code vs Claude Chat: The Critical Difference
This is the single most important concept in this entire framework. Understanding this difference is what separates people who use AI as a toy from people who use it as a tool.
claude.ai — The Website (Chat)
You already know this one. You go to claude.ai in your browser, you type a question, and Claude responds with text. It's a conversation. It's helpful. But it has hard limits:
- It can only respond with text — words on a screen
- It has no access to your computer, your files, or your folders
- It has no access to Meta Ads, Shopify, or any external platform
- It can't execute code, make API calls, or browse the web
- It's like texting a really smart friend who gives you advice but can't actually DO anything for you
Claude Code — The Terminal App
Claude Code is a completely different product. It runs in your terminal (the text window we just learned about), and it lives on your computer. This gives it superpowers:
- It can read and write files on your computer
- It can make API calls to Meta, Shopify, and any other platform
- It can browse the web (using Playwright — more on this later)
- It can execute code — run scripts, process data, generate reports
- It can interact with external services — create campaigns, pull analytics, modify products
- It's like having that smart friend physically in your office, sitting at your computer, with access to everything — and asking your permission before every action
Why This Matters for Media Buying
Here's where it gets real. Let's compare what happens when you ask for the same thing:
- Chat can TELL you how to create a campaign — you still have to go to Ads Manager and do it manually, step by step
- Code can actually CREATE the campaign via Meta's API — it's done, the campaign exists
- Chat can DESCRIBE your performance trends — you still need to open Ads Manager, export data, and analyze it yourself
- Code can PULL your real data via the API, analyze it, and present a formatted report — ready to read
- Chat can SUGGEST which ad sets to scale — you still decide and manually adjust budgets
- Code can CHECK performance, IDENTIFY winners, and INCREASE budgets via the API — with your approval
See the pattern? Chat gives you information. Code takes action.
A Day-in-the-Life Comparison
Let's make this even more concrete with a real scenario:
Morning check with Claude Chat: "How are my campaigns doing?" Claude responds: "I don't have access to your ad account, but here's how to check: open Ads Manager, go to Campaigns tab, look at your ROAS column..." You spend 15 minutes navigating Ads Manager, exporting data, and making sense of it.
Morning check with Claude Code: "How are my campaigns doing?" Claude Code runs your Performance Monitor Skill, pulls your data via Meta's API, analyzes all active campaigns, and presents a report: "3 campaigns running. Top performer: Summer Sale at 4.2x ROAS. Underperformer: Brand Awareness at 0.8x ROAS — recommend pausing. 2 ad sets ready for scaling." Done in 30 seconds.
That's the difference. Not just in capability, but in time. Every manual task you do today becomes a conversation with Claude Code tomorrow.
Think of it this way: claude.ai is like texting a smart friend who gives you advice. Claude Code is like hiring that friend to come to your office, sit at your computer, and do the actual work — with your permission for every action. Both are Claude. But one talks, the other acts.
Claude Pro & Max — Which One Do You Need?
Claude Code is not free. It requires a paid subscription. Here's exactly what each plan gives you and which one to start with.
The Plans Explained
Claude Code requires a paid subscription to Anthropic. There are two tiers that matter:
- Claude Pro ($20/month): Gives you access to Claude Code with moderate usage limits. This is perfect for learning, experimenting, and running agents a few times per day. For most people starting out, this is more than enough.
- Claude Max ($100/month): Same access to Claude Code, but with significantly higher rate limits. This is for when you're running multiple agents daily across real client accounts and need heavy, uninterrupted usage.
Which Should You Pick?
Start with Pro. Learn the system, build your first Skills, run your first agents. When you find yourself hitting rate limits because you're running agents daily for multiple accounts, upgrade to Max. Don't overspend before you know the system.
The Real Comparison
Think about what the alternative costs: hiring a junior media buyer runs $500 to $2,000 per month. An AI assistant that works 24/7 costs $20 to $100 per month. It doesn't take sick days, doesn't forget things, and doesn't need training on how to use Ads Manager — it already knows.
| Feature | Free | Pro ($20) | Max ($100) |
|---|---|---|---|
| Claude Chat (browser) | Yes | Yes | Yes |
| Claude Code (terminal) | No | Yes | Yes |
| API calls per day | N/A | Moderate | High |
| Context window | Standard | Standard | Extended |
| Best for | Casual use | Learning + light use | Daily professional use |
Start with Pro at $20/month. It's enough to learn everything in this framework, build your Skills, and start running agents. Upgrade to Max only when you're managing multiple accounts and running agents daily as part of your workflow.
What Is an API? (Restaurant Edition)
APIs are how your AI agents talk to Meta, Shopify, and every other platform. This is the most important technical concept to understand — and we're going to make it painfully simple.
The Restaurant Analogy
Imagine you're sitting at a restaurant. Here's how it works:
- YOU = your AI agent (the one who wants something done)
- THE MENU = API documentation (lists everything you can order, with descriptions and rules — "no substitutions on the grilled chicken")
- THE WAITER = the API itself (takes your order to the kitchen, brings back the result)
- THE KITCHEN = the platform's system (Meta, Shopify, etc. — does the real work behind the scenes)
You never walk into the kitchen. You never touch the stove. You read the menu, tell the waiter what you want, and you get your food. That's exactly how APIs work.
Translating the Analogy to Tech
Here's the same analogy in technical terms — don't worry, they map perfectly:
- "Ordering food" = making an API request (sending specific data to the platform)
- "Getting your plate" = receiving an API response (the platform sends data back)
- "The menu items" = API endpoints (specific things you can ask for — "create campaign", "get ad performance", "update product price")
The Two Main Actions
Just like at a restaurant, there are really only two things you do:
- READ (GET) — Looking at the menu. You're asking for information without changing anything. "Show me my campaign performance." "What products are in stock?" "How many orders came in today?"
- ORDER (POST) — Placing an order. You're asking the system to create or change something. "Create a new campaign." "Update this product's price." "Pause this ad set."
That's it. Every API interaction in the world is either "show me something" (GET) or "do something" (POST). Reading the menu or placing an order. When your AI agent communicates with Meta or Shopify, it's doing one of these two things every single time.
Budget: 500 EGP/day
created successfully
You don't need to learn how APIs work at a code level. Claude Code handles all the technical details. You just need to understand the concept: your agent sends a request, the platform sends a response. Menu and waiter. That's it.
What Is API Documentation?
If the API is a waiter, then documentation is the restaurant's menu — the rulebook that tells you what you can order and how.
Documentation = The Rulebook
Every platform that offers an API also provides documentation (often called "docs"). Documentation is a detailed guide that explains:
- What you CAN request — which endpoints (menu items) are available
- What format to use — how to structure your request (like specifying "medium rare" for your steak)
- What responses to expect — what the platform will send back
- What errors might happen — "we're out of the salmon" (the API equivalent of an error message)
- What permissions you need — some menu items are only for VIP members (restricted API endpoints)
Where to Find Docs
Every major platform has a developers section with their documentation:
- Meta (Facebook/Instagram Ads):
developers.facebook.com - Shopify:
shopify.dev - Google Ads:
developers.google.com/google-ads - TikTok Ads:
business-api.tiktok.com
Do You Need to Read Docs Yourself?
No. And this is a critical point. You don't need to read documentation yourself. Claude Code and the Skills files (covered in Part 5) handle this for you. The Skills already contain the exact API endpoints, parameters, and formats that Claude needs.
But knowing that docs exist helps you understand a powerful feature: the Self-Learning Protocol. Every Skill in this framework includes instructions that tell Claude: "If something doesn't work, go read the latest official documentation and figure out the new way." This means your Skills automatically adapt when platforms update their APIs.
What a Docs Entry Looks Like (Simplified)
Just so you recognize it if you ever see one, here's a simplified version of what an API documentation entry looks like:
Endpoint: POST /v21.0/act_{ad_account_id}/campaigns
Description: Creates a new ad campaign.
Parameters:
name (required) — Campaign name
objective (required) — OUTCOME_SALES, OUTCOME_TRAFFIC, etc.
status (required) — PAUSED or ACTIVE
special_ad_categories (required) — [] or ["HOUSING", "CREDIT"]
Response:
{ "id": "123456789" }
Errors:
100 — Invalid parameter
190 — Access token expired
This is the "menu item" for creating a campaign. Your Claude agent reads this kind of information and knows exactly how to "order" from Meta's API. You never need to deal with this directly.
Understanding that documentation exists is important because it explains why Skills include a Self-Learning Protocol. When Meta changes their API (which happens regularly), Claude can automatically go read the updated docs, find the new format, and adapt — without you lifting a finger.
What Is a Meta Access Token?
Before your AI agent can manage your ads, it needs a special key to prove it has permission. That key is called an access token.
The VIP Wristband Analogy
Imagine you're going to an exclusive club. At the door, they give you a wristband. That wristband proves you have permission to be there — without it, security won't let you in.
A Meta Access Token works the same way. It's a long string of characters (like a password) that your AI agent shows to Meta every time it wants to do something. Without it, Meta says: "Who are you? Access denied." With it, Meta says: "Welcome, you have permission to manage this ad account."
Types of Tokens
Meta has three types of access tokens, each with different "expiration dates" on the wristband:
- Short-lived token (1 hour): Expires in 60 minutes. Useful for quick testing — "let me try one API call to see if this works." Not useful for daily operations.
- Long-lived token (60 days): Lasts about 2 months. This is what most people use day-to-day. You'll need to renew it every 60 days.
- System User Token (never expires): For production systems that run 24/7. More complex to set up but never needs renewal. This is the goal for serious operations.
How to Get Your Token
Here's the step-by-step process. It looks long, but each step takes 30 seconds:
developers.facebook.com in your browser. Log in with the Facebook account that has access to your ad account.developers.facebook.com/tools/explorer. This is Meta's built-in tool for generating tokens.ads_management (to create/edit campaigns) and ads_read (to read performance data). These are the minimum permissions your agent needs.developers.facebook.com/tools/debug/accesstoken. Paste your short-lived token and click "Debug". Then click "Extend Access Token" at the bottom. This converts your 1-hour token to a 60-day token. Copy the extended token — this is the one you'll use.Security: Keep Your Token Secret
Your access token gives full control over your ad account. Anyone with your token can create, modify, or delete campaigns and spend your money. Here's how to keep it safe:
- Never share your token in chat messages, emails, or screenshots
- Never commit it to a public code repository (like GitHub)
- Store it only in a
.envfile on your local computer (we'll set this up in the setup section) - If you think your token was exposed, immediately revoke it and generate a new one
Your access token gives full control over your ad account. Anyone with your token can create, modify, or delete campaigns and spend your money. Treat it like a password. Keep it secret. Keep it safe.
Shopify Access Token & Custom Apps
If you run a Shopify store, your AI agent needs a key to access your store's data — products, orders, inventory. Same concept as Meta, different platform.
Same Concept, Different Platform
Just like Meta has access tokens, Shopify has them too. The difference is how you get them: Shopify uses something called "Custom Apps" to grant API access to your store.
Think of it like giving a new employee specific access rights at your company. You don't give them the master key to everything — you decide exactly what they can see and do. "You can view inventory but you can't change pricing. You can read orders but you can't issue refunds." That's what Shopify's access scopes do.
Access Scopes = Permission Levels
When you create a Custom App, you choose exactly what it's allowed to do. Common scopes for media buying agents include:
read_products— See your product catalog (names, prices, images)write_products— Update product details (prices, descriptions)read_orders— See order data (for revenue reporting)read_inventory— Check stock levels (critical for ad management — don't advertise out-of-stock products)read_analytics— Access store analytics and reports
How to Create a Shopify Custom App
read_products, read_orders, read_inventory, and any others relevant to your use case. Click Save.Shopify only shows your access token once — right after you install the app. Copy it immediately and store it in your .env file. If you navigate away without copying it, you'll need to uninstall the app and create a new one.
What Is Playwright? (The Secret Weapon)
This is the tool that makes your AI agents future-proof. Playwright lets Claude Code control a web browser — and that changes everything.
Browser Automation, Explained
Playwright is a browser automation tool. In simple terms, it lets Claude Code open a web browser, navigate to websites, read pages, click buttons, and extract information — all without you touching anything.
Imagine having an invisible browser running in the background. Claude tells it: "Go to this URL. Read what's on the page. Bring the information back to me." That's Playwright.
Why This Matters for Your Skills
Here's the real power move. Every Skill in this framework includes a "Self-Learning Protocol". This protocol tells Claude: "If something doesn't work, don't just give up. Go read the official documentation using Playwright and figure out the new way."
This means your Skills never go stale. When Meta updates their API (which happens multiple times per year), your Skill doesn't break permanently. Instead:
- Claude tries to execute an API call using the method described in the Skill
- The call fails because Meta changed something
- The Self-Learning Protocol activates
- Claude uses Playwright to open Meta's official documentation website
- Claude reads the updated docs and finds the new correct format
- Claude retries the call with the updated method
- It works
It's like having an employee who, when something doesn't work, automatically goes and reads the updated manual instead of just saying "I don't know, it's broken."
Other Uses for Playwright
Beyond self-learning, Playwright has other powerful uses for media buying:
- Reading competitor ad libraries: Claude can browse Facebook Ad Library and pull competitor creatives
- Checking product pages: Verify that landing page URLs are working before running ads
- Extracting social proof: Read product review counts or ratings from your store
- Monitoring price changes: Check competitor pricing on their websites
Most AI automations break when platforms update their APIs. Teams scramble to fix scripts, hire developers, or abandon the automation. With the Self-Learning Protocol and Playwright, your Skills adapt automatically. This is what makes this framework durable — it doesn't just work today, it keeps working tomorrow.
Full Setup: From Zero to Ready
Everything you need to install and configure, in order. Follow these steps exactly — you only need to do this once. After setup, you'll just open Terminal and type "claude" to start working.
Go to claude.ai and subscribe to Claude Pro ($20/month). You can upgrade to Max later if needed. This subscription gives you access to Claude Code in the terminal.
Mac: Press Cmd + Space, type "Terminal", press Enter.
Windows: Press the Windows key, type "cmd" or "PowerShell", press Enter.
You should see a window with a blinking cursor. That's your workspace for the rest of this setup.
Node.js is a program that Claude Code needs to run. Think of it as the engine that powers the car.
Mac: If you have Homebrew installed, type: brew install node
Mac (no Homebrew): Go to nodejs.org, download the LTS version, and run the installer.
Windows: Go to nodejs.org, download the LTS version, and run the installer. Accept all defaults.
To verify it installed correctly, type this in your terminal:
node --version
You should see a version number like v20.x.x or v22.x.x. If you see a version number, you're good. If you see an error, restart your terminal and try again.
This is the moment. Type this command in your terminal and press Enter:
npm install -g @anthropic-ai/claude-code
npm is Node's package manager — it downloads and installs programs. The -g means "install globally" so you can use Claude Code from any folder. Wait for the installation to finish (it may take a minute).
Create a dedicated folder for your media buying work. Type these two commands:
mkdir my-media-buying
cd my-media-buying
The first command creates a new folder called "my-media-buying". The second command moves you into that folder. This is where all your Skills, configurations, and agent files will live.
The .env file stores your secret tokens and account IDs. Create it with your text editor (or you can ask Claude Code to create it for you once it's running). It should look like this:
META_ACCESS_TOKEN=your_token_here
META_AD_ACCOUNT_ID=act_123456789
META_PIXEL_ID=123456789
META_PAGE_ID=123456789
Replace the placeholder values with your actual tokens and IDs from the Meta setup steps above. If you also use Shopify, add your Shopify credentials too:
SHOPIFY_STORE_URL=your-store.myshopify.com
SHOPIFY_ACCESS_TOKEN=shpat_your_token_here
This file is never shared, never uploaded, never committed to version control. It stays on your computer only.
This gives Claude Code the ability to control a web browser (for the Self-Learning Protocol and web research). Type:
claude mcp add playwright -- npx @anthropic-ai/mcp-playwright
This registers Playwright as a plugin (called an "MCP server") that Claude Code can use whenever it needs to browse the web. You only need to run this once.
This is it. Make sure you're inside your project folder, then type:
claude
You should see a welcome message from Claude Code. It will introduce itself and show you that it's ready to accept commands. Type "hello" to verify it's working. If Claude responds, you're ready.
From now on, to start a work session, you'll always just:
- Open Terminal
- Navigate to your project folder:
cd my-media-buying - Type:
claude
That's your entire workflow to start working with AI agents. Three steps.
Setup is done! You only do this once. From now on, you just open Terminal, navigate to your project folder, and type claude. Everything from Parts 5-7 builds on this foundation. In the next part, we'll learn about Skills and SOPs — the recipes that tell your AI agents exactly how to work.