Skip to content
Helped by a Nerd

AI Tools

Claude Code Tutorial: Build Your First Project Step by Step

Published on Reading time: 9 min

  • #claude-code
Contents

Most Claude Code tutorials stop at “run the install command and say hello.” That gets you a working terminal and not much else. The harder part — the part nobody walks you through end to end — is taking a real project from an empty folder to a working feature, then fixing it when the first attempt is wrong.

This tutorial does that. By the end you’ll have set up a project, shipped a small but real feature, and learned the loop you’ll use for everything else: describe, review, run, correct. No prior agentic-coding experience assumed. You just need a terminal, a code editor, and about an hour.

What you’ll be able to do by the end

By the end of this tutorial you’ll be able to start a Claude Code session in any project, ask it to build a feature in plain English, review its plan before it touches your files, and iterate on the result until it works.

That’s the whole skill. Everything else — bigger projects, multiple files, test suites — is the same loop repeated at larger scale. Specifically, you’ll learn how to:

  • Point Claude Code at a project so it understands your codebase
  • Write a feature request that gets a good first draft instead of a vague mess
  • Read and approve a plan before any code is written
  • Run the result and feed errors back so Claude fixes its own mistakes
  • Leave behind a CLAUDE.md file so the next session already knows the rules

If you haven’t installed it yet, follow the install Claude Code walkthrough first, then come back here. If you’re still deciding whether this tool is for you at all, what is Claude Code covers the why before the how.


Setting up your project

Claude Code works inside a folder, so the first step is to open a terminal in your project directory and start a session there — it reads the files around it to understand what you’re building.

Create a folder for a small project and move into it. For this tutorial, imagine a tiny command-line tool: a script that takes a list of tasks and prints them sorted by priority. Nothing fancy — the point is the workflow, not the code.

mkdir task-sorter
cd task-sorter
claude

When the session opens, don’t ask for a feature yet. Start with orientation:

What's in this directory, and what would you suggest as a starting structure
for a small Python command-line task sorter?

On an empty folder Claude will tell you there’s nothing yet and propose a layout. On an existing project, this same opening question makes it read your files and summarise the architecture back to you. That summary is your signal that it actually understands the codebase before it changes anything.

Two setup habits pay off immediately. First, keep your project under version control (git init) so every change Claude makes is a diff you can inspect or undo. Second, create a CLAUDE.md file in the project root. This is a plain-text memory file Claude reads automatically at the start of each session — put your stack, conventions, and “always do / never do” rules in it. A few lines is enough to start:

# Project: task-sorter
- Language: Python 3, standard library only (no external packages)
- Style: small functions, clear names, no clever one-liners
- Always show me the plan before editing files

That last line matters more than it looks. It nudges Claude toward Plan Mode behaviour by default, which is exactly what a beginner wants.


Building your first feature

To build a feature, describe what you want in plain English, ask Claude to plan before coding, and let it write the files only after you’ve approved the approach.

Here’s a request that works, written the way you’d brief a junior developer:

Build a CLI script called sorter.py. It reads tasks from a tasks.txt file
where each line is "priority|task name" (priority is high, medium, or low).
Print the tasks grouped by priority, high first. If tasks.txt is missing,
print a friendly message instead of crashing. Plan it first, then implement.

Notice what makes this a good prompt: it names the file, defines the input format, states the expected output, and — crucially — calls out the edge case (missing file). Vague prompts like “make a task sorter” get vague code. Specific prompts get code you can actually run. This is the single biggest lever a beginner has, and it’s why a short brief written carefully beats a long one written lazily.

Claude will respond with a plan: which file it’ll create, what functions it’ll write, how it’ll handle the missing-file case. Read the plan before approving it. This is your checkpoint. If the plan misunderstands something — say it wants to add a third-party library when your CLAUDE.md said standard-library only — you correct it now, in one sentence, before a single line is written. Catching a wrong assumption at the plan stage costs you a reply; catching it after the code is written costs you a debugging session.

Once you approve, Claude writes sorter.py and shows you the diff. Skim it. You don’t need to understand every line yet, but look for the obvious: does it read the file you named, does it handle the missing-file case you asked for. If the work spans several files or steps, you can let it run them as a sequence — that pattern is the heart of Claude Code workflows, where one request fans out into a planned, multi-step change.

This describe-review-approve rhythm is the core of what people call vibe coding: you stay in plain language and let the model handle syntax. It’s powerful, but it isn’t magic — see vibe coding risks for the failure modes (silent bugs, over-trust, code you can’t maintain) so you know what to watch for as your projects grow.


Debugging and iterating

When something goes wrong, you don’t fix it by hand — you paste the error back to Claude and let it diagnose and patch its own code, then you run it again.

This is the loop that makes Claude Code feel different from copy-pasting from a chatbot. Run your new script:

echo "high|Ship the tutorial" > tasks.txt
echo "low|Water the plants" >> tasks.txt
echo "medium|Reply to emails" >> tasks.txt
python sorter.py

