Claude Code is
Anthropic’s agentic
coding tool. It can read a codebase, edit multiple files, run commands and tests, work with Git and connect to development tools. It is available in the terminal, Visual Studio Code, Cursor, JetBrains IDEs, the Claude desktop app and a browser.
The key word is agentic. A normal coding chatbot suggests text. Claude Code can investigate a repository, form a plan, change the project and verify the result with tools. That can remove repetitive work, but it also gives an AI system access to files, commands and external services. Good permissions and review are part of using the product, not optional extras.
This tutorial follows Anthropic’s
current Claude Code documentation. For the model family behind it, see our
Claude models guide; for the complete product map, start with our
Claude AI guide.
Claude Code at a glance
| Question | Short answer |
| What is it? | An AI coding agent that can inspect, edit and run a software project |
| Where does it run? | Terminal, VS Code and Cursor, JetBrains, desktop and web |
| Does it work on Windows? | Yes, through native Windows, PowerShell, CMD, WinGet or WSL routes |
| Is it free? | Normal use requires an eligible Claude plan, Console/API billing or supported provider |
| Does it index code remotely? | Anthropic says the terminal product works directly with model APIs and does not require a separate remote code index |
| Can it use Git? | Yes, it can inspect changes, stage files, create commits and help prepare pull requests |
| Can it run tests? | Yes, when the command is available and permitted |
| Can it connect to other tools? | Yes, including through MCP |
| Is human review still needed? | Yes, especially for security, data, infrastructure and production changes |
What makes Claude Code different from Claude Chat?
Claude Chat can explain code and analyze files you provide. Claude Code operates in a development environment.
It can:
- search a repository;
- read project files;
- edit several files in one task;
- run a formatter, linter or test suite;
- inspect errors and revise the change;
- use Git;
- call approved command-line tools;
- connect to issue trackers, databases or other systems;
- and continue through a multi-step implementation.
That makes Claude Code closer to a junior or intermediate engineering agent than a question box. It still lacks responsibility, business context and guaranteed correctness. The developer remains the reviewer and owner.
Where can you use Claude Code?
Terminal
The command-line interface provides the most direct integration with a local project and existing CLI tools. It is suitable for developers comfortable with a terminal and for scripted or automated workflows.
Visual Studio Code and Cursor
The extension provides inline diffs, file references, plan review and conversation history inside the editor. Anthropic documents support for VS Code and Cursor through the same extension route.
JetBrains IDEs
A JetBrains plugin supports IDEs such as IntelliJ IDEA, PyCharm and WebStorm. It requires the Claude Code CLI to be installed separately.
Claude desktop app
The Code area in the Claude desktop app offers visual diffs, multiple sessions, scheduled tasks and cloud sessions. An eligible paid subscription is required.
Browser and mobile
Claude Code on the web can run work without local setup, including long-running and parallel tasks. Anthropic also exposes mobile access for starting or checking supported work. A cloud session does not automatically have the same local environment as a developer laptop.
Choose the surface that matches the repository, tools and security boundary. “Available everywhere” does not mean every surface has the same filesystem, credentials or provider.
Claude Code requirements
You need:
- an eligible Claude account, Claude Console account or supported third-party provider;
- a supported operating system;
- access to the project;
- and the development tools required to build and test it.
Claude Code can write code without every dependency installed, but it cannot reliably verify a project if the project itself cannot build. Prepare the environment first.
For native Windows, Anthropic recommends Git for Windows so Claude Code can use Bash. Without it, Claude Code uses PowerShell. WSL does not require Git for Windows.
How to install Claude Code
Anthropic’s current recommended native installer for macOS, Linux and WSL is:
curl -fsSL https://claude.ai/install.sh | bash
For Windows PowerShell:
irm https://claude.ai/install.ps1 | iex
For Windows Command Prompt:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Package-manager alternatives include:
brew install --cask claude-code
and:
winget install Anthropic.ClaudeCode
Anthropic also documents apt, dnf and apk routes for supported Linux distributions.
Verify before running an installer
Commands that download and execute a remote script are convenient and sensitive. Copy them from Anthropic’s official documentation, confirm the domain and review the installation method according to your organization’s policy. Enterprises may prefer managed distribution.
Updates
Anthropic says its native installation updates automatically. Homebrew and WinGet installations do not; update them through the relevant package manager:
brew upgrade claude-code
or:
winget upgrade Anthropic.ClaudeCode
Keep the client current for security fixes, but do not update critical shared environments without normal change control.
Start your first Claude Code session
Open a terminal and move into the project:
cd path/to/your-project
claude
The first session asks you to authenticate. Claude Code supports individual Claude accounts, Team and Enterprise arrangements, the Claude Console and selected cloud providers.
Before asking it to edit, establish the baseline:
git status
Run the relevant test or build command yourself. If the project is already failing, record that state. Otherwise, Claude may later claim responsibility for an existing failure or “fix” something unrelated.
A safe first task
Start read-only:
Explain the repository structure, identify the main entry points and tell me how tests are organized. Do not edit files or run commands that change the project.
Then give one bounded change:
Add validation for an empty email address in the registration service. First identify the current behavior and existing test convention. Propose a plan. After approval, add the smallest change and tests. Do not modify unrelated formatting or dependencies.
A bounded task has:
- a named component;
- expected behavior;
- a review point;
- a test requirement;
- and explicit exclusions.
“Improve the application” has none of those.
Plan mode
Plan mode lets Claude inspect and reason about the project without editing source files. In the CLI, Anthropic documents /plan and a Shift+Tab shortcut.
Use Plan mode when:
- the repository is unfamiliar;
- the change spans several components;
- architecture decisions are involved;
- or you need to inspect scope before granting write access.
Ask for:
- files likely to change;
- dependencies;
- migration risk;
- tests;
- rollback;
- and unresolved questions.
Review the plan against the actual repository. A confident plan can still be based on a missed code path.
A reliable Claude Code workflow
1. Define the acceptance criteria
Describe observable behavior:
When an unauthenticated user requests /account, return 401 JSON with error code AUTH_REQUIRED. Existing authenticated behavior must not change. Add unit and integration coverage.
2. Ask Claude to investigate
Have it locate the handler, authentication middleware and existing error format.
3. Review the plan
Check whether it found the correct layer. An agent may try to patch a controller when the behavior belongs in shared middleware.
4. Implement the smallest change
Explicitly prevent unrelated cleanup. Large opportunistic refactors make review harder.
5. Run focused tests
Start with the changed module, then widen to the relevant suite.
6. Inspect the diff
Use Git:
git diff --stat
git diff
Check for deleted validation, changed configuration, secrets, generated files and dependency churn.
7. Ask for a self-review
Review the diff against the acceptance criteria. Look for untested branches, security regressions and unnecessary changes. Do not edit yet.
8. Perform human review
The developer checks logic, maintainability, security and product intent.
9. Commit deliberately
Only after the change passes normal review. Claude can draft a commit message, but the human decides what enters history.
Use CLAUDE.md for project instructions
CLAUDE.md is a Markdown file Claude Code reads at the start of a session. Put stable repository knowledge there:
- build and test commands;
- architecture boundaries;
- coding conventions;
- generated files that must not be edited;
- required security checks;
- and the definition of done.
Example:
# Project instructions
## Commands
- Install: `npm ci`
- Unit tests: `npm test`
- Lint: `npm run lint`
- Type check: `npm run typecheck`
## Architecture
- Route handlers call services; they do not query the database directly.
- Shared authorization lives in `src/auth`.
- Do not modify generated files under `src/generated`.
## Change rules
- Keep changes scoped to the requested task.
- Add or update tests for behavior changes.
- Never print or commit secrets.
- Ask before changing dependencies, migrations or public APIs.
## Completion
- Run focused tests, lint and type check.
- Summarize changed files, tests and remaining risks.
Do not turn CLAUDE.md into a novel. Long, conflicting instructions reduce clarity. Keep it version-controlled and review it like other developer configuration.
Automatic memory
Claude Code can also save useful learnings such as build commands and debugging information. Review persistent memory when behavior becomes surprising. A stale remembered workaround can be worse than no memory.
Use Claude Code for codebase onboarding
Ask it to produce a map:
Explain how an HTTP request moves from routing to persistence in this repository. Identify the files for authentication, validation, domain logic and database access. Cite the file path and symbol for each step. Do not edit anything.
Follow with:
Which parts of your explanation are inferred rather than confirmed by a call path or test?
The file references make the explanation inspectable. Do not accept a generic architecture description that could fit any project.
Use Claude Code to fix a bug
Provide:
- the error;
- reproduction steps;
- expected behavior;
- relevant logs;
- and constraints.
Example:
The checkout endpoint sometimes creates two orders when the client retries after a timeout. Reproduce the issue with a failing test. Trace the idempotency path and propose the smallest safe fix. Do not change payment-provider code or database schema without asking.
Require a failing test before the fix when practical. It proves that the agent found the behavior and prevents a plausible but unrelated patch.
Use Claude Code to add a feature
Break work into vertical increments.
Instead of:
Build team invitations.
Use:
Add the domain and service-layer support for creating a single-use team invitation with a 48-hour expiry. Reuse existing token utilities. Do not add email delivery or UI in this change. Include tests for expiry, reuse and cross-team access.
This reduces the surface and gives reviewers a coherent unit.
Use Claude Code for tests
Claude Code is effective at finding untested branches and matching existing test patterns. Avoid asking for tests that merely mirror implementation.
Prompt:
Review the public behavior of InvoiceService. Identify meaningful untested cases, especially permissions, failure recovery and boundaries. Add tests for behavior, not private methods. Do not weaken existing assertions or mock the unit under test.
Watch for:
- tests that always pass;
- assertions removed to make the suite green;
- excessive mocking;
- snapshot updates that hide a regression;
- and retries that mask nondeterminism.
Use Claude Code for refactoring
A refactor should preserve behavior. State that explicitly and define proof:
Extract payment retry policy from CheckoutService without changing observable behavior. Run the existing suite first, add characterization tests for uncovered branches, make the refactor and show the before-and-after public API.
Large migrations should have checkpoints, compatibility layers and rollback. Do not ask one agent session to rewrite the entire system unless the work is isolated and reproducible.
Use Claude Code with Git
Claude Code can:
- inspect status and diffs;
- create branches;
- stage selected files;
- draft commits;
- and prepare pull requests through available tools.
Keep Git safety habits:
- begin from a clean or understood worktree;
- do not let the agent discard unknown changes;
- commit in reviewable units;
- inspect staged content;
- and protect the default branch.
If unrelated user changes exist, tell Claude they are off-limits. An agent cannot know which uncommitted work is disposable.
Claude Code in VS Code and Cursor
Install the official extension from the editor marketplace or Anthropic’s documented link. Open the Command Palette and launch Claude Code.
Editor integration is useful for:
- visual diff review;
- referencing open or selected code;
- moving between plan and implementation;
- and keeping the conversation near the files.
The extension does not remove the need to understand terminal commands it invokes. Review proposed shell and Git actions with the same care as in the CLI.
Claude Code in JetBrains
Install the Claude Code plugin through the JetBrains Marketplace and restart the IDE. The CLI must also be installed.
JetBrains integration provides selection context and interactive diffs. Verify compatibility with the exact IDE version and enterprise plugin policy.
Connect Claude Code with MCP
The Model Context Protocol lets Claude Code call external tools and data sources. An MCP server can expose an issue tracker, monitoring system, database, design tool or internal API.
This can remove copying:
Read issue APP-184, inspect the related error in the monitoring tool and propose a fix in this repository.
It also expands access. Before enabling a server:
- Verify its source and maintainer.
- Read the tools it exposes.
- Restrict credentials and scope.
- Decide which operations require approval.
- Test in a non-production environment.
- Log or monitor important actions.
An MCP tool is code with privileges, not a harmless prompt template.
Anthropic’s
MCP guide covers current configuration.
Skills, hooks, plugins and agents
Skills
Skills package a reusable workflow or specialized instruction set. A team could create a security review, dependency update or release-note Skill.
Hooks
Hooks run commands around Claude Code actions. Examples include formatting after edits or running lint before a commit.
Hooks execute software. Keep them small, version-controlled and reviewed. Never copy a hook from an untrusted repository and run it with broad credentials.
Plugins
Claude Code plugins can bundle Skills, agents, hooks, MCP servers, language-server components and other extensions. That makes them powerful and raises the same supply-chain questions as other development dependencies.
Agent teams and background agents
Claude Code can coordinate multiple agents or run sessions in parallel. Parallelism is useful when tasks are genuinely separable, such as investigating different modules or preparing independent tests.
More agents also mean more context, cost and merge risk. Give each agent a bounded ownership area and make one process responsible for integration.
Schedule and automate Claude Code
Claude Code can run recurring tasks such as:
- dependency audits;
- morning pull-request reviews;
- overnight CI-failure analysis;
- issue triage;
- and documentation synchronization.
Unattended work should operate inside a restricted environment with:
- scoped credentials;
- filesystem and network boundaries;
- no direct production deployment;
- a maximum runtime or spend;
- observable output;
- and a human approval before consequential changes merge.
Automation magnifies both useful behavior and mistakes.
Claude Code permissions
Anthropic says Claude Code starts with strict read-only permissions. It asks before file changes, commands and other consequential actions unless the user or organization has configured different rules.
Permissions can allow, deny or ask for specific tools, files, commands and domains. Use the narrowest rule that supports the workflow.
Do not approve a command because the explanation sounds reasonable. Read the command, target and effect.
Sandboxing
Permissions and sandboxing are different:
- permissions decide what Claude Code may request or use;
- sandboxing enforces filesystem and network boundaries for Bash commands at the operating-system level.
Use both for defense in depth. A permission rule is not a full analysis of what a shell command will do. A sandbox can contain damage if a permitted command behaves unexpectedly.
For untrusted repositories, unattended agents or reduced approval prompts, use a dedicated sandbox, development container or virtual machine. Anthropic’s
sandbox documentation explains the current options.
Security checklist
Before the session:
- remove secrets from source and prompt context;
- use a branch or isolated copy;
- understand uncommitted work;
- restrict credentials;
- and run baseline tests.
During the session:
- use Plan mode for broad changes;
- inspect commands;
- avoid bypassing permissions;
- watch for instructions hidden in repository content;
- and stop when the agent moves outside scope.
After the session:
- review every changed file;
- inspect generated and configuration files;
- run tests and security checks;
- verify dependencies and migrations;
- and confirm no secret entered logs or commits.
Our
Claude privacy and security guide covers data handling beyond repository permissions.
Prompt injection in code repositories
An untrusted README, issue, comment, test fixture or generated file can contain instructions aimed at the agent. Claude may interpret content as a task rather than data.
Reduce the risk:
- do not point an agent with secrets at an untrusted repository;
- isolate network and filesystem access;
- treat tool output as untrusted input;
- forbid credential retrieval unless required;
- require approval for external communication;
- and review unexpected requests to change security settings or run opaque scripts.
Prompt injection is not solved by asking the model to ignore prompt injection.
Claude Code pricing
Claude Code is currently included within the usage allowances of Claude Pro, Max, Team and eligible Enterprise plans. It can also use consumption-based Claude Console access or supported provider billing.
The practical routes are:
- Pro at $20 monthly or $200 annually for moderate individual use;
- Max at $100 or $200 monthly for larger individual allowances;
- Team standard or premium seats for managed organizations;
- Enterprise seat plus usage;
- or API/provider consumption.
Heavy agentic work uses more capacity than short chat. A subscription can be predictable but interrupt a long session; API billing continues while spend continues.
See
Claude pricing for the current plan and model rates.
Claude Code versus a direct API integration
Claude Code is a ready-made coding environment. The
Claude API gives a developer the model and platform primitives to build a custom product.
Use Claude Code when you want:
- repository exploration;
- edits and commands;
- Git workflows;
- an interactive terminal or IDE;
- and built-in agent behavior.
Use the API when you need:
- an application-specific interface;
- controlled tools;
- custom orchestration;
- metered backend calls;
- structured output;
- or a product used by people who never open Claude Code.
The Agent SDK can reuse Claude Code-style capabilities in custom agent systems, but deploying an agent securely remains an engineering task.
Claude Code versus GitHub Copilot and Codex
GitHub Copilot, Claude Code and OpenAI Codex increasingly overlap. A simple label such as “autocomplete versus agent” can become outdated as products add modes.
Compare the exact purchased experience:
- editor completion;
- repository agent;
- pull-request review;
- cloud task;
- model choice;
- enterprise policy;
- and price.
Our
Claude versus ChatGPT comparison compares Claude Code with Codex at the product level. A GitHub Copilot article should own the broader Copilot comparison rather than duplicating it here.
Common problems
claude command not found
Restart the shell and confirm the installation path is on PATH. Use the official troubleshooting instructions for the selected installer.
PowerShell command fails
Confirm whether the prompt is PowerShell or Command Prompt. Their command syntax differs. Use the matching official installer.
Claude changes too much
Stop the session, restore from version control or reject the diff, then restate scope and exclusions. Ask for a plan and file list before edits.
Tests fail after the change
Separate pre-existing failures from new ones. Ask Claude to explain the first relevant failure and identify the changed code path. Do not let it disable tests to reach green.
Usage limit reached
Long context, stronger models and agentic work consume more. Start a fresh session when old context is irrelevant, use a lower-cost model where appropriate or compare a higher plan with metered billing.
Claude cannot access a tool
Check whether the executable exists, the account is authenticated and permissions allow it. Do not bypass a security control merely to make the demonstration work.
Frequently asked questions
Is Claude Code an IDE?
No. It is an agentic coding tool available through terminals, IDE integrations, desktop and web. It works with an existing development environment rather than replacing every IDE function.
Does Claude Code work on Windows?
Yes. Anthropic documents native Windows installers, WinGet and WSL support.
Can Claude Code build a complete app?
It can build substantial applications, but “complete” still requires product decisions, architecture, tests, security, deployment and maintenance. Start in reviewable increments.
Can Claude Code access the internet?
It can use network access and connected tools when the environment and permissions allow it. Restrict domains and credentials according to the task.
Does Claude Code upload my repository?
The tool sends relevant context to the configured model service. Anthropic says it does not require a separate remote code index, but that is not the same as keeping all code entirely local. Review the data terms for the authentication route.
Is Claude Code safe?
It provides permissions and sandboxing, but it can still produce insecure code or take an unintended permitted action. Use isolation, least privilege, version control, tests and human review.
Which Claude model is best for Claude Code?
Sonnet is a strong balance for normal development, Opus for difficult engineering and Fable for the hardest long-running work. Availability and plan behavior vary. Test cost per accepted change.
Bottom line
Claude Code is most valuable when it receives a bounded engineering outcome and can inspect, implement and verify it inside a real project. Its power comes from access to tools, not only code generation.
Use Plan mode, CLAUDE.md, focused tests, readable diffs, permissions, sandboxing and version control. The agent can perform more of the implementation loop; the engineer still decides what should be built and what is safe to ship.