LevelUpWith

Explore / 10x Developer: Claude Code & LLM Selection Mastery / Lesson 1

Lesson 1: Installing Claude Code & CLI Setup

Initialize Claude Code in your local environment and authenticate your connection.

Free to read, no account needed. Part of 10x Developer: Claude Code & LLM Selection Mastery.

By the end of this level you'll be able to

  • Install Claude Code via npm and authenticate credentials
  • Launch an interactive CLI session inside a project repository
  • Execute a basic codebase search prompt using natural language

Welcome to Claude Code

Imagine having a senior software engineer sitting right beside you in your terminal, equipped with full knowledge of your repository's structure, configuration, and code conventions. That is the core premise of Claude Code—Anthropic's agentic command-line interface (CLI) tool designed to bring advanced language model intelligence directly to your local development environment.

Unlike web-based chatbot interfaces where you must constantly copy-paste snippets back and forth, Claude Code operates natively inside your terminal. It can read local files, execute terminal commands, edit source files, and inspect git history. In this foundational level, we will set up Claude Code, authenticate your account, launch your first interactive session, and run your first codebase search using natural language.


Step 1: Installing Claude Code via npm

Claude Code is distributed as a global Node Package Manager (npm) package. Before getting started, ensure you have Node.js (v18 or higher) installed on your machine.

To install Claude Code globally across your system, open your terminal and run the following command:

npm install -g @anthropic-ai/claude-code

This command registers the claude executable in your system path, allowing you to invoke the assistant from any directory in your terminal.

Authenticating Your Connection

Once installed, you need to authenticate Claude Code with your Anthropic account. Run the executable for the first time by typing:

claude

When invoked without active credentials, Claude Code initiates an interactive OAuth authentication flow:

  1. Your terminal will display a authorization link (or automatically open your default browser).
  2. Log in with your Anthropic account (or Console account).
  3. Grant Claude Code permission to access your API credentials.
  4. A confirmation code or token will automatically sync back to your terminal session.

After authentication completes successfully, your credentials are saved securely on your machine, and you won't need to re-authenticate for future sessions.


Step 2: Launching an Interactive Session in a Repository

Claude Code relies heavily on directory awareness. When you launch Claude Code, it uses your current working directory as its root context. It automatically respects .gitignore rules, scans the directory tree, and prepares to index or inspect files relevant to your queries.

To start working on a project:

  1. Open your terminal and navigate to your target project repository:

    cd ~/projects/my-web-app
    
  2. Launch the interactive session:

    claude
    

Upon launching, Claude Code initializes an interactive shell prompt (indicated by a > prompt). You are now inside a live session where Claude Code understands that my-web-app is the current active codebase.

Analogy: Think of running claude inside a folder like opening an IDE workspace. If you open VS Code inside a folder, it knows where your package.json, source files, and configs live. Claude Code does the exact same thing in your command line.


Step 3: Executing Your First Codebase Search Prompt

Now that your interactive CLI session is active, you can interact with your codebase using natural language. Rather than running manual grep commands or digging through nested folders, you can ask Claude Code to locate and explain components across your codebase.

Try typing a natural language prompt directly into the interactive > prompt:

> Find where user authentication is handled and summarize the login flow.

What Happens Behind the Scenes?

  1. Query Analysis: Claude Code interprets your intent (finding authentication code).
  2. Tool Execution: It autonomously uses local search tools to scan file names, imports, and code patterns across your repository.
  3. Context Gathering: It reads relevant files (e.g., src/auth/login.ts, middleware/auth.js).
  4. Synthesized Answer: It returns a concise summary directly in your terminal, pointing out specific files, line numbers, and execution logic.

You can also ask targeted search queries like:

  • "Where are our environment variables defined and validated?"
  • "Locate all API endpoints that interface with Stripe payments."

By leveraging natural language search immediately upon installation, you turn raw, complex repositories into instantly navigable knowledge bases.


Key Takeaways

  • Installation: Use npm install -g @anthropic-ai/claude-code to install the CLI tool globally.
  • Authentication: Running claude for the first time triggers browser OAuth authentication to link your Anthropic account.
  • Context Awareness: Always navigate to your project's root folder (cd path/to/project) before running claude so the assistant understands your workspace.
  • Natural Language Search: Ask Claude Code directly to locate files, summarize workflows, or find specific logic without manually grepping your project.

A 3-question knowledge check follows this lesson in the app, free and without an account.

More like this

  • AI Coder: Claude Code & Coding Agents

    Master vibe coding and autonomous workflows using Claude Code, Cursor, MCP servers, and modern AI coding agent frameworks.

    Beyond the Obvious · AI & Agents · Capable · 18 levels · 4 free · Professionally curated by levelupwith.com

  • Claude at Work: No-Code Skills for Knowledge Workers

    Learn to brief Claude clearly, check what it gives you, and set up Projects, Artifacts, Skills, memory, connectors and Research for real work in sales, marketi…

    Course · Claude · AI & Agents · Capable · 18 levels · 4 free · Professionally curated by levelupwith.com

  • Delegating Real Work to Claude: Tasks, Files and Apps

    Learn to hand Claude multi-step work on your real files, browser and Office apps, with clear briefs, firm limits and approval gates, then review the results so…

    Course · Claude · AI & Agents · Capable · 18 levels · 4 free · Professionally curated by levelupwith.com

  • Prompting Claude: Instructions, Context and Testing

    Write prompts that Claude follows reliably, manage what goes into its context window, and test and improve your prompts with evidence instead of guesswork. Eac…

    Course · Claude · AI & Agents · Capable · 20 levels · 4 free · Professionally curated by levelupwith.com

  • Finished Work with Claude Artifacts, No Code

    Brief, refine, brand, check, share and export finished designs, decks, documents, dashboards and motion pieces in Claude without writing code. Every level ends…

    Course · Claude · AI & Agents · Capable · 18 levels · 4 free · Professionally curated by levelupwith.com

  • Rolling Out Claude: An Admin's Plan from Pilot to Value

    Build a complete, defensible Claude rollout plan for your team or company, one decision at a time: structure and identity, access, governance, spend and visibi…

    Course · Claude · AI & Agents · Capable · 20 levels · 4 free · Professionally curated by levelupwith.com