Claude Code is Anthropic's command-line coding agent. Unlike a chat box, it runs in your project directory, reads your files, and can make edits — so getting the install and permissions right matters before you turn it loose.
Install the CLI
Claude Code installs globally through npm and requires a recent Node runtime.
node --version # needs Node 18 or newer
npm install -g @anthropic-ai/claude-code
claude --versionAuthenticate
Run claude once and it walks you through browser-based login, or supply an API
key through the environment for headless setups like CI.
claude # interactive: opens a browser to log in
# or, for scripts and CI:
export ANTHROPIC_API_KEY="sk-ant-..."Point it at a project
Launch Claude Code from your repository root so it has the right working context.
It reads a CLAUDE.md file for project-specific instructions.
# Project conventions
- Use Java 21 and Spring Boot 3.
- Never edit files under `generated/`.
- Run `./mvnw test` before proposing a commit.Verify and scope permissions
On first run, Claude asks before editing files or running commands. Review those
prompts — the tool is powerful, and a CLAUDE.md plus careful approvals keep it
predictable.
Takeaways
- Install globally with npm on Node 18+.
- Use interactive login locally and
ANTHROPIC_API_KEYfor automation. - A
CLAUDE.mdat the repo root encodes conventions the agent will follow.
Start it in a repo with a clean git tree so you can review and revert everything the agent does through normal version control.