Basic Usage
Learn the everyday Claude Code workflow: start a session, inspect a project, plan safely, edit code, run checks, and resume work.
Claude Code works best when you treat it as an agent inside your repository, not as a generic chatbot. Start with a focused project, ask it to inspect before editing, review the plan, then let it make small changes that you can verify with your normal commands.
Start A Session
Open a terminal in your project root and start an interactive session:
claudeYou can also start with an initial prompt:
claude "explain this project structure"For one-off command-line usage, use print mode:
claude -p "summarize the last 20 commits"Use claude auth status if you need to confirm whether the CLI is signed in before starting a longer task.
First Prompt In A New Project
The first prompt should build context instead of asking Claude Code to edit immediately:
Inspect this repository and explain the app structure, main routes, build commands, and risky areas. Do not edit files yet.After that, narrow the scope:
Find the files involved in the login flow and explain how data moves from the UI to the backend.This creates a better base for later implementation prompts and avoids sending Claude into unrelated parts of the codebase.
The Daily Workflow
| Step | What to ask | Why it matters |
|---|---|---|
| Explore | "Find the files that control this feature." | Keeps the task grounded in the real project. |
| Plan | "Propose a small implementation plan first." | Lets you review the approach before edits. |
| Edit | "Implement step 1 only and keep the diff small." | Makes changes easier to review and roll back. |
| Verify | "Run the existing checks and fix only failures." | Uses the project's own quality gate. |
| Summarize | "Summarize changed files, tests, and risks." | Gives you a useful handoff for review or commit. |
For higher-risk work, switch to Plan Mode before editing:
claude --permission-mode planInside an interactive session, you can also use /plan or cycle permission modes with Shift+Tab when your environment supports it.
Useful Interactive Commands
Type / inside Claude Code to see commands available in your current environment. The exact list can vary by plan, platform, plugins, and MCP servers.
| Command | Use it for |
|---|---|
/model | Check or change the active model for the current session. |
/effort | Adjust reasoning effort when the active model supports effort levels. |
/usage | Inspect token usage and local cost estimates for API-backed sessions. |
/permissions | Review or adjust tool permissions. |
/mcp | Check connected MCP servers and their status. |
/compact | Summarize a long session to recover context. |
Do not rely on every slash command being visible for every account. If a command is missing, check the official commands reference and your Claude Code version.
Prompt Patterns That Work
Use prompts that name the file, goal, constraints, and verification command.
In src/components/UserList.tsx, fix the empty state so it matches the existing design system. Keep the public API unchanged and run npm test -- UserList after editing.Add a server-side validation check to the subscription upgrade route. Follow the existing auth guard pattern and do not change the payment provider integration.Review this diff for correctness bugs only. Do not rewrite style unless it can cause a real user-facing issue.For broad work, ask Claude Code to return a file map first:
Map the files involved in onboarding, explain the current flow, and list the smallest safe change to add a required company-name step.What To Avoid
| Weak prompt | Better prompt |
|---|---|
| "Fix this bug." | "The profile page crashes after logout. Reproduce it, identify the file, and propose a fix before editing." |
| "Make the UI nicer." | "Improve the pricing card spacing on mobile while preserving the existing color system." |
| "Build authentication." | "Inspect the existing auth module and propose the smallest change to add GitHub login." |
| "Optimize everything." | "Find the slowest database query in the dashboard route and suggest one measurable improvement." |
Safety Habits
- Start new users in the default permission mode so edits and shell commands remain visible.
- Use Plan Mode for auth, payments, migrations, deployment, or cross-module refactors.
- Ask Claude Code to run the same checks your team would run manually.
- Review diffs before committing.
- Keep durable project rules in CLAUDE.md, not in every prompt.
Related Pages
- Installation and setup
- CLAUDE.md configuration
- Tools allowlist
- Plan Mode workflow
- Context management
Official Sources
Next: CLAUDE.md Configuration - Store reusable project instructions safely.
Claude Code Permissions and Tools Allowlist
Configure Claude Code permission modes, allowed tools, deny rules, MCP tools, shell command patterns, and safer automation workflows.
Installation & Setup
Install Claude Code with the current official setup paths, verify authentication, and prepare your first project safely.