How to install and use Claude Code CLI: Anthropic login, first repo coding task
Install claude, sign in with Anthropic, and finish one small repo task you can verify with git diff.
To run your first repo task with Claude Code CLI, finish four steps: official install, Anthropic login (subscription or Console), start a session in a git repo, then review and approve a small change.
Facts follow docs.anthropic.com/en/docs/claude-code/overview and docs.anthropic.com/en/docs/claude-code/quickstart. Queries: Claude Code CLI install, Claude Code login. For a short huddle see sitdraw and create and join a room.
Browser login vs API key
Browser auth
On first claude run, complete Claude Pro/Max/Team/Enterprise or Claude Console in the browser; type /login inside a session to switch accounts.
ANTHROPIC_API_KEY
If the env var is set, Claude Code may ask to use it and skip the browser prompt when you approve. Never commit keys.
| Goal | Entry | First-hour check |
|---|---|---|
| Install | curl -fsSL https://claude.ai/install.sh | bash, Homebrew, WinGet | claude --version prints a version |
| Sign in | First claude or /login | Prompt accepts read-only questions |
| Explore | what does this project do? | Summary matches your repo |
| First edit | One-file README or comment tweak | git diff matches intent |
Install, login, first coding task
- 01Install Claude Code CLI
macOS/Linux/WSL:
curl -fsSL https://claude.ai/install.sh | bash(native installs auto-update). Orbrew install --cask claude-code, Windowswinget install Anthropic.ClaudeCode. Open a new terminal and runclaude --version. On native Windows, Git for Windows is recommended for the Bash tool. - 02Anthropic login
cdto your project root and runclaude. Sign in with a Claude subscription or Claude Console in the browser, or approveANTHROPIC_API_KEYwhen prompted. - 03Explore read-only first
Ask
what does this project do?orwhere is the main entry point?. Optional: addCLAUDE.mdat the repo root for team rules. - 04First small change
Request a one-line README update or comment-only edit. Review diffs before accepting; use
Shift+Tabto cycle permission modes. Verify withgit diff.
# First hour · Claude Code CLI · 2026-10
# curl -fsSL https://claude.ai/install.sh | bash
# cd my-repo && claude
# Docs: docs.anthropic.com/en/docs/claude-code/quickstart- Compare Codex CLI or OpenCode?
- See our Codex CLI guide and OpenCode CLI guide.
- Command not found?
- Open a new terminal after install; see Fix your PATH in the docs.
- CLAUDE.md required?
- Optional but recommended for persistent project instructions.
- Whiteboard?
- Open sitdraw for diagrams.
Sign in, then approve small diffs
Keep the first task tiny; use Shift+Tab to understand permission modes.