Claude Code Basics: Installation, Permissions, Models, and Context Management

This guide explains Claude Code step by step, from installation and first launch to permission modes, model selection, context cleanup, and writing CLAUDE.md. It also corrects oversimplified information about permissions and costs in the source material based on the official documentation.

Claude Code is an agentic development tool that lets you use Anthropic's Claude in the terminal and code repositories. Rather than merely answering with code snippets, it can explore and edit files, run commands, execute tests, and analyze errors within the permitted scope.

This guide explains not only the installation process, but also how to configure permissions safely, how to choose the right model for a task, and how to manage context and project instructions. Commands and supported environments may be updated, so when installing, check the latest commands shown in the official setup documentation.

Three Ways to Code with Claude

The key difference between these approaches is not the output, but the extent to which the tool interacts with the local project.

Approach Local file access Command execution Suitable tasks Main limitations
Claude web Limited by default Unavailable by default Questions, code explanations, short examples, design reviews Requires copying and running responses to apply them directly to the project
Claude desktop app Varies by feature, integration, and user approval Varies by feature and integration Document work, conversation-based tasks, supported local integrations Does not automatically control repositories and shells in every installation environment
Claude Code Available within the project scope Available according to permission policies Editing actual repositories, testing, refactoring, long-term projects Requires review and security configuration because it handles shell and file permissions

Claude Code is not only for professional developers. However, because it can perform tasks that affect the system, such as deleting files, installing dependencies, and running build scripts, beginners in particular should use Plan mode together with version control.

Prerequisites

Prepare the following first.

On Windows, check the PowerShell, Command Prompt, or WSL requirements provided in the official documentation. If the computer is managed by an organization, first review installation permissions, proxy settings, firewall rules, and data-handling policies.

Installing and Launching Claude Code

1. Check the Official Installation Command

Select the latest installation method for your operating system from the official Claude Code setup documentation. Installation methods and commands may change, so use the official documentation as your source rather than reusing commands from outdated videos or blog posts.

2. Open the Project Folder

Create a new folder or navigate to an existing repository. If you use VS Code, open the folder with File > Open Folder, then select Terminal > New Terminal.

cd path/to/project
claude

When you run claude, a browser authentication process may appear if needed. After you log in, Claude Code examines the project based on the current working directory. Therefore, it is safer to run it from the actual repository root rather than your home directory or an overly broad parent folder.

3. Start Small with the First Request

Rather than asking it to build an entire application from the outset, divide the work into steps like these.

  1. Ask it to read and summarize the project structure.
  2. Ask it to present an implementation plan and the files to be changed.
  3. Ask it to implement only one feature.
  4. Ask it to run tests or static analysis.
  5. Ask it to explain the changes and remaining risks.

Example request:

Read this repository and summarize its structure and how to run it. Do not modify any files yet.
Only propose a plan for adding a login form and the files that would need to change.

Permission Modes and Safe Configuration

The wording shown for Claude Code's permission modes may vary by version and settings screen. The main mode concepts used in the official configuration are as follows.

Mode Behavior Recommended use
Default Requests approval as needed when editing files or running potentially risky tools General day-to-day work
Accept Edits Automatically allows file edits, though separate approval may still apply to other tools Development work where changed files are tracked with Git
Plan Focuses on analysis and planning without editing files or running commands Understanding repositories, reviewing designs, and a beginner's first step
Don't Ask A non-interactive policy that rejects operations not approved in advance instead of asking about them Automation environments or when using strict allowlists
Bypass Permissions Bypasses permission checks Avoid except in environments where risks are controlled, such as isolated containers

Shift+Tab may be used to switch between some permission states provided in the interactive interface. However, not all settings necessarily cycle using this shortcut alone, so check the status shown on the current screen and the official permission documentation.

Recommended Workflow for Beginners

  1. Receive an implementation plan in Plan mode.
  2. Review the files to be changed and the commands to be run.
  3. Implement in Default or Accept Edits mode.
  4. Manually review package installations, database changes, and deletion commands.
  5. Review git diff and test results before committing.

Bypass Permissions is not merely a convenient high-speed mode. It can amplify the harm caused by incorrect commands, excessive file access, or exposure of secrets, so do not use it as the default on a personal computer or in an important repository.

Model Selection and Cost Management

In an interactive session, you can use /model to view or change the models available for your account and environment. Model names, aliases, and availability may vary by time and authentication method, so it is better not to build automation around a fixed model list.

/model

General selection principles are as follows.

Task type Selection criteria
Architecture design, difficult debugging, complex reasoning Consider a higher-performance model first
General implementation, test writing, repetitive development Consider a model with a good balance of performance and speed
Simple searches, format conversions, minor edits If supported by your account, consider a faster and more economical model

Opus, Sonnet, and Haiku are names that distinguish model families, but the exact versions in each family and their availability in Claude Code may continue to change. Some environments may support aliases such as /model sonnet, but checking the options displayed in the current session is the most accurate approach.

Practical Ways to Reduce Costs

The cost structure varies depending on the login method. Claude subscription accounts may have plan-specific usage limits, while usage through the Anthropic API or cloud providers may be billed by token. Therefore, do not assume that a particular model is always free or always costs a fixed amount.

Managing the Context Window

The context window is the range of conversations, file contents, tool results, project instructions, and other information that the model can reference when generating the current response. It is not the same as permanent memory or simply the character count of the conversation.

Main Commands

Command Purpose Caution
/context Check the composition of context usage The display format may vary by version
/compact Summarize the current conversation to free up context space Details may be condensed during summarization
/clear Clear the current conversation history and start a new conversation First record necessary decisions and work status in a document

There is no universal threshold at which response quality necessarily declines once context usage exceeds a certain percentage. Claude Code may perform automatic compaction, and quality is affected not only by the amount of information included, but also by its relevance, redundancy, and conflicts.

Consider cleaning up the context if you notice the following signs.

You do not need to run /clear every time you finish a feature. Instead, you can reduce information loss by recording completed decisions, unresolved items, and test results in project documentation or work logs before moving to a new session.

Managing Project Instructions with CLAUDE.md

The filename is generally written as CLAUDE.md, including uppercase letters. This file is not Claude's permanent memory, but a persistent instruction document that Claude Code references within the project. Including it in the repository lets you share instructions with team members, but sensitive information must not be recorded in it.

You can use the /init command to analyze the project and begin creating an initial CLAUDE.md, but the result must be reviewed by a person.

Recommended Content

Example:

# Project instructions

## Stack
- Use TypeScript and Node.js.
- The package manager is pnpm.

## Commands
- Tests: `pnpm test`
- Lint: `pnpm lint`
- Build: `pnpm build`

## Rules
- Do not read or commit `.env` or actual credentials.
- Present a plan before changing the response format of a public API.
- Add relevant tests for feature changes.

There is no official maximum limit of 200 lines for CLAUDE.md. However, overly long instructions can consume context and create conflicts between rules, so it is practical to keep them brief and specific. Separate detailed design explanations into other documents and provide the relevant paths.

Recommended Workflow

The following basic procedure improves both safety and output quality.

  1. Confirm that the Git status is clean and create a backup or commit.
  2. Run Claude Code from the repository root.
  3. Review CLAUDE.md and existing documentation.
  4. In Plan mode, obtain the goal, files to modify, and test plan.
  5. Divide large tasks into small, reviewable units.
  6. Implement one unit at a time in Default or Accept Edits mode.
  7. Manually review commands that install, delete, deploy, or modify data.
  8. Check tests, linting, type checks, and git diff.
  9. Document the completion status and remaining issues.
  10. If the next task is unrelated to the previous conversation, start a new session with /clear.

Security Checklist

Claude Code can significantly shorten the development process, but it is not an automatic safeguard that guarantees the accuracy and safety of results. The most reliable approach combines clear instructions, limited permissions, small units of change, automated tests, and human review.

FAQ

Is VS Code required to use Claude Code?

No. Using VS Code's integrated terminal is convenient, but it is not required. If you have an operating system and terminal environment supported by the official documentation, you can run claude from the project directory.

What is the biggest difference between Claude on the web and Claude Code?

Claude on the web mainly provides conversations and code responses, while Claude Code can read and modify actual project files and run terminal tools within the permitted scope. This makes it more productive, but file and command permissions must be managed carefully.

Which permission mode should beginners start with?

A safe workflow is to first review the change plan and target files in Plan mode, then implement the changes in Default or Accept Edits mode. It is best not to automatically approve tasks such as installing packages, deleting files, or modifying databases.

Does Don't Ask mode automatically execute every task?

No. Don't Ask is generally a policy that rejects tasks that have not been pre-approved rather than asking the user for permission. It should be distinguished from Bypass Permissions, which bypasses all permission checks.

How do I change the model in Claude Code?

In an interactive session, enter /model to view and select the models available for your current account and environment. Model versions and aliases may change, so use the current menu as your reference rather than an outdated list.

Does using Sonnet always cost the least?

Not always. Cost depends not only on the model's pricing but also on the input context, output length, number of retries, cache usage, and authentication and billing methods. A more economical model may be better for simple tasks, but for difficult tasks, a higher-performing model may reduce rework and lower the overall cost.

What is the difference between /clear and /compact?

/clear is used to erase the current conversation history and start as if it were a new session. /compact summarizes the existing conversation to free up context space, but some details may be condensed during the summarization process.

Does response quality necessarily decline when context usage exceeds 80%?

There is no universal official threshold like that. In addition to the usage percentage, quality is affected by the relevance, repetition, and conflicts of information, as well as the size of tool outputs. It is reasonable to monitor the status with /context and clean it up when signs appear, such as confusion over old requirements.

Which filename is correct, claude.md or CLAUDE.md?

The project instructions file is written as CLAUDE.md in the official documentation. Because some operating systems and tools are case-sensitive, it is safest to use the official capitalization exactly as shown.

Does CLAUDE.md have to be at most 200 lines?

There is no official maximum limit of 200 lines. However, long instructions use more context and may cause rule conflicts, so it is best to state the key commands and constraints concisely and put detailed explanations in separate documents.

Can I put API keys or passwords in CLAUDE.md?

No. CLAUDE.md may be committed to the repository and shared with the team, so actual credentials, customer data, and secret keys should not be recorded in it. Secrets should be managed using environment variables or secret management systems approved by the organization.

When should I use Bypass Permissions?

It should be considered carefully only in controlled environments, such as isolated containers or disposable sandboxes, where harm caused by bypassing permissions can be limited. It is advisable not to use it as the default mode on personal computers, in important repositories, or in production environments.

Sources

Images

Illustration of a coding laptop, file tree, permission shield, and connected workflow
Illustration of a coding laptop, file tree, permission shield, and connected workflow
Central server linked to code, permission lock, workflow, documents, databases, and cloud services
Central server linked to code, permission lock, workflow, documents, databases, and cloud services