Claude Code is Anthropic''s official CLI tool that brings Claude directly into your terminal. It can read your codebase, edit files, run commands, and reason about complex tasks — all from the command line. I use it daily, and this guide covers everything you need to go from installation to a productive workflow.
What Is Claude Code?
Claude Code is not a chatbot in your terminal. It is an agentic coding tool. You describe what you want, and it reads files, writes code, runs tests, and iterates — with your permission. It understands project structure, can search across large codebases, and maintains context across a session.
Think of it as a senior developer sitting next to you who can actually touch the code.
Installation
Prerequisites
- Node.js 18 or later
- An Anthropic API key or a Claude Pro/Max subscription
Install globally via npm
npm install -g @anthropic-ai/claude-code
Verify the installation:
claude --version
Authentication
On first run, Claude Code will prompt you to authenticate. You have two options:
- API key: Set
ANTHROPIC_API_KEYin your environment or enter it when prompted - Claude subscription: Log in with your Anthropic account (Pro or Max plan)
# Option 1: Environment variable
export ANTHROPIC_API_KEY=sk-ant-...
# Option 2: Interactive login
claude # follow the prompts
First Commands
Navigate to a project directory and launch Claude Code:
cd ~/projects/my-app
claude
You are now in an interactive session. Try these to get started:
> Explain the architecture of this project
> Find all files that handle authentication
> What does the handleSubmit function in ContactForm.tsx do?
Claude Code will read the relevant files, analyze the code, and respond with context-aware answers.
One-Shot Mode
For quick tasks, use the -p flag to run a single prompt without entering the interactive session:
claude -p "What testing framework does this project use?"
claude -p "List all API endpoints defined in the backend"
Configuring CLAUDE.md
The CLAUDE.md file is your project''s instruction manual for Claude Code. Place it in your project root, and Claude will read it at the start of every session.
A good CLAUDE.md includes:
# CLAUDE.md
## Architecture
- Frontend: React + TypeScript in frontend/
- Backend: NestJS in backend/
## Conventions
- CSS Modules, no Tailwind
- Conventional Commits
- All UI text via i18next
## Commands
- npm run dev — start frontend dev server
- npm run test — run tests
- npm run lint — run ESLint
This is the single most impactful thing you can do to improve Claude Code''s effectiveness on your project. The more context you provide, the better the results. I maintain a detailed CLAUDE.md for every project I work on.
Scoped Configuration
You can also create CLAUDE.md files in subdirectories. Claude Code merges them hierarchically — a frontend/CLAUDE.md adds context when working in the frontend directory without overriding the root file.
Permission Modes
Claude Code operates in three permission modes:
Default (Ask Mode)
Claude asks for confirmation before any file write, command execution, or destructive action. This is the safest mode and recommended for getting started.
Auto-Accept (YOLO Mode)
claude --dangerously-skip-permissions
Claude executes actions without asking. Useful for trusted, low-risk tasks on version-controlled code. I use this for routine tasks like updating dependencies or generating boilerplate — but only when I can easily revert with git.
Selective Permissions
You can configure which tools require approval and which can run automatically via the /allowed-tools command or in your settings. This is the sweet spot for daily use — allow reads and searches automatically, require approval for writes and commands.
Useful Slash Commands
Claude Code has built-in slash commands that are worth knowing:
/init
Generates an initial CLAUDE.md for your project by analyzing the codebase structure, build files, and conventions. A great starting point that you can then refine.
> /init
/compact
Compresses the conversation history to free up context window space. Essential for long sessions where you have been exploring a large codebase.
> /compact
/review
Asks Claude to review your current changes (staged and unstaged). It reads the diffs and provides feedback on bugs, style issues, and potential improvements.
> /review
/cost
Shows the token usage and cost for the current session.
Tips for Effective Prompting
After months of daily use, these patterns consistently produce better results:
Be Specific About the Outcome
# Vague
> Fix the login bug
# Specific
> The login form submits but the user is not redirected to /dashboard
> after successful authentication. Check the auth callback in
> useAuth.ts and the router configuration.
Provide Constraints
> Add input validation to the contact form.
> Use zod for schema validation.
> Do not add any new dependencies beyond zod.
> Follow the existing pattern in ProfileForm.tsx.
Iterate, Do Not Start Over
If the first result is 80% right, tell Claude what to adjust rather than re-prompting from scratch. It has the full context of what it just did.
> Good, but move the validation logic into a separate hook
> and add error messages for each field using our i18n setup.
Use It for Investigation, Not Just Generation
Claude Code excels at understanding code, not just writing it:
> Why does the build fail when I import from @/utils?
> Trace the data flow from the API response to the rendered component
> What would break if I renamed the user_id column to userId?
Integration with Your Workflow
Terminal Integration
Claude Code runs in any terminal. I use it inside tmux alongside my editor — one pane for Claude, one for the editor, one for the dev server.
VS Code
You can run Claude Code in the VS Code integrated terminal. It works the same as any terminal session, but you get the benefit of having the editor open alongside it for reference.
Git Workflow
Claude Code is git-aware. It can create commits, review diffs, and work with branches. My typical workflow:
- Create a feature branch
- Describe the feature to Claude Code
- Review the changes it makes
- Ask it to
/reviewits own work - Commit and push
What Claude Code Is Not
- It is not an auto-pilot. You are the decision-maker.
- It is not infallible. Review its output, especially for security-critical code.
- It is not a replacement for understanding your codebase. It is a force multiplier for developers who already know what they want.
Getting Started Today
- Install Claude Code:
npm install -g @anthropic-ai/claude-code - Authenticate with your API key or subscription
- Run
/initin your project to generate aCLAUDE.md - Start with read-only tasks (explain code, find patterns)
- Graduate to edits as you build trust
The learning curve is about 30 minutes. The productivity gain is immediate.


