TopDev
May 2, 2026 · TopDev · 1 min read

Install Claude Code and write code with AI in 30 minutes

Step-by-step guide: install Claude Code, sign in, and ask the AI to write your first code.

This guide walks you through installing and using Claude Code — Anthropic’s CLI for writing code with AI. From zero to your first line of AI-assisted code in about 30 minutes.

What you need first

  • A computer (Windows, macOS, or Linux)
  • An Anthropic account (free signup at claude.ai)
  • A terminal (Command Prompt / PowerShell on Windows, Terminal on Mac)

Step 1: Install Node.js

Claude Code requires Node.js v18 or later. Download the latest LTS from nodejs.org.

Once installed, open a terminal and verify:

node --version
# v22.x.x (or similar)

Step 2: Install Claude Code

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

Verify:

claude --version

Step 3: Sign in

Open the project folder you want to work in, then type:

claude

The first run opens a browser asking you to sign in to your Anthropic account. Once signed in, you’re ready to go.

Step 4: Your first request

In the Claude Code interface, type:

Read package.json and list this project’s dependencies.

Claude will read the file on its own and reply. This confirms it’s working.

Step 5: Let Claude write code

Try this request:

Create src/utils/format.ts with a formatDate(date: Date) function that returns a string in dd/mm/yyyy format.

Claude creates the file, writes the code, and describes each change. You review it, approve → the file is saved.

What’s next

#claude#huong-dan#lap-trinh