Claude Code from Zero: Run Your early AI-Written Program in 10 Minutes
This tutorial walks through using Claude Code with CodeGateway as the access layer. Claude Code is Anthropic's command-line coding assistant — you point it at CodeGateway, which forwards your requests to Anthropic's Claude models.
TL;DR: Who this is for: people who have rarely written code, or only briefly touched it. By the end, you'll know what Claude Code is, what it can do, how to install it, and how to make it write your early program. Every step has a screenshot placeholder. Every jargon term has a plain-English translation.
Table of Contents
- What is Claude Code, in plain language
- What you need before you start
- Step 1: Install Node.js (≈ 3 min)
- Step 2: Install Claude Code (≈ 1 min)
- Step 3: Sign up for CodeGateway and get your key (≈ 2 min)
- Step 4: Hand the key to Claude Code (≈ 2 min)
- Step 5: Run your early command (≈ 2 min)
- Common questions and how to handle them
- What to learn next
What is Claude Code, in plain language
Imagine cooking a meal in your kitchen:
- Normally, you read a recipe, prep the ingredients, chop, sauté, plate. Every step is yours.
- Claude Code is like having a chef who can cook sitting in the kitchen with you. You say "make me tomato and eggs," and they go find the recipe, chop, sauté, plate it for you.
Translate that back to programming:
- "Kitchen" = a folder on your computer.
- "Meal" = the program, web page, or script you want to make.
- "Claude Code" = an AI assistant that can write code, run commands, and modify files for you.
It is not the chat-only ChatGPT-style tool. It actually does things on your computer. So you need to give it two things:
- An environment to work in (your computer + a few basic pieces of software).
- A communication key (an API key — that's what lets the AI talk to its model).
The five steps below set up both.
What you need before you start
Item | Requirement | Most people already have |
|---|---|---|
A computer | macOS / Windows / Linux | ✓ |
Internet | Working connection | ✓ |
An email | For account signup | ✓ |
Patience | 10–15 minutes | ✓ |
You do not need: programming experience, a credit card. CodeGateway accepts email signup.
Special note for Windows users: the commands here work natively on macOS / Linux / WSL2. Windows cmd / PowerShell can run most of them, but WSL2 is strongly recommended (a free tool that lets Windows run Linux). Commands below assume Linux/macOS shell style.
Step 1: Install Node.js (≈ 3 min)
What is Node.js? A piece of software that lets your computer run JavaScript code. Claude Code is written in JavaScript, so we need it.
macOS
Open "Terminal" (Applications → Utilities → Terminal, or Spotlight-search "terminal"). Paste:
# Install Homebrew if you don't already have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Node.js
brew install nodeScreenshot placeholder: terminal running brew install node.
Windows (WSL2 / Ubuntu)
Open the "Ubuntu" app:
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejsLinux
# Ubuntu / Debian
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejsVerify it worked
node --versionYou should see something like v20.x.x. Anything starting with 18 or higher is fine.
Trouble? Skip ahead to Common questions.
Step 2: Install Claude Code (≈ 1 min)
Still in the terminal:
npm install -g @anthropic-ai/claude-codeWhat's npm? A "software manager" that comes bundled with Node.js. install -g means "install this software globally."
Verify:
claude --versionScreenshot placeholder: terminal showing claude --version output.
A version number means you're set. command not found: claude? See Common questions.
Step 3: Sign up for CodeGateway and get your key (≈ 2 min)
For Claude Code to do anything, it needs to talk to an AI model. Talking requires a "key" — an API key. We'll get one from CodeGateway, for two reasons:
- Email signup, no credit card required.
- New accounts get a $2 starter credit — more than enough to follow this whole tutorial.
Steps
- Open https://www.codegateway.dev.
- Click "Sign up" (top right), enter email + password.
- Check your email, click the verification link to activate.
- Log in, navigate to "Dashboard."
- Find "API Keys," click "Create Key."
- Give it a name (e.g.
my-early-key), confirm. - A string starting with
sk-cg-appears — that's your key.
Screenshot placeholder: API Key creation completed, key visible on screen.
Important:
- The key is shown only once. Copy it immediately into something safe — a password manager, a secure note.
- Do not share it. Don't upload it to a public repo or cloud drive. If it leaks, go back to the CodeGateway Dashboard, delete the old key, generate a new one. Done in seconds.
Step 4: Hand the key to Claude Code (≈ 2 min)
Claude Code reads the key from two environment variables named ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY.
What's an environment variable? Think of it as a sticky note posted at the entrance of your terminal. Every program your terminal launches checks the sticky note on the way in.
macOS / Linux
In the terminal:
echo 'export ANTHROPIC_BASE_URL="https://api.codegateway.dev"' >> ~/.zshrc
echo 'export ANTHROPIC_API_KEY="sk-cg-paste-the-key-you-copied-here"' >> ~/.zshrc
source ~/.zshrcIf your shell is bash (older macOS defaults to bash), replace ~/.zshrc with ~/.bashrc.
Screenshot placeholder: pasting the three commands.
Windows WSL
Same as Linux.
Verify the key is wired up
echo $ANTHROPIC_API_KEYIt should echo your key. If you get a blank line, one of the lines didn't paste cleanly — re-run the three commands.
Step 5: Run your early command (≈ 2 min)
Make an empty folder
mkdir hello-claude
cd hello-claudemkdir = make directory. cd = change directory (move into the folder).
Launch Claude Code
claudeYou'll enter an interactive prompt (like ChatGPT, but in your terminal).
Screenshot placeholder: Claude Code welcome screen.
Send your early instruction
Paste this and hit enter:
Create a Python file called hello.py in the current folder
that prints "Hello, Claude Code!", then tell me how to run it.Claude Code will:
- Write
hello.pyfor you. - Tell you to run
python hello.py. - Probably also explain that you need Python installed and walk you through that.
Screenshot placeholder: Claude Code creating the file and explaining how to run it.
Run it
Exit Claude Code (press Ctrl+C twice, or type /exit), then:
python3 hello.pyThe terminal prints Hello, Claude Code! — congratulations, your early AI-written program just ran.
No Python installed? macOS usually haspython3already; otherwiseapt install python3on Linux/WSL orbrew install pythonon macOS.
Common questions and how to handle them
`node --version` shows `command not found`. Node.js didn't install. Re-run the Step 1 commands. If brew throws errors, restart the terminal or add brew to PATH (follow the instructions in the brew installer output).
`npm install -g` shows a permission error. On macOS / Linux, prefix with sudo: sudo npm install -g @anthropic-ai/claude-code. Same on Windows WSL.
`claude --version` says `command not found`.
- Close the terminal and open a fresh one (so PATH gets re-read).
- Check that
npm config get prefixis in your PATH. - If still stuck:
npm uninstall -g @anthropic-ai/claude-code && npm install -g @anthropic-ai/claude-code.
Claude Code launches but throws 401 / Unauthorized. The key isn't being read. Check:
echo $ANTHROPIC_API_KEYreturns anything?- Did you accidentally include extra spaces or miss characters when pasting?
- Did you forget the
exportkeyword? - After editing the rc file, did you
source ~/.zshrc(or.bashrc)?
Claude Code launches and just spins forever. Likely a network issue. Try:
- Opening https://www.codegateway.dev in a browser.
- Switching to a phone hotspot.
- If still stuck, see the connection timeout troubleshooting guide.
Lost your key / accidentally posted it somewhere. Dashboard → API Keys → find that key → Delete → Create a new one. Takes one second.
Used up the $2 credit.
- Want to keep going: Dashboard → Top-up. $5–10 lasts a while.
- Don't want to pay: every new email gets the $2 credit, but do not abuse this with throwaway emails to harvest credit — it violates terms and bans the account.
Can I do all of this through a website instead of the terminal? Claude Code is a command-line tool — terminal only. If you don't want to touch the terminal at all, Anthropic's Claude.ai is a different product (also great, just not what this guide covers).
Followed all the steps but realized I'm not actually interested. That's fine. You've learned three things that come up in many other contexts: using a terminal, installing a global tool, and reading environment variables. Claude Code won't bill you while idle — no command, no charge.
What to learn next
Running your early program is the start. Pick by interest:
- See what Claude Code can really do → the complete Claude Code configuration guide.
- Hit connection issues often → the connection timeout troubleshooting guide.
- Want to use it like a senior team would → advanced techniques and strong practices.
- Curious about pricing → top-up guide + tier markup explainer.
- Want to compare alternatives → Claude Code vs Cursor vs GitHub Copilot.
If anything in this tutorial breaks for you, drop a note on the feedback page and we'll keep iterating.
The barrier is lower than it looks. Hold onto your key, come back in a few days, try a couple of small projects (have Claude Code write a simple webpage, write a scraper script), and the muscle memory builds itself.