Say it crashes, or the medium tasks print before the high ones. Don’t open the file and start poking. Just tell Claude what happened:

I ran it and the medium tasks printed before the high ones. Here's the output:
[paste the actual terminal output]

Real terminal output — the actual error text, not your paraphrase of it — is the most useful thing you can give Claude. It reads the traceback, finds the wrong sort key or the missing case, explains what went wrong, and proposes a fix. You approve, it patches, you run again. Three or four turns of this and most beginner-level bugs are gone.

A few habits make the loop tighter:

  • Run after every meaningful change. Don’t stack three features then debug a pile of unknowns. Small steps mean small, findable bugs.
  • Feed it the real error, every time. “It’s broken” makes Claude guess. The traceback makes it diagnose.
  • Use git as your safety net. If an iteration makes things worse, git checkout . rolls back, and you try a different instruction. You can’t paint yourself into a corner.
  • Ask it to explain, not just fix. “Why did that happen?” turns each bug into a lesson and slowly teaches you the codebase you’re building.

When a project grows past a single file, you can hand distinct parts of the work to focused helpers instead of one giant request — that’s what Claude Code subagents are for. And if you find yourself repeating the same setup or cleanup steps, Claude Code hooks let you automate them so they run on their own.


Beginner tips that save you hours

The fastest way to get good results early is to keep requests small, keep a good CLAUDE.md, and always review the diff before you approve it.

A handful of habits separate a smooth first week from a frustrating one:

  • Treat CLAUDE.md as a living file. Every time you correct Claude on the same thing twice, write the rule down so you never correct it a third time. Your project’s memory file is the highest-leverage text you’ll edit.
  • Reset context when you switch tasks. Long sessions accumulate stale context. Starting a fresh session for a genuinely new task often gives sharper results than continuing a sprawling one.
  • Stay in plan mode for anything risky. For changes that touch many files or anything you’re unsure about, insist on a plan first. The approval step is cheap insurance.
  • Don’t paste secrets into prompts. Keep API keys and passwords in environment variables or ignored files, never in the conversation. This matters even more once you connect external tools.
  • Let it write tests. Asking Claude to add a couple of tests for your feature gives you a way to catch regressions automatically as the project grows — and tests are the cheapest debugging tool there is.
  • You don’t have to be a programmer to start. If this still feels intimidating, Claude Code for non-coders reframes the whole thing around describing outcomes rather than writing code.

When you’re ready to go beyond a single project folder, Claude Code can connect to external tools and data through MCP. Start with Claude Code MCP to learn how the connection works, and treat MCP security as required reading before you wire anything to a live system — connecting an agent to real tools is exactly where caution pays off.


FAQ

Is Claude Code free to use?

Claude Code is a paid tool and access is tied to a Claude plan or API usage. Anthropic changes plans and pricing periodically, so rather than quote a number that may be stale, check the current details on the official Claude Code documentation. There’s no perpetual free tier, but the entry options are designed to let you try real work before committing.

Do I need to know how to code to use Claude Code?

No, you don’t need to be a programmer to get started, though it helps to be comfortable in a terminal. You can describe what you want in plain English and review the results. That said, understanding the basics — running commands, reading an error message — makes the debug-and-iterate loop far smoother, and you’ll pick those up quickly by working through a project like this one.

What’s the difference between Claude Code and Cursor or GitHub Copilot?

Claude Code is terminal-native and agentic: it plans and executes multi-step changes across your whole project. Cursor is an AI-first code editor, and Copilot started as an inline autocomplete inside your existing editor. They overlap but feel different in practice. For a side-by-side breakdown, see Claude Code vs Cursor and Claude Code vs GitHub Copilot.

How do I give Claude Code project-specific instructions?

You put them in a CLAUDE.md file in your project root. Claude reads it automatically at the start of every session, so your stack, conventions, and “always/never” rules carry over without repeating yourself. Keep it short and concrete — a dozen clear lines beats a wall of vague guidance.

What should I build first to learn Claude Code?

Build something small and runnable, like the task sorter in this tutorial, rather than an ambitious app. The goal of your first project is to learn the loop — describe, review, run, correct — not to ship something impressive. Once the loop feels natural, scale up: bigger features, more files, and eventually the wider best AI coding tools ecosystem will make more sense.


Conclusion

The whole tutorial comes down to one loop you’ll repeat forever: describe what you want, review the plan, run the result, and feed errors back until it works. Set up a project, write a specific request, approve the plan, and iterate — that’s the entire job, whether you’re sorting three tasks or building something far bigger.

The beginners who get the most out of Claude Code aren’t the ones who write the longest prompts. They’re the ones who keep requests small, maintain a tight CLAUDE.md, and always read the diff before approving. Start with the task sorter, get comfortable with the rhythm, and let your projects grow from there. When you’re ready for more, the Claude Code guide goes deeper on everything we touched here.

More on this topic

Newsletter

Never miss an AI update

New tools, guides and deals – once a week, straight to your inbox.

100% free, cancel anytime.