What Is Claude Code? The Complete Guide from Installation to First Use
A beginner-friendly guide to installing and using Claude Code. Learn how to get started with this terminal-based AI coding assistant today.
What Is Claude Code
Claude Code is a terminal-based AI coding assistant built by Anthropic. Unlike VS Code extensions, it runs as a CLI tool — and that’s its defining feature. It understands your entire codebase and can edit files, create new ones, run commands, and handle Git operations all in one place.
Because it doesn’t depend on any specific editor, you can use it in any development environment.
Installation
Prerequisites
- Node.js 18 or later installed
- An Anthropic account (Max plan or API access)
Install via npm
npm install -g @anthropic-ai/claude-code
Once installed, verify the installation:
claude --version
Initial Authentication
Authentication is required on first launch.
claude
Running the command will open your browser to authenticate with your Anthropic account. Once authentication is complete, you’ll be returned to the terminal and ready to go.
Basic Usage
Interactive Mode
Just type claude in your project’s root directory to start an interactive session.
cd my-project
claude
Inside the session, you can give instructions in natural language:
> Explain the structure of this project
> Add a validation function to src/utils/helper.ts
> Run the tests and make sure they pass
One-Shot Mode
To run a single command without starting an interactive session, use the -p flag:
claude -p "Check the dependencies in package.json and list any unused ones"
Piping Input
You can also pipe data into Claude Code via stdin:
cat error.log | claude -p "Analyze this error log and suggest a fix"
git diff | claude -p "Review this diff"
Useful Slash Commands
Here are some handy slash commands you can use during a session:
| Command | Description |
|---|---|
/help | Show help |
/clear | Clear conversation history |
/compact | Summarize and compress the conversation |
/init | Generate a CLAUDE.md file |
/cost | Show token usage for the current session |
Things to Try First
1. Understand Your Project
> Explain the architecture of this project
Claude Code reads through all the files and gives you a structural overview.
2. Generate a CLAUDE.md
> /init
This auto-generates a configuration file that tells Claude Code about your project’s rules and coding conventions.
3. Fix a Bug
> Run npm test, find the failing tests, and fix them
Claude Code handles the entire flow — running tests, identifying errors, and patching the code.
Permission Settings
Since Claude Code can edit files and run commands, it prompts for confirmation on each action. You can pre-approve trusted commands in your settings:
// .claude/settings.json
{
"permissions": {
"allow": [
"Read",
"Bash(npm test)",
"Bash(npm run lint)"
]
}
}
Conclusion
Claude Code is easy to install and lets you start working with an AI coding assistant directly from your terminal. Start by running claude in a project directory and try things like code explanations or refactoring. In upcoming articles, we’ll cover comparisons with other AI tools and more advanced workflows.