How to Use Claude Code: Beginners Guide (2026)

/ Learn Claude Code faster with real workflows.

Published: July 11, 2026 at 2:00 PM EDT | Updated: July 14, 2026 at 11:38 AM EDT
How to use claude code
Image: Alison Parker / TheTweaks

Quick Answer: To use Claude Code, start a terminal inside your project folder and enter Claude. Then, simply enter plain English instructions such as “Explain this project” or “Fix this bug” and Claude Code scans the project files, writes or edits code and asks you for confirmation before implementing changes. It works with Python, JavaScript and almost all other major programming languages, with support for images too, running on either Sonnet, Opus or Haiku models, depending on your subscription plan.

Testing note: We’ve been using Claude Code in practice for two weeks in July 2026 in several projects, a Python script, a React component refactoring and a documentation generation task to write this guide. Every single command and example in this guide comes from real use of Claude Code.

Key Takeaways

  • Claude Code is not a chatbot, it reads, edits and executes code in your project and asks for your consent at each step
  • Among all the commands, the three that will help you the most at the beginning are /model, /clear and /doctor
  • Yes, Claude Code writes Python code and also can write JavaScript and most of the other mainstream programming languages
  • Claude Code uses Sonnet by default in most sessions, Opus becomes available for solving hard tasks via /model opus
  • It has no dedicated web interface like Claude.ai, it works in your terminal, VS Code or Cursor

 

If you’ve just installed Claude Code and stared into a blank terminal without having any clue what to enter, don’t feel alone. Installation tutorials go into much detail while being quite vague at the end. In this guide, we’ll continue where installation ends and teach you how to really use Claude Code.

What Is Claude Code

Claude Code is a terminal based Anthropic coding assistant. Unlike Claude chat interface, it doesn’t only discuss the code, it reads your project files, writes code, modifies existing files and runs shell commands upon your instructions.

The main difference from a typical chatbot here is that Claude Code has direct access to your codebase. There’s no need to copy and paste the code. You tell Claude Code what to do and it does that inside your project files. Think of Claude Code as an assistant that sits inside your terminal, not the one you can see in your browser tab and have to toggle.

How Claude Code Works

When you start Claude Code in a project folder, it scans the project structure and the relevant files and builds the context about what you’re working on. From that point onward, all of your prompts are processed by the same algorithm:

  • Claude Code reads the relevant files
  • It develops the plan
  • It shows you what it intends to do
  • It awaits your confirmation
  • Only then it performs file edits or executes commands

 

This consent step is built into Claude Code on purpose. The assistant doesn’t silently make changes in your files and holds a big context window to be able to track the context for multiple files in the same session.

Creating Your First Project

Let’s create the first folder with the Claude Code project inside:

Bash

mkdir demo-project
cd demo-project
claude

At the very first launch, Claude Code will ask you whether you trust this folder, saying “Yes, I trust this folder”. After that, you will be in the active session, ready to enter your first prompt.

Understanding the Claude Code Interface

When you’re inside the active session, several things are worth knowing before entering your first prompt:

  • Prompt area – the line you can enter instructions or questions in
  • File permission prompts – appear before each file creation or modification and show you exactly what Claude Code intends to do
  • Slash commands – entered with a leading /, they’re not related to your code (will be covered later)
  • Model indicator – shows you which model (Sonnet, Opus, Haiku) is used currently
  • Status line – shows you the context usage and the current session state

 

Our experience showed that the file permission prompts were the source of confusion for beginners the most. They might seem to be an error at first glance, but that’s actually the safety mechanism at work. Read the prompt before confirming the change.

First Prompts: Real Examples

You don’t have to use any special syntax, just enter your instructions in plain English:

  • “Explain this project”
  • “Fix the bug in app.py”
  • “Create a README for this repo”
  • “Generate unit tests for this function”
  • “Refactor this function for better readability”

 

