Claude Code Setup &
Your First SEO Script
Claude Code is a command-line tool that lets Claude write, run, edit, and debug code autonomously on your own machine. It's fundamentally different from asking Claude for code snippets in the chat interface — it can read your files, execute scripts, install libraries, and iterate until the job is done. This tutorial gets you set up from scratch and walks you through building a real, useful SEO tool: a URL status code checker.
- Understand what Claude Code is and how it differs from Claude chat
- Install and authenticate Claude Code on your machine
- Understand how to start and navigate a Claude Code session
- Build a working HTTP status code checker from a CSV of URLs
- Learn how to guide, correct, and iterate with Claude Code
- Know where your scripts live and how to re-run them later
1Claude Code vs Claude Chat — What's the Difference?
Before installing anything, it's worth understanding what makes Claude Code distinct. Both use the same underlying AI, but they operate in very different ways.
- Runs in your browser
- Generates code as text you copy
- Cannot access your files or computer
- You run the code yourself
- Best for: writing prompts, analysis, content
- Runs in your terminal / command line
- Writes AND executes code directly
- Can read, write, and create files
- Installs libraries, runs scripts, fixes errors
- Best for: building tools, automating tasks
New to the command line? The terminal is a text-based way of controlling your computer. On Mac it's called "Terminal" (find it in Applications → Utilities). On Windows, use "Command Prompt" or "PowerShell". Don't worry — Claude Code does most of the heavy lifting; you mainly just type commands Claude tells you to.
2Installation
Claude Code requires Node.js to be installed on your machine. Follow the steps for your operating system below.
Step 1 — Install Node.js (if you don't have it)
Open your terminal and check if Node.js is already installed:
Step 2 — Install Claude Code
Step 3 — Authenticate with your Anthropic account
Claude for Teams users: Log in with the same account credentials you use for claude.ai. Your Teams subscription covers Claude Code usage. If you're asked about an API key, you can generate one from your Anthropic account dashboard at console.anthropic.com.
3How Claude Code Works — The Basics
When you open Claude Code, you're in a conversation — just like claude.ai — but Claude also has access to your file system within the folder you opened it from. This is important: always navigate to your project folder before starting Claude Code.
Starting a session in the right folder
Key Claude Code commands
| Command | What it does |
|---|---|
/help | Show available commands |
/clear | Clear conversation history and start fresh |
/exit | Exit Claude Code back to your regular terminal |
/model | Check or change the model being used |
| Ctrl + C | Stop a running task mid-way |
Permissions: Claude Code will ask your permission before running commands or writing files — you'll see a confirmation prompt. Always read what it's about to do before pressing Enter to approve. You can always say "no, do it differently" if you're not comfortable.
What an agentic session looks like
Unlike Claude chat where you get one response, Claude Code works in loops. You give it a goal, it plans steps, executes them one at a time, checks the output, and keeps going until done — or until it hits a problem and asks you for input. Here's a simplified view of what happens under the hood:
You describe the goal
"Build a script that checks HTTP status codes for a list of URLs in a CSV file."
Claude plans the approach
It outlines what it will build, what libraries it'll use, and asks any clarifying questions.
Claude writes the code
It creates the file(s) on your machine, writing each function or section.
Claude runs the code
It executes the script against your data and reviews the output.
Claude fixes errors automatically
If something breaks, it reads the error, adjusts the code, and tries again — often without you needing to do anything.
You review the result
Claude shows you the output and explains what it built. You can ask for changes or additions.
4Project Setup — Organising Your SEO Tools
Before building anything, let's set up a clean folder structure. This keeps your scripts organised and makes it easy to find and re-run them later.
Now prepare your input data. For this tutorial's script, create a file called urls.csv in the data/ folder with a list of URLs to check — one per row, with a header. You can export this from Screaming Frog, Google Search Console, or create it manually.
5Building the Script — Step by Step
Now for the main event. Navigate to your seo-tools folder and open Claude Code. We'll build the HTTP status checker together, showing you exactly what to say and what to expect.
Your opening prompt
The quality of your first message shapes everything that follows. Give Claude Code a clear brief — just like you learned in Tutorial 1, but focused on what you want built:
What Claude Code will do
Claude Code will now work through this autonomously. Here's roughly what you'll see in your terminal:
The script Claude Code builds
For reference, here's the kind of script Claude Code will produce. You don't need to type this — Claude writes it for you. But reading it helps you understand what was built:
6Iterating — Improving the Script in the Same Session
Once the script is working, you can ask Claude Code to improve it without starting over. The conversation context means it already knows everything about what was just built. Here are useful follow-up requests:
Good iterating habit: Ask for one improvement at a time. Claude Code can handle multiple requests at once, but smaller, focused changes are easier to review and less likely to accidentally break something that was already working.
7When Things Go Wrong
Claude Code will sometimes produce code with errors, or the script might behave unexpectedly. This is normal — here's how to handle it.
| Situation | What to say to Claude Code |
|---|---|
| Script crashes with an error message | "I got this error when running the script: [paste error]. Please fix it." |
| Output is wrong or unexpected | "The script ran but the output doesn't look right. I expected [X] but got [Y]. Can you investigate?" |
| Script is too slow | "This is running too slowly on 500 URLs. Can you add concurrent requests to speed it up?" |
| Missing library error | "I got a ModuleNotFoundError for [library]. Please install it and update the script." |
| You want to start again | Type /clear to reset the conversation, then re-brief Claude Code from scratch. |
Always check the output: Claude Code is very capable but not infallible. After any script runs, open the output CSV in a spreadsheet and scan a sample of results to make sure they look correct before relying on them for client work.
8Re-running Your Script Later
Once Claude Code has built a script, you don't need Claude to run it again. You can run it directly from your terminal at any time:
This is the real payoff of building tools with Claude Code: you build once, use forever. The next time you need to check URLs for a client, it takes 30 seconds — not 30 minutes.
9Practice Exercises
Get set up before the next step:
- Install Node.js if needed (run
node --versionto check) - Run
npm install -g @anthropic-ai/claude-code - Run
claudeand complete the login flow - Type
/helpand read the available commands - Type
/exitto close Claude Code
Build the script from this tutorial with your own data:
- Create the
~/seo-tools/data/folder structure - Create a
urls.csvwith 10–20 real URLs from a client site - Open Claude Code from the
seo-toolsfolder - Use the opening prompt from Section 5 (adapting as needed)
- Let Claude Code build and run the script
- Open
output/status_report.csvin Excel/Sheets and review the results
Practice iterating within the same session:
- After the script is working, ask Claude Code to add response time (in milliseconds) as a new column in the output
- Then ask it to add a second output file: a summary CSV that shows just the count of each status code group
- Re-run the script and confirm both output files are correct
10Summary
Key takeaway: You don't need to understand Python deeply to build useful SEO tools with Claude Code. Your job is to describe clearly what you want, review what Claude builds, and test the output. Claude handles the syntax — you bring the SEO knowledge.