Learn how to install, authenticate, and use Claude Code in your terminal. This guide covers setup, first sessions, essential commands, advanced features, and community tools.
This guide covers everything you need to start using Claude Code in your terminal, from installation and authentication to running your first coding sessions. It is written for developers who want an AI-powered coding assistant that reads your codebase, edits files, runs commands, and integrates with your development tools directly from the command line.
Before you begin, make sure you have the following:
Claude Code runs on several surfaces: the terminal CLI, VS Code and JetBrains IDE extensions, a desktop app, and the web. This guide focuses on the terminal CLI, which is the full-featured command-line interface for working with Claude Code directly in your terminal. The terminal CLI also supports third-party providers.
Claude Code is an agentic coding tool. It reads your codebase, edits files, runs commands, and integrates with your development tools. It understands your entire codebase and can work across multiple files and tools to get things done. The official documentation describes it as an AI-powered coding assistant that helps you build features, fix bugs, and automate development tasks.
Under the hood, Claude Code uses a custom terminal renderer built with React. According to a technical analysis published on Dev.to, this is not a simple novelty renderer. It is a full rendering engine built around React's reconciliation engine. React handles state updates, component lifecycle, effects, and reconciliation. A custom renderer handles layout using Yoga (a cross-platform layout engine), painting into a screen buffer, diffing against the previous frame, compiling terminal patches, and flushing a single buffered terminal write. This separation is the main architectural idea. React gives the codebase a clean component model and update system. The renderer keeps control over layout cost, paint cost, write volume, and output correctness.
The renderer uses terminal-specific host elements such as ink-root, ink-box, ink-text, and ink-raw-ansi. It does not try to recreate the browser. Terminal events are classified before they reach React scheduling: discrete events (keydown, click, focus, paste) get immediate response, continuous events (resize, scroll, mousemove) are handled differently, and default events cover everything else. This event-priority bridge is important for keeping keyboard interactions responsive while high-frequency event streams remain stable.
The screen buffer uses packed typed arrays (Int32Array for character, style, hyperlink, and width data, with BigInt64Array for fast bulk clears and fills) and intern pools (CharPool, HyperlinkPool, StylePool) to avoid repeated allocations. The StylePool caches transition strings between style IDs, so style changes do not have to repeatedly compute ANSI transitions. Diffing is damage-aware instead of full-screen by default, tracking damage bounds for each frame and focusing work on changed regions. It also uses blitting (copying cells from the previous frame) when a subtree is clean and its layout has not changed, with explicit guards that disable blit paths when overlays, removals, or absolute positioning could cause stale cells to be restored.
This technical depth matters for long-running sessions. The renderer is designed to stay correct over repeated updates, mounts, unmounts, focus changes, resizes, and scrolling. Yoga references are cleared before frees. Removed nodes trigger focus cleanup. Pool growth is controlled with resets and ID migration. Terminal modes are restored synchronously on unmount and exit.
Claude Code can be installed using several methods. The recommended approach is the native install, which automatically updates in the background to keep you on the latest version.
For macOS, Linux, and Windows Subsystem for Linux (WSL), run this command in your terminal:
curl -fsSL https://claude.ai/install.sh | bash
For Windows PowerShell, run:
irm https://claude.ai/install.ps1 | iex
For Windows CMD, run:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
If you see the error The token '&&' is not a valid statement separator, you are in PowerShell, not CMD. If you see 'irm' is not recognized as an internal or external command, you are in CMD, not PowerShell. Your prompt shows PS C:\ when you are in PowerShell and C:\ without the PS when you are in CMD. If the install command fails with syntax error near unexpected token ', consult the installation troubleshooting guide to match the error to a fix and for alternative install methods.
Git for Windows is recommended on native Windows so Claude Code can use the Bash tool. If Git for Windows is not installed, Claude Code uses PowerShell as the shell tool instead. WSL setups do not need Git for Windows.
brew install --cask claude-code
Homebrew offers two casks. claude-code tracks the stable release channel, which is typically about a week behind and skips releases with major regressions. claude-code@latest tracks the latest channel and receives new versions as soon as they ship. Homebrew installations do not auto-update. Run brew upgrade claude-code or brew upgrade claude-code@latest, depending on which cask you installed, to get the latest features and security fixes.
winget install Anthropic.ClaudeCode
WinGet installations do not auto-update. Run winget upgrade Anthropic.ClaudeCode periodically to get the latest features and security fixes.
You can also install with apt, dnf, or apk on Debian, Fedora, RHEL, and Alpine. The official documentation does not provide the exact commands for these package managers, but they are available as alternative install methods.
To confirm the installation worked, run:
claude --version
The command prints a version number followed by (Claude Code).
Claude Code requires an account to use. Start an interactive session with the claude command and you will be prompted to log in on first use:
claude
For Claude subscription or Console accounts, follow the prompts to complete authentication in your browser. To switch accounts later or re-authenticate, type /login inside the running session:
/login
You can log in using any of these account types:
/login opens directly on the Cloud gateway screen for you to sign in with corporate SSOOnce logged in, your credentials are stored on your system and you will not need to log in again.
Open your terminal in any project directory and start Claude Code:
cd /path/to/your/project
claude
Replace /path/to/your/project with the path to the project you want to work on. You will see the Claude Code prompt with the version, current model, and working directory shown above it. Type /help for available commands or /resume to continue a previous conversation.
Once the session starts, you can ask Claude to analyze your codebase. Try one of these commands:
what does this project do?
Claude will analyze your files and provide a summary. You can also ask more specific questions:
what technologies does this project use?
where is the main entry point?
explain the folder structure
You can also ask Claude about its own capabilities:
what can Claude Code do?
how do I create custom skills in Claude Code?
can Claude Code work with Docker?
Claude Code reads your project files as needed. You do not have to manually add context.
Now let us make Claude Code do some actual coding. Try a simple task:
add a hello world function to the main file
Claude Code will:
Whether Claude Code asks before changing files depends on your permission mode. In default mode, Claude asks for approval before each change. Press Shift+Tab to cycle through modes: acceptEdits auto-approves file edits, and plan lets Claude propose changes without editing. Some accounts also have an auto mode that runs a background safety check and blocks risky actions, returning to prompts only after repeated blocks.
Claude Code makes Git operations conversational:
what files have I changed?
commit my changes with a descriptive message
You can also prompt for more complex Git operations:
create a new branch called feature/quickstart
show me the last 5 commits
help me resolve merge conflicts
Claude is proficient at debugging and feature implementation. Describe what you want in natural language:
add input validation to the user registration form
Or fix existing issues:
there's a bug where users can submit empty forms - fix it
Claude Code will:
Here are some common tasks you can accomplish with Claude Code:
refactor the authentication module to use async/await instead of callbacks
write unit tests for the calculator functions
update the README with installation instructions
review my changes and suggest improvements
Talk to Claude like you would a helpful colleague. Describe what you want to achieve, and it will help you get there.
Here are the most important commands for daily use. Shell commands run from your terminal to start or resume Claude Code. Session commands run inside Claude Code after it starts.
| Command | What it does | Example |
|---|---|---|
claude | Start interactive mode | claude |
claude "task" | Run a one-time task | claude "fix the build error" |
claude -p "query" | Run one-off query, then exit | claude -p "explain this function" |
claude -c | Continue most recent conversation in current directory | claude -c |
claude -r | Resume a previous conversation | claude -r |
| Command | What it does | Example |
|---|---|---|
/clear | Clear conversation history | /clear |
/help | Show available commands | /help |
/exit or Ctrl+D twice | Exit Claude Code | /exit |
See the CLI reference for the complete list of shell commands and the commands reference for the complete list of session commands.
For more, see best practices and common workflows.
Instead of: "fix the bug" Try: "fix the login bug where users see a blank screen after entering wrong credentials"
Break complex tasks into steps:
1. create a new database table for user profiles
2. create an API endpoint to get and update user profiles
3. build a webpage that allows users to see and edit their information
Before making changes, let Claude understand your code:
analyze the database schema
build a dashboard showing products that are most frequently returned by our UK customers
/ to see all commands and skillsShift+Tab to cycle permission modes
Claude Code is composable and follows the Unix philosophy. Pipe logs into it, run it in CI, or chain it with other tools:
# Analyze recent log output
tail -200 app.log | claude -p "Slack me if you see any anomalies"
# Automate translations in CI
claude -p "translate new strings into French and raise a PR for review"
# Bulk operations across files
git diff main --name-only | claude -p "review these changed files for security issues"
Claude Code can handle tedious tasks that eat up your day: writing tests for untested code, fixing lint errors across a project, resolving merge conflicts, updating dependencies, and writing release notes.
claude "write tests for the auth module, run them, and fix any failures"
Claude Code works directly with git. It stages changes, writes commit messages, creates branches, and opens pull requests.
claude "commit my changes with a descriptive message"
In CI, you can automate code review and issue triage with GitHub Actions or GitLab CI/CD.
The Model Context Protocol (MCP) is an open standard for connecting AI tools to external data sources. With MCP, Claude Code can read your design docs in Google Drive, update tickets in Jira, pull data from Slack, or use your own custom tooling. The MCP quickstart connects your first server end to end.
CLAUDE.md is a markdown file you add to your project root that Claude Code reads at the start of every session. Use it to set coding standards, architecture decisions, preferred libraries, and review checklists. Claude also builds auto memory as it works, saving learnings like build commands and debugging insights across sessions without you writing anything. Create skills to package repeatable workflows your team can share, like /review-pr or /deploy-staging. Hooks let you run shell commands before or after Claude Code actions, like auto-formatting after every file edit or running lint before a commit.
Spawn multiple Claude Code agents that work on different parts of a task simultaneously. A lead agent coordinates the work, assigns subtasks, and merges results. To run several full sessions in parallel and watch them from one screen, use background agents. For fully custom workflows, the Agent SDK lets you build your own agents powered by Claude Code tools and capabilities, with full control over orchestration, tool access, and permissions.
Run Claude on a schedule to automate work that repeats: morning PR reviews, overnight CI failure analysis, weekly dependency audits, or syncing docs after PRs merge.
/schedule in the CLI./loop repeats a prompt within a CLI session for quick polling.Sessions are not tied to a single surface. Move work between them as your context changes:
claude --teleport. Teleport requires a claude.ai subscription./desktop to continue your current terminal session in the Desktop app, where you can review diffs visually. Available on macOS and x64 Windows.@Claude in Slack with a bug report and get a pull request back.
A developer named Hamed Farag built a browser-based UI for Claude Code called Claudeck. According to his Dev.to article, it started as a quick experiment on March 1st, 2026, and grew into a full-featured browser UI with 50+ features in 15 days. It is published on npm and can be launched with a single command:
npx claudeck
Claudeck connects to the official Claude Code SDK running on your machine. Your API key, your local files, and your git repos stay local. Nothing goes through a third-party server. It is a local web app that gives Claude Code a visual interface.
Key features of Claudeck include:
.claude/commands/ and .claude/skills/ from your project directory.~/.claudeck/plugins/my-plugin/ with a client.js and optionally a server.js, and it appears in the marketplace. Built-in plugins include Linear integration, a todo list with brag tracking, and games.Claudeck is built with vanilla JavaScript ES modules, Express, WebSocket, better-sqlite3, web-push, dotenv, and the Claude Code SDK. That is six npm dependencies. No React, no Vue, no Svelte, no bundler, no build step. Everything is local. No cloud, no accounts, no telemetry. Your data lives in ~/.claudeck/.
Claudeck does have limitations:
According to the developer, Claudeck is for solo developers who use Claude Code daily and want visibility into costs, reusable workflows, and a visual interface without leaving the browser. It is also for developers who work AFK and want to approve tool calls from their phone, power users who want parallel conversations and agent pipelines, and teams evaluating Claude Code who need cost analytics to justify the spend.
If the install command fails with syntax error near unexpected token ', you may be running the wrong shell. Check whether you are in PowerShell or CMD on Windows. Your prompt shows PS C:\ when you are in PowerShell and C:\ without the PS when you are in CMD. Use the correct command for your shell.
If you see The token '&&' is not a valid statement separator, you are in PowerShell, not CMD. Use the PowerShell command instead.
If you see 'irm' is not recognized as an internal or external command, you are in CMD, not PowerShell. Use the CMD command instead.
If you need to switch accounts or re-authenticate, type /login inside the running session.
If Claude Code is not asking for approval before changes, you may be in acceptEdits mode. Press Shift+Tab to cycle through modes. In default mode, Claude asks for approval before each change. In plan mode, Claude proposes changes without editing. Some accounts have an auto mode that runs a background safety check and blocks risky actions.
If you lose your place in a conversation, use claude -c to continue the most recent conversation in the current directory, or claude -r to resume a previous conversation.
According to the technical analysis of Claude Code terminal renderer, the renderer is designed to handle long-running sessions with strict lifecycle control. If you experience visual artifacts or performance degradation over time, it may be related to terminal mode restoration or pool growth. The renderer restores terminal modes synchronously on unmount and exit, and controls pool growth with resets and ID migration. If issues persist, try restarting the session with /clear or exiting and restarting Claude Code.
Once you have installed Claude Code and completed the quickstart, explore these advanced features:
For community support, join the Claude Code Discord for tips and support. You can also explore community-built tools like Claudeck for a browser-based UI with cost tracking, parallel conversations, and Telegram integration.
If you want to understand the technical underpinnings of Claude Code terminal renderer, study the architecture: React handles reconciliation and the component model, while the custom renderer handles layout, painting, diffing, scheduling, memory behavior, terminal patch generation, and output correctness. The renderer uses damage-aware diffing, selective blitting, terminal-native scroll acceleration, and packed typed arrays for the screen buffer. These design choices make the terminal UI feel fast, stable, and predictable even over long sessions.
Learn how to run Claude Code in CI/CD pipelines without interactive prompts. Covers authentication, permission configuration, GitHub Actions and GitLab CI integration, and troubleshooting common issues.
Learn how to install, configure, and start using Claude Code to automate desktop tasks, fix bugs, manage Git workflows, and build features directly from your terminal, IDE, or desktop app.
Complete guide to Claude Code settings, permissions, and configuration scopes. Learn how to manage user, project, local, and managed settings, use the /config command, and handle invalid entries.
Learn to use the Claude Message Batches API for cost-effective, high-throughput processing of multiple prompts. Covers setup, batch creation, monitoring, result retrieval, and troubleshooting with practical examples.
Learn how to connect Claude Code to your database using the Model Context Protocol (MCP). This guide covers setup, configuration, querying, and advanced usage with real-world examples.
Learn how to set up Claude Code with GitHub Actions for automated code review, issue triage, and CI/CD workflows. Covers workflow configuration, authentication, CLI flags, and best practices.
Workflows from the Neura Market marketplace related to this Claude resource