From our experience, the vaguer your prompt, the more Claude Code asks clarification questions before making any actions. It’s actually a good thing, not a bug. More detailed prompts yield faster and clearer results.

Basic Claude Code Commands

Slash commands control the session itself, not your coding prompts.

Command Purpose
/help Shows available commands
/model Change the active model to Sonnet, Opus or Haiku
/clear Clears the conversation history and starts a new session
/compact Compact long history to preserve the context window
/doctor Diagnoses the installation and the setup errors
/memory Edits CLAUDE.md, your project’s persistent notes
/init Auto generates a CLAUDE.md briefing for the project 

We used /clear constantly during testing. Starting each task with a clean slate yielded clearly more focused answers than carrying the old context through the sessions.

Coding With Claude Code

Can Claude Code Write Python Code?

Yes, Claude Code writes Python code easily, alongside with JavaScript, HTML, CSS, React and even Node.js. For example, let’s ask Claude Code to write a Python script that reads a CSV file and calculates an average value of a numeric column:

“Write a Python script that reads a CSV file and calculates an average of a numeric column in it”

Claude Code has generated a working script in less than 20 seconds using pandas by default:

Python

import pandas as pd
df = pd.read_csv(“data.csv”)
average = df[“numeric_column”].mean()
print(f”Average: {average}“)

This code has worked fine in our test case. For more complicated scripts, expect to receive one or two followup prompts to specify the column name or some edge cases.

Editing the Existing Code

Claude Code is equally good at modifying the existing files as writing code from scratch. Just point Claude Code to the file and ask it to do the necessary modifications:

  • “Refactor this function to remove duplicate code”
  • “Add error handling to this API call”
  • “Optimize this loop for large datasets”
  • “Add comments to this code”

 

During testing, we’ve asked Claude Code to fix a state bug in a React form component. It has recognized a stale closure problem and explained the solution in plain English before performing any action. The problem that would require several minutes of a human reviewer’s time in normal circumstances.

Code Explanation

One of the features of Claude Code that often goes unnoticed is that you can drop it into an unfamiliar codebase and ask to explain how it works. The prompt like “Explain how authentication works in this project” leads Claude Code to walk through the relevant files and explain the logic in plain English. This is a highly useful feature when onboarding to an unfamiliar project, not just a coding shortcut. From our experience, it saves lots of time.

Running Shell Commands

Claude Code can execute shell commands directly if needed. Install a package, run a test suite or perform any checks. Claude Code always shows you exactly what it intends to do and asks for confirmation just like with the file modifications. This is essential from the safety perspective, as you’re never faced with unexpected command execution and you can reject everything that seems suspicious.

Using Claude Code With Git Projects

Claude Code scans the Git status automatically inside a repository. You can ask it to:

  • Summarize the recent changes
  • Write a commit message based on the diff
  • Draft a pull request description
  • Review changes before committing

 

This is one of the most useful daily features. Instead of writing commit messages yourself, you just enter a prompt like “Write a commit message for these changes” and get something clear and detailed based on the actual diff. Working with Git provides a safety net for you. In case the changes didn’t turn out as expected, you can always revert them which is why we strongly recommend using Claude Code only in the version controlled folders.

Using Claude Code With Images 

Does Claude Code Take Pictures? 

Claude Code accepts image input, you can reference a screenshot, UI mockup or diagram in your prompt and Claude will analyze it. Good use cases include things like: 

  • Debugging a UI from a screenshot 
  • Converting a wireframe to starter code 
  • Describing a diagram or architecture chart 

 

Practical limitation: Image capability works best for analysis and reference, not for precise visual output. If you require precise visual output, you should be ready for post generation adjustments because Claude Code is primarily a coding tool, not a design tool.

Does Claude Code Have a Web Interface

No, Claude Code does not have its own separate web application in contrast to Claude.ai. It is CLI-based (runs in the terminal) and can also be used as an extension in VS Code and Cursor. To get a web based Claude experience, you can use Claude.ai’s chat interface which is a different product from Claude Code. 

Which Claude Model Does Claude Code Use 

Claude Code provides model options and which model is currently active depends on your plan and your choice with /model

Model Best For

Sonnet

Everyday coding —  option for most sessions
Opus

Complex reasoning, architecture choices and difficult bugs

Haiku

Fast, simple and cheap tasks

In our tests, Sonnet managed to handle the majority of tasks we gave to Claude Code without changing models. Only once we used Opus in a multi file refactor when logic tracing was required across multiple files. 

How to Check Claude Code Usage 

To check the current token consumption and limits according to your plan type /usage inside the session. It is now the primary usage statistics view while other commands like /cost and /stats appear as tabs within it rather than separate views. Checking this view is worthwhile because usage limits are reset on a rolling window and some sessions may consume a lot of tokens faster than you think. 

Best Claude Code Workflows 

Based on our tests, Claude Code works best at: 

  • Creating websites and prototypes from descriptions 
  • Debugging errors with stack trace provided 
  • Refactoring messy or legacy code 
  • Writing documentation and README files 
  • Generating unit tests for existing functions 
  • Quickly explaining unfamiliar codebases 

Best Practices 

  • Always work in a Git repository where every change is reversible
  • Always review generated code prior to accepting it, especially when changes apply to production 
  • Be specific in prompts rather than general 
  • Split large tasks into smaller prompts rather than using one single prompt 
  • Always run /init at the beginning to provide persistent project context to Claude 
  • Run /clear between unrelated tasks so that previous context does not interfere with new task 
  • Do not put any credentials or API keys in prompts 

Common Mistakes Made By Beginners

  • Formulating a huge prompt instead of splitting the work into steps 
  • Skipping approval prompts without reviewing proposed changes 
  • Failing to clear context between unrelated tasks 
  • Using Claude Code outside Git repo where no rollback is possible 
  • Mistaking it for chatbot that cannot interact with files
  • Failing to check /usage and getting surprised during the session 

Tips For Getting Started

If you are new to Claude Code, don’t expect to figure out all of its commands on the very first day. There are several things that would help you become productive right away:

  • Go easy. Use Claude Code for something simple for starters, fix a typo and create a script before relying on Claude Code for anything important.
  • Pay attention to the first permissions prompt. It will explain everything about Claude Code and how it operates before you decide to use it.
  • Run /init for your first actual project. It creates a CLAUDE.md file that will make every following session quicker and more accurate.
  • Don’t have long sessions right away. Shorter sessions are more understandable and you’ll be able to get an understanding of how Claude Code thinks before handling big multi file tasks.
  • Use Git right from the start. Even just running git init before your first session will provide you with the necessary insurance.

 

The main thing that made a difference between a successful first week of experience and a frustrating one is whether you started with small and low risk prompts or tried to perform a big refactor right away.

Final Verdict:

Claude Code deserves its place for coding purposes such as debugging, refactoring, documentation writing and generating Python or JavaScript code, all these tasks worked well in our test. It is not a replacement for developers’ judgement and cannot be used for design work but for coding tasks, it is one of the most useful terminal based AI tools in 2026.

If you’re ready to know more about claude code, you can continue with our advanced Claude Code resources. Learn how Claude Code Router lets you work with multiple AI models, compare Claude Code vs Cursor for IDE-based development and Claude Code vs Codex for different programming tasks. 

Using VS Code instead? See our full Claude Code in VS Code guide.

Frequently Asked Questions

Claude Code requires approval before editing files or running commands and works best inside a Git repository so every change can be reviewed or reversed if needed.
Type /model inside an active session to see available models and switch between Sonnet, Opus or Haiku, depending on which models your current plan includes.
Yes, Claude Code can create new files but it always asks for your permission first, showing exactly what it plans to create before writing anything to disk.
Most Related