You may have heard Claude Code is powerful and want to try it, but opening Terminal makes you a little nervous. This guide starts from the basics: in 30 minutes, you will install it, run your first chat, and set up CLAUDE.md. You do not need to be an engineer, but you do need to be willing to open Terminal.
One version note: Anthropic publicly shared best practices for Claude Code’s Opus 4.7 on April 16, 2026, but which models actually show up in your account is still whatever /model lists inside Claude Code.
Step 1: Set Up the Environment
Install Node.js
Claude Code requires Node.js 18 or later. If you already have it, skip this part.
If you do not, I recommend using nvm (Node Version Manager) to manage it:
# macOS / Linux
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
# After reopening Terminal
nvm install 18
nvm use 18
After installation, run node -v. If you see v18.x.x or higher, you are good.
Install Claude Code
npm install -g @anthropic-ai/claude-code
Once it finishes, run claude --version to confirm the installation worked.

Step 2: Your First Chat
Open Terminal in any folder and type:
claude
The first launch will show a login flow. Follow the instructions to verify your Anthropic account.
After login, you will see an interactive chat interface. Try typing:
Show me what files are in this folder
Claude Code will use ls or a similar command to scan the current directory, then tell you what it found.
That is the basic Claude Code interaction model. You describe what you want in natural language, and it chooses the right tool to do it.


Step 3: Learn the Basic Commands
Inside a Claude Code conversation, a few slash commands come up all the time:
| Command | What it does |
|---|---|
/help | Show all available commands |
/clear | Clear the current conversation history |
/compact | Compress conversation history and free up context |
/cost | Show current token usage |
The one I use most is /compact. When a conversation gets too long, the context window can fill up. Run /compact to compress the less important history, and you can keep working.
You can also use non-interactive mode directly in Terminal:
claude "Fix the typos in README.md"
This runs the task and exits instead of entering an interactive chat. It is useful inside scripts.

Step 4: Set Up CLAUDE.md
This is the key step that turns Claude Code from a “generic AI” into your personalized AI.
Create a CLAUDE.md file in the project root:
touch CLAUDE.md
Open it and write the first version of your rules. For beginners, I would start with these three sections:
# CLAUDE.md

## Project description
This is a personal blog built with Next.js.

## Code style
- Use TypeScript
- Prefer functional components
- Use camelCase for variable names

## Things to avoid
- Do not delete any existing files
- Do not run git push
After you save it, Claude Code will automatically read this file the next time it starts. When you talk to it, it will remember these rules.
CLAUDE.md can grow from the first 10 lines into a whole tree over time. But the starting point is that simple. Every time Claude Code does something you did not want, add one rule to CLAUDE.md.
Advanced: Layered Settings
CLAUDE.md can live at different levels:
- Project-root CLAUDE.md: rules for the whole project
- Settings under
~/.claude/: preferences shared across all projects
As a beginner, just take care of the project-root file first. Add the others only when you need them.
Step 5: Build a Simple Automation
Once Claude Code is installed, chat works, and CLAUDE.md is in place, try one slightly more advanced thing: let Claude Code automate a task for you.
Suppose every day you need to “open the project, run git pull, and check whether there are new issues.” You can write a simple script:
#!/bin/bash
cd /path/to/your/project
git pull
claude "List the 3 most recent unresolved GitHub issues and summarise each in one sentence"
Save it as morning-check.sh, then make it executable:
chmod +x morning-check.sh
Run ./morning-check.sh every morning, and that is your first Claude Code automation.
It is simple, but the concept scales. Scheduled tasks, hooks, and MCP all extend from this same foundation.

FAQ
What if the conversation gets too long?
Run /compact. It compresses old conversation history, keeps the important parts, and frees up space in the context window.
My practical habit is to compact every 15-20 minutes of work, so the context window does not quietly blow up.
What if Claude Code makes a mistake?
Press Ctrl+C to interrupt the current action. Before Claude Code performs any risky operation, such as writing files or running commands, it will ask for confirmation. When you see that prompt, read carefully what it is about to do before pressing Enter.
If it has already damaged a file, restore it with git checkout -- filename or git stash. This is also why I recommend making sure the project is under git version control before using Claude Code.
How do I make it read a specific file?
Tell it directly in the conversation:
Read the contents of src/config.ts
It will use its built-in file reading tool to open that file. You can give it either a relative path or an absolute path.
What if a command runs for a long time with no response?
It may be waiting for an API response. Claude Code’s speed depends on API latency and the model you choose. The newest Opus is usually slower but gives the best reasoning quality; Sonnet is still the main daily-work model for most people and is much faster. For a detailed Opus / Sonnet comparison, see Claude Opus vs Sonnet Comparison.
If it is truly stuck, press Ctrl+C and enter the command again.
Next Steps
After you understand the 5 steps above, you can explore:
- hooks: trigger custom actions on specific events
- MCP: connect external tools and APIs
- Scheduled tasks: let Claude Code run work at fixed times
These advanced features are covered in detail in the Complete Claude Code Guide.
Little Penguin’s Experience
My CLAUDE.md started as 3 simple rules and has gradually evolved into a layered, multi-file setup. The important habit is “add one rule every time you hit a pitfall.” The simpler the first version is, the better. After three months, you will realize you have built a very personal AI operating manual, and that manual is where Claude Code starts to pull away from other tools.
/compact is the most underrated command. A silently overflowing context window is one of the most common ways Claude Code gets stuck. Once you build the habit of compacting every so often, a session can stay open for a long time. Beginners also often forget that it can run in non-interactive mode directly with claude "...", and combined with cron, that is the simplest starting point for automation.
The starting point for OpenClaw’s multi-agent system is also CLAUDE.md. Add rules one by one, and a personal AI assistant can slowly grow into a multi-agent workflow. Beginners do not need to think that far ahead on day one, but it is useful to know the ceiling is high.
Further Reading
- Complete Claude Code Guide
- Claude Code vs Cursor Comparison
- Complete Claude AI Guide
- Claude Opus vs Sonnet Comparison
— Penchan