Claude Code: install, configure and use the terminal coding agent

Contents
Introduction
Install
Sign in and providers
CLAUDE.md and memory
Settings and permissions
Subagents
Skills and commands
MCP servers
Hooks
Daily workflows
Troubleshooting

Introduction

Claude Code is the Anthropic coding agent from the same family as Claude Opus 5.5. It reads a codebase, edits files, runs commands, works with git and connects to external tools over MCP. It runs in the terminal, in VS Code and JetBrains extensions, in a desktop app and in the browser, and every surface shares the same project configuration.

This guide is the working manual: install, sign-in, memory files, permissions, subagents, skills, MCP and the workflows that pay off daily. Agent files get their own deep dive in Claude Code subagents; the side-by-side view with OpenCode is in Building AI agents.

Install

The native installer is recommended on macOS, Linux and WSL, and it updates itself in the background:

curl -fsSL https://claude.ai/install.sh | bash

On Windows, use PowerShell or CMD depending on your shell:

irm https://claude.ai/install.ps1 | iex

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Package managers work too. Homebrew has a stable cask and a faster-moving one; Homebrew and WinGet installs do not auto-update:

brew install --cask claude-code brew install --cask claude-code@latest winget install Anthropic.ClaudeCode

Debian, Fedora, RHEL and Alpine users can install from the package manager repositories; the setup page linked below lists the exact commands. After installing, open a new terminal and check:

claude --version claude doctor

claude doctor runs installation diagnostics without starting a session: duplicate installs, PATH problems, unparseable settings and pending updates. If the shell says claude: command not found, the install directory is not on PATH yet; the troubleshooting page walks through a fix. Git for Windows is recommended on native Windows so the Bash tool has a real shell.

Prefer an editor or a window? The VS Code and Cursor extension, the JetBrains plugin, the desktop app and the web version at claude.ai/code share the same engine and configuration. The desktop app bundles the command line, so you do not install the CLI separately for it. Installation details: code.claude.com setup.

Sign in and providers

The first run prompts for a login. Two main routes:

For scripts, set ANTHROPIC_API_KEY in the environment and approve the key when asked; Claude Code then skips the login prompt. Teams on cloud platforms can route through Amazon Bedrock, Google Cloud or Microsoft Foundry instead of the Anthropic API; the provider variables live in the third-party integration docs.

export ANTHROPIC_API_KEY=sk-ant-... claude

Inside a session, /login and /logout switch accounts, and /status shows which account, plan and model are active. Subscription sessions can also sync skills from your claude.ai account; API-key sessions do not.

CLAUDE.md and memory

Every session starts with a fresh context window, so durable rules belong in files. CLAUDE.md is the project instruction file; it is read at the start of every conversation. Locations, from broadest to most specific:

Files from the working directory upward are concatenated, closest last. Files in subdirectories load on demand when Claude touches a file there. Run /init once to generate a starting file, /memory to open and edit the files, and /context to confirm what loaded.

Repositories that already use AGENTS.md do not need a duplicate: Claude Code reads AGENTS.md in place of CLAUDE.md when no CLAUDE.md or CLAUDE.local.md exists in the working directory or above it. A one-line CLAUDE.md importing it with @AGENTS.md keeps both tools on the same file when a CLAUDE.md already exists or the version is older.

# CLAUDE.md @AGENTS.md ## Claude Code - Use plan mode for changes under src/billing/.

Imports with @path expand at launch and can nest four hops deep. For larger projects, split instructions into .claude/rules/ files; a rule with paths: frontmatter loads only when Claude works with matching files. Keep each file under about 200 lines: longer files cost context and reduce adherence. Claude also keeps its own auto memory at ~/.claude/projects/<project>/memory/, with a MEMORY.md index; browse it with /memory.

Settings and permissions

Settings live in JSON files with a clear precedence: managed policy, then user ~/.claude/settings.json, then project .claude/settings.json, then local .claude/settings.local.json. The permissions block is the safety layer. Rules are evaluated as allow, ask and deny, with the tool name plus an optional specifier. Shared project rules go in .claude/settings.json:

vi .claude/settings.json

{ "permissions": { "allow": [ "Bash(git status:*)", "Bash(git diff:*)", "Bash(npm run test:*)" ], "ask": ["Bash(git push:*)"], "deny": [ "Read(./.env)", "Read(./secrets/**)", "Bash(curl:*)" ] } }

Project rules and hooks only take effect after you trust the workspace once; a cloned repository cannot approve its own configuration. Permission modes change how much prompting happens:

