Now that Claude Code is installed and running, let's walk through the workflows you'll use every day. These patterns cover 90% of what developers do with Claude Code.
Exploring your codebase
The simplest and most powerful use case: asking Claude questions about your code.
> How does authentication work in this project?
> What happens when a user submits the checkout form?
> Where are the database migrations defined?
> Explain the error handling strategy in the API layerClaude doesn't just search for keywords. It reads files, follows imports, traces function calls, and synthesizes an answer from multiple sources. If your authenticationWhat is authentication?Verifying who a user is, typically through credentials like a password or token. spans a middlewareWhat is middleware?A function that runs between receiving a request and sending a response. It can check authentication, log data, or modify the request before your main code sees it. file, a user model, a sessionWhat is session?A server-side record that tracks a logged-in user. The browser holds only a session ID in a cookie, and the server looks up the full data on each request. store, and a route handlerWhat is route handler?A Next.js file named route.js inside the app/ directory that handles HTTP requests directly - the App Router equivalent of API routes., Claude will find and connect all of them.
This is particularly powerful for onboarding onto unfamiliar codebases. Instead of spending hours reading code, you can ask Claude to give you the big picture first, then drill into specifics.
Making edits
When you want Claude to change code, describe what you want in plain language:
> Add input validation to the registration form - email must be valid
and password must be at least 8 characters
> Refactor the fetchUser function to use async/await instead of .then() chains
> Add a loading spinner to the dashboard while data is being fetchedClaude will:
- Read the relevant files to understand the current code
- Plan the changes needed
- Show you a diffWhat is diff?A comparison showing exactly which lines were added, removed, or changed between two versions of code. of the proposed modifications
- Wait for your approval before applying anything
The diff view shows exactly what lines will be added, removed, or modified. You can approve the change, reject it, or ask Claude to modify its approach.
If the change spans multiple files, Claude handles all of them in sequence. For example, adding a new APIWhat is api?A set of rules that lets one program talk to another, usually over the internet, by sending requests and getting responses. endpointWhat is endpoint?A specific URL path on a server that handles a particular type of request, like GET /api/users. might involve creating a route handlerWhat is route handler?A Next.js file named route.js inside the app/ directory that handles HTTP requests directly - the App Router equivalent of API routes., updating the router, adding a type definition, and writing a test, Claude can propose all of these changes in one flow.
Git workflows
Claude Code has deep git integration. Here are the most common patterns:
Writing commitWhat is commit?A permanent snapshot of your staged changes saved in Git's history, identified by a unique hash and accompanied by a message describing what changed. messages
After making changes (either manually or with Claude's help), ask Claude to commit:
> commit these changesClaude will look at the staged diffWhat is diff?A comparison showing exactly which lines were added, removed, or changed between two versions of code., understand the semantic meaning of the changes, and write a descriptive commit message. It follows conventional commit patterns and captures the "why" behind the change, not just the "what".
Creating pull requests
> create a PR for this branchClaude generates a PR title and description based on all the commits in your branch. It summarizes the changes, explains the motivation, and can include a test plan. The PR is created using the GitHub CLIWhat is cli?Short for Command Line Interface. A tool you use by typing commands in the terminal instead of clicking buttons. (gh), so it works with your existing GitHub workflow.
Resolving merge conflicts
> resolve these merge conflictsClaude reads the conflicted files, understands both sides of the conflict, and proposes a resolution. This is especially useful for complex conflicts where the right resolution requires understanding the intent of both changes.
Running commands
Claude can execute shell commands and react to their output:
> run the tests
> build the project and fix any errors
> run the linter and fix all warningsThis creates a powerful feedback loop. Claude runs your test suite, reads the failures, identifies the root causes, proposes fixes, and runs the tests again to verify. A task that might take you 30 minutes of back-and-forth between your editor and terminalWhat is terminal?A text-based interface where you type commands to interact with your computer. Also called the command line or shell. happens in one continuous flow.
Slash commands reference
Slash commands are built-in shortcuts for common actions. Type them directly in the Claude Code prompt:
| Command | Description |
|---|---|
/help | Show available commands and usage tips |
/clear | Clear the conversation history and start fresh |
/compact | Summarize the conversation to free up context window space |
/cost | Show token usage and estimated cost for the current session |
/exit | End the session |
/init | Create a CLAUDE.md file for your project |
/memory | Edit your CLAUDE.md memory files |
/model | Switch between available Claude models |
/permissions | View and manage permission settings |
The most important one to remember is /compact. Long sessions accumulate context, file contents, diffs, command outputs. When you notice Claude slowing down or responses becoming less focused, /compact summarizes everything and frees up space.
| Workflow | What you say | What Claude does |
|---|---|---|
| Explore | "How does auth work?" | Reads files, traces imports, synthesizes an answer |
| Edit | "Add validation to the form" | Reads code, proposes a diff, waits for approval |
| Git | "Commit these changes" | Reads the diff, writes a meaningful commit message |
| Test + fix | "Run the tests and fix failures" | Runs tests, reads errors, proposes fixes, re-runs |
| Review | "Review this file for bugs" | Analyzes code, lists issues with line numbers |
Putting it all together
A typical development sessionWhat is session?A server-side record that tracks a logged-in user. The browser holds only a session ID in a cookie, and the server looks up the full data on each request. might look like this:
> What does the PaymentService class do?
(Claude explains the class and its dependencies)
> Add retry logic for failed payment API calls - max 3 retries with
exponential backoff
(Claude proposes changes, you approve)
> run the tests
(Claude runs tests, two fail)
> fix the failing tests
(Claude reads failures, fixes them, re-runs - all pass)
> commit these changes
(Claude writes a descriptive commit message)Five prompts. What might have been 45 minutes of work, reading code, writing the retry logic, debugging test failures, writing a commitWhat is commit?A permanent snapshot of your staged changes saved in Git's history, identified by a unique hash and accompanied by a message describing what changed. message, flows naturally in a single conversation.