$ man how-to/claude-code-quickstart
CLI Toolsbeginner
Claude Code Quickstart
Install Claude Code and run your first terminal agent session
What Claude Code Is
Claude Code is a terminal-based AI agent. No GUI. No editor. Just your terminal and Claude. You type a task, Claude reads your files, writes code, runs commands, and builds things. It lives in your terminal alongside git, npm, and every other CLI tool you use. The advantage over an IDE-based agent: Claude Code operates at the repo level. It is not scoped to a single file or a single editor tab. It sees your entire project and works across files naturally. The disadvantage: no visual editor, no inline diffs, no click-to-accept. Everything happens through text. For some workflows, that is a feature. For others, you want the IDE. That is why Claude Code inside Cursor exists.
CODE
Installation
Install Claude Code globally via npm:
npm install -g @anthropic-ai/claude-code
If you hit permission errors on Mac, fix ownership first:
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
Then run the install again without sudo. After installation, run hash -r to clear the shell cache, or open a new terminal. Verify with: claude --version.
On first launch, Claude Code will prompt you to authenticate with your Anthropic account. Follow the browser flow. Once authenticated, you are ready. Navigate to any project folder and type claude to start a session.
PATTERN
Your First Session
Navigate to your project folder. Type claude. You are now in an interactive session. Claude can see every file in the current directory and subdirectories.
Try: "Read the README and summarize what this project does." Claude will read the file and give you a summary. That verifies it can see your project.
Try: "Create a Python script called hello.py that prints the current date and time." Claude will create the file and write the code. You can run it with python hello.py.
Try: "What files are in this project and how are they organized?" Claude will scan the directory tree and describe the structure. This is useful when you are exploring an unfamiliar codebase.
The interaction model: you describe intent, Claude executes. You review output, Claude adjusts. Each task builds on the context of the session.
PRO TIP
CLAUDE.md for CLI Sessions
Create a CLAUDE.md file in your project root. Claude Code reads this file at the start of every session. Put your environment defaults here: OS, shell, primary languages, package management rules, code style preferences. Keep it short. Under 50 lines. Everything in CLAUDE.md consumes context window space for the entire session.
You can also create a ~/.claude/CLAUDE.md for global defaults that apply to every project. Project-level CLAUDE.md overrides global settings. This lets you set universal preferences (language defaults, git rules) globally while keeping project-specific settings in each repo.
PATTERN
Shift+Tab: Plan Before You Execute
Press Shift+Tab in a Claude Code session to toggle between plan mode and execution mode. Plan mode is read-only. Claude explores, reads files, and maps out steps without changing anything. Execution mode is where Claude actually writes files and runs commands.
The workflow: start in plan mode for complex tasks. Let Claude analyze the codebase, identify the files involved, and propose a step-by-step plan. Review the plan. If it looks right, switch to execution mode and tell Claude to proceed. If it looks wrong, adjust the plan before any code gets written.
This is the single most underused feature of Claude Code. People jump straight to execution and wonder why Claude makes wrong assumptions. Plan mode prevents those assumptions by forcing exploration before action.
knowledge guide
related guides