Set the mode per session with --permission-mode or switch inside a session with /permissions. Deny rules and hooks are the only layers that hold even in auto mode, so put the truly forbidden paths there: .env, credentials, deployment keys.

Subagents

Subagents are specialized workers with their own context window, system prompt, tool list and model. Claude delegates to them by matching the task against each subagent description, and they return only the summary, which keeps exploration and logs out of the main conversation. Files live in .claude/agents/ (project) or ~/.claude/agents/ (personal). Example file .claude/agents/code-reviewer.md:

mkdir -p .claude/agents

vi .claude/agents/code-reviewer.md

--- name: code-reviewer description: Reviews changes for correctness, security and missing tests. Use after every code change. tools: Read, Grep, Glob model: opus --- You are a strict reviewer. Report findings in severity order, each with file and line. Never edit files.

Ask for one by name when you want it explicitly: Use the code-reviewer subagent on my staged changes. Built-in subagents such as Explore, Plan and general-purpose cover search and multi-step work without any files. Files, fields, tools, models, memory, worktree isolation and complete examples are in Claude Code subagents.

Skills and commands

A skill packages a repeatable procedure. It is a directory with a SKILL.md inside; the body loads only when the skill is used, so long checklists cost almost nothing at rest. Project skills live in .claude/skills/<name>/SKILL.md. Example file .claude/skills/summarize-changes/SKILL.md:

mkdir -p .claude/skills/summarize-changes

vi .claude/skills/summarize-changes/SKILL.md

--- description: Summarizes uncommitted changes and flags risks. Use when the user asks what changed. allowed-tools: Bash(git diff:*) --- ## Current changes !`git diff HEAD` Summarize in two or three bullets, then list risks: missing error handling, hardcoded values, tests to update.

Two ways to run it: Claude invokes the skill automatically when the description matches, or you type /summarize-changes. Frontmatter controls the rest: disable-model-invocation makes a skill manual-only, allowed-tools pre-approves tools for the turn, paths limits activation to matching files, and context: fork runs the skill in its own subagent. A markdown file in .claude/commands/ is the older command format and still works; custom commands and skills were merged.

Skills follow the Agent Skills open standard, and .claude/skills/ is also read by OpenCode as a compatibility location — one directory, two assistants. Claude Code ships bundled skills too, including /code-review, /verify and /run; list them with /skills. Format details and more examples: Writing skills for AI assistants.

MCP servers

MCP connects Claude Code to issue trackers, databases, design files and monitoring. Add a remote server over HTTP:

claude mcp add --transport http notion https://mcp.notion.com/mcp claude mcp add --transport http secure-api https://api.example.com/mcp \ --header "Authorization: Bearer your-token"

For a local tool that runs as a process, everything after the double dash is the launch command:

claude mcp add airtable --env AIRTABLE_API_KEY=YOUR_KEY -- npx -y airtable-mcp-server

Three scopes decide who sees the server: local (only you, this project), project (committed to .mcp.json and shared with the team) and user (all your projects). Check and manage them with claude mcp list and /mcp; project servers wait for your approval the first time. Treat every server as code you are running: verify the publisher before connecting, because a server that fetches external content can carry prompt injection.

Hooks

Instructions in CLAUDE.md are guidance; hooks are enforcement. They run shell commands at fixed lifecycle points, configured under the hooks key in a settings file: before a tool call (PreToolUse), after it (PostToolUse), when a session starts or ends, and when instructions load. Typical uses: format after every edit, run the lint gate before commit, or block a command outright. Project hooks go in .claude/settings.json:

vi .claude/settings.json

{ "hooks": { "PostToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "npx prettier --write $CLAUDE_FILE_PATHS" } ] } ] } }

Hooks run with your permissions and apply to the whole session, so keep them small and deterministic. The hooks guide linked below covers every event, matcher and exit-code contract: code.claude.com hooks.

Daily workflows

The full map of surfaces and automation is in the official docs: code.claude.com overview.

Troubleshooting

Article author: Arthur Isaev

Related articles
AI
Claude Code: install, configure and use
Claude Code subagents
Building AI agents for OpenCode and Claude Code
OpenCode: install, configure and use
OpenCode agents: four complete examples
Writing skills for AI assistants
Models for coding agents
Banner image

Search this site

Channel @aofeed Chat @aofeedchat

Contacts and cooperation:
I recommend our hosting beget.com
Write to info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: