Home / AI / Claude AI / How to Use Claude Code: A Complete Beginner’s Guide

How to Use Claude Code: A Complete Beginner’s Guide

You’ve installed Claude Code — now what? This guide walks you through the key things you can actually do with it, from simple one-liners to more complex multi-file tasks. By the end you’ll have a clear picture of how to make it a useful part of your workflow.

The Two Ways to Use Claude Code

Claude Code works in two modes:

  • Single command mode — pass a task directly on the command line and get a result
  • Interactive mode — launch an ongoing conversation where you give instructions back and forth

Single command:

claude "what does the function on line 45 of app.py do?"

Interactive mode:

claude

Then type your instructions at the prompt. Use /exit or press Ctrl+C to quit.

Reading and Understanding Code

Start with tasks that don’t change anything — useful for getting familiar with Claude Code safely.

claude "explain what this project does and how it's structured"
claude "find all the places where user input is used without validation"
claude "what does the authentication flow do in this codebase?"

Claude Code reads the relevant files automatically. You don’t need to paste code — it finds it.

Writing and Editing Code

This is where Claude Code saves the most time.

claude "add error handling to all the database calls in db.py"
claude "write a function that validates email addresses and add it to utils.py"
claude "refactor the get_user function to use async/await"

Before making changes, Claude Code shows you what it plans to do. You can approve, reject, or ask it to adjust.

Fixing Bugs

Paste an error message and ask Claude Code to fix it:

claude "I'm getting this error when I run the app: [paste error here]. Find the cause and fix it."

Or point it at a failing test:

claude "the test test_user_creation is failing. Find out why and fix it."

Running Commands

Claude Code can run shell commands as part of its work — running tests, installing packages, checking output. It asks for permission before running anything. For example:

claude "run the test suite and fix any failing tests"

It’ll run the tests, see which ones fail, read the relevant code, make fixes, and run again.

Understanding Permission Levels

Claude Code asks for your approval at different levels:

  • Reading files — usually automatic
  • Writing files — asks before creating or changing files
  • Running commands — asks before executing anything in the terminal

You can configure how much it asks by setting the permission level when you launch it. For a trusted project where you want it to work more autonomously:

claude --dangerously-skip-permissions

Only use this in projects where you’re comfortable with it having full access.

Using CLAUDE.md to Give Persistent Instructions

Create a file called CLAUDE.md in the root of your project to give Claude Code standing instructions that apply every time you use it in that project. For example:

# Project Instructions
- This is a Python 3.11 FastAPI project
- Always write docstrings for new functions
- Use async/await throughout — no synchronous DB calls
- Run tests with: pytest tests/
- Never modify the migrations folder directly

Claude Code reads this file automatically at the start of every session. See our full guide: CLAUDE.md Explained

Useful Slash Commands

Inside interactive mode, Claude Code has built-in commands:

  • /help — show available commands
  • /clear — clear the conversation history and start fresh
  • /compact — summarise the conversation to save context space on long sessions
  • /cost — show how many tokens and how much the current session has cost
  • /exit — quit Claude Code

Tips for Getting the Best Results

  • Be specific — “add logging to the payment processing functions” works better than “improve the code”
  • One task at a time — Claude Code works better with focused tasks than several things at once
  • Review changes — always read what it’s changed before committing, especially on important files
  • Use git — make sure you’re in a git repo so changes are trackable and reversible

Sign Up For Daily Newsletter

Stay updated with our weekly newsletter. Subscribe now to never miss an update!

[mc4wp_form]

Leave a Reply

Your email address will not be published. Required fields are marked *