Getting Started with Claude Code: An AI Coding Assistant from Your Terminal

AI Navigate Original / 3/24/2026

💬 OpinionDeveloper Stack & InfrastructureTools & Practical Usage
共有:

Key Points

  • Claude Code is a terminal-first AI coding assistant that can support the entire development workflow consistently—from understanding the whole codebase to making multi-file changes and running tests.
  • After installation, start it in your project root, and give a clear description of the tech stack, goals, and constraints upfront to improve accuracy.
  • In real work, ask in the order of “research → plan → implement → verify,” and it’s effective to explicitly include instructions to run test, lint, and typecheck.
  • By consolidating commands, conventions, “do not edit” areas, and development rules in CLAUDE.md, you can reduce repeated explanations and make team operations smoother.
  • While GitHub Copilot is strong at IDE inline completion, Claude Code is better suited for task-based work such as investigation, refactoring, and diff review.

What Is Claude Code?

Claude Code is an AI coding assistant you can use directly from the terminal. It’s not limited to editor autocomplete—it can read and help you understand the entire repository, make changes that span multiple files, run tests and Linters, and fix issues while reviewing Git diffs. In other words, it can integrate deeply into the whole development flow.

If you think of it not as an “AI that completes code one line at a time,” but as a CLI agent that moves development tasks forward through conversation, the concept becomes easier to grasp. It’s especially well-suited for maintaining existing projects, refactoring, debugging and root-cause analysis, and adding tests.

Installation and Initial Setup

As of 2025, Claude Code is available as a CLI provided by Anthropic. While the detailed steps may vary by OS or distribution method, the basic flow is the same.

Basic installation steps

  • Set up an Anthropic account
  • Install the CLI
  • Authenticate
  • Start it from within the Git repository you want to work on
# Example: Install the CLI (please follow the distribution instructions for the actual command)
claude --version

# Authentication
claude login

# Move to the project
cd my-app

# Start an interactive session
claude

The key tip is to start it in the project root where files like package.json / pyproject.toml / go.mod exist, not in an empty directory. This helps Claude quickly understand the project structure.

What you should tell it first

Once it’s running, don’t jump straight to “fix this.” Providing the working context first will improve accuracy.

This repository is an internal dashboard for Next.js + TypeScript.
Auth.js is used for authentication, Prisma for the database, and shadcn/ui for the UI.
First, summarize the structure. Then summarize the main entry points and the flow of data fetching.
After that, list what should be checked before making any changes.

Basic Commands and How to Use

The practical strength of Claude Code is that it can handle conversation, file operations, and command execution as a single continuous workflow. Natural-language instructions are the focus in the CLI, but you’ll also want to understand session management and approval concepts to use it comfortably.

Common scenarios

  • Organize bug reproduction steps and have it propose fixes
  • Progress changes across multiple files all at once
  • Have it track down why tests are failing
  • Have it summarize Git diffs and draft commit messages
Please investigate this bug.
Symptoms: After saving in the admin screen, the list does not update.
Expected: After a successful save, the latest data should be displayed.
First, identify the related files and narrow the likely causes down to three.
Before applying any fixes, also show the commands needed to reproduce the issue.

The key is to follow “research → plan → implement → verify” instead of ordering implementation immediately. Doing this alone can reduce unnecessary changes significantly.

How to Make It Understand the Entire Codebase

Claude Code’s strength is thinking in terms of the relationships across the whole repository—not just a single file. However, if you give no guidance, the exploration scope becomes too large, so it’s important to provide an entry point.

Recommended first request

I want you to understand this codebase. Proceed in the following order.
1. Summarize the directory structure
2. Identify the files related to starting the app
3. Organize how API/DB/authentication/UI connect
4. Point out parts that are likely to break when changes are made
5. Provide a list of files to read when adding a new feature

Additionally, encouraging it to prioritize README, docs, package.json, CI settings, and test settings helps reduce misunderstandings.

Before describing this project’s development flow, please read in priority:
README.md, CLAUDE.md, package.json, .github/workflows, and the test configuration.

Tips for large repositories

  • Limit the target directories (e.g., src/features/billing)
  • First ask for only an architecture summary
  • Separate “areas that may be changed” from “areas that are read-only”

Multi-File Edits and Running Tests

Claude Code is well-suited for modifications that span related files. For example, if you want to change an API response type, it can update everything in a chain: type definitions, server implementation, UI display, and tests.

I want to add `discountAmount` to the response of the Orders API.
Update the following as needed.
- API type definitions
- Server implementation
- Front-end display
- Tests
After the changes, run tests and type checks. If anything fails, fix it.

By explicitly listing the files/areas to change in bullet form, you can reduce omissions.

Ask it to include verification

Don’t stop at implementation—please do the following in order.
1. Summarize the changes
2. Run the tests
3. Run lint / typecheck
4. Analyze the causes if anything fails
5. Explain the final diff

The value of a CLI-style AI is that it can run verification commands on your local setup, not just help you “write.” Especially for changes to existing code, it’s practical to request test and type-check coverage.

What You Can Do with Git Integration

Claude Code works very well with Git and helps you understand what’s happening before and after changes. For instance, you can have it read your current diffs for review, or summarize the intent of your most recent commits.

Check the current git diff and organize:
- What was changed
- Areas with risk
- Tests that should be added
Look at the most recent 5 commits and summarize the purpose of this branch’s changes.
Then confirm whether this change aligns with the existing approach.

Before committing, these kinds of requests are also useful:

For this diff, propose three commit message candidates in the Conventional Commits format.
Include Japanese explanations as well.

However, destructive operations like rebase, reset, or force push should not be delegated entirely to AI—have humans review and perform them safely.

Improve Accuracy by Using CLAUDE.md

CLAUDE.md is an operations file used to tell Claude Code how it should behave in this repository. Think of it as a project-specific set of working rules.

High-impact items to include

  • Tech stack and directory structure
  • Test / lint / typecheck commands to run
  • Coding conventions
  • Areas that may be touched vs. areas that must be handled carefully
  • Rules for PRs and commits
# CLAUDE.md
## Project overview
- Next.js 15 / TypeScript / Prisma
- UI is `src/components`, business logic is `src/features`

## Commands
- dev: `pnpm dev`
- test: `pnpm test`
- lint: `pnpm lint`
- typecheck: `pnpm tsc --noEmit`

## Rules
- Prefer existing naming conventions
- Do not manually edit `src/generated`
- When changing the DB schema, update migrations and tests together
- After implementing, run lint, test, and typecheck in that order

Because you won’t have to repeat the same explanations every time, CLAUDE.md is extremely well-suited for team operations. Especially in large projects, the value of an “AI-oriented practical rules” file like CLAUDE.md grows more than that of the README alone.

Differences from GitHub Copilot

Claude Code and GitHub Copilot aren’t direct competitors so much as they have slightly different strengths.

AspectClaude CodeGitHub Copilot
Main place of useTerminal-firstIDE-first
What it’s good atUnderstanding the codebase, multi-file changes, verification workflowsAutocomplete while typing, inline suggestions, lightweight editing
Working styleProgress tasks through conversationAssists sequentially while editing
Maintaining existing workStrongAutocomplete-centered
Best suited scenariosInvestigation, refactoring, adding tests, diff reviewsNew implementation, boilerplate code generation, small completions

Intuitively, Copilot is a “buddy while you’re writing”, while Claude Code is a “worker who helps you push a task forward”. Using both together makes it easier to divide responsibilities—for example, Copilot in the IDE for inline help, and Claude Code for investigations and broad changes.

Prompt Examples That Reduce Failures in Real Work

You are the maintainer for this repository.
First investigate the current situation and propose a plan before implementing.
Keep changes minimal and prioritize existing conventions.
After implementation, run test, lint, and typecheck, and summarize the results.
List the files that will be affected by this feature addition and propose an order to make the changes.
Don’t edit immediately—first outline the risks and what should be confirmed.

For beginners in particular, stabilizing results by fixing these three points in a template—“first investigate,” “keep changes minimal,” “verify at the end”—tends to work well.

Summary

Claude Code is a practical tool for delegating development tasks to an AI from your terminal. It shines especially in understanding the entire codebase, multi-file editing, running tests, reading Git diffs, and optimizing operations with CLAUDE.md.

As a first step, it’s enough to ask your existing repository to “summarize the structure,” “find related files,” and “run tests after changes.” Try the development experience unique to a CLI agent, which is different from an autocomplete-focused assistant.