Why This Matters#
Claude Code isn’t just “an AI chat.” It’s a full-fledged work tool that can perform real development tasks: finding and fixing bugs, reviewing code, improving project structure, and working with Git. In this lesson, we’ll cover the main workflows — typical scenarios where Claude Code helps the most.
What is a Workflow#
A workflow is a sequence of steps to solve a specific task. For example, “fixing a bug” means: find the error → understand the cause → write a fix → verify everything works.
Claude Code can perform each of these steps — and often the entire chain at once.
Workflow 1: Bug Fixing#
When Needed#
Something isn’t working: the site shows an error, a function returns the wrong result, the program crashes.
How to Work with Claude#
Option A — you know where the bug is:
You: In the file src/cart.js, the calculateTotal function returns
the wrong sum. The discount isn't being applied. Fix it.Claude will open the file, find the problem, and suggest a fix.
Option B — you don’t know where the bug is:
You: When a user adds an item to the cart, the total price
doesn't update. Find and fix the problem.Claude will analyze multiple files, find the cause, and fix it.
Option C — you have an error message:
You: When running npm start, this error appears:
TypeError: Cannot read property 'map' of undefined
at ProductList (src/components/ProductList.js:15)
Fix it.Claude will read the error message, open the right file, and fix the problem.
Tips for Bug Fixing#
- Give Claude as much context as possible: error text, steps to reproduce
- Ask Claude to explain the cause first, then fix it
- After the fix, ask to run the tests
Workflow 2: Code Review#
When Needed#
You’ve written code (or Claude did) and want to make sure it’s quality.
How to Work with Claude#
You: Review the file src/auth.js for:
- Errors and potential problems
- Security
- Readability
- Best practices complianceClaude will analyze the code and produce a detailed report.
Reviewing Changes Before Committing to Git#
You: Look at my current changes (git diff) and check if
everything is fine before committing.Claude will run git diff, analyze all changes, and flag any issues.
Workflow 3: Refactoring (Code Improvement)#
What It Is#
Refactoring means improving code without changing its functionality. The code does the same thing but becomes cleaner, clearer, and easier to maintain. Like a deep cleaning: everything in its place, nothing lost.
How to Work with Claude#
Simplify a complex function:
You: The processOrder function in src/orders.js is too long
and complex. Break it into several smaller functions.Update outdated code:
You: Rewrite src/utils.js, replacing old syntax
with modern JavaScript (ES6+).Remove duplication:
You: The files src/admin.js and src/user.js have similar code
for permission checking. Extract the common logic into a separate module.Workflow 4: Working with Git#
What is Git#
Git is a version control system. It saves the history of all changes in a project, like a “time machine” for code. Key concepts:
- Commit — saving changes with a description
- Branch — a separate “line” of development
- Pull request (PR) — a request to merge your changes into the main code
How Claude Helps with Git#
Creating a commit with a clear description:
You: Look at which files I changed and create a commit
with a clear description.Creating a new branch for a task:
You: Create a new branch feature/contact-form and start
building a feedback form.Resolving conflicts:
You: I have a merge conflict in src/app.js.
Help me resolve it.Typical Git Workflow with Claude#
You: Create branch fix/broken-login
Claude: Created branch fix/broken-login and switched to it.
You: Find and fix the authentication bug — users
can't log in with uppercase email.
Claude: [finds the problem in src/auth.js, fixes it,
shows changes]
You: Looks good. Create a commit and describe what was fixed.
Claude: Created commit: "fix: normalize email during
authentication — convert to lowercase"Workflow 5: Writing Tests#
What Are Tests#
Tests are special code that verifies your program works correctly. Like a quiz for code: “if the input is 2+2, the output should be 4.”
How to Work with Claude#
You: Write tests for src/cart.js.
Cover all main scenarios: adding an item,
removing, calculating discount, empty cart.Claude will create a test file and can run them right away.
Tips for Effective Work#
- ✅ Describe tasks at the business logic level: “Users complain that orders aren’t being placed” is better than “Fix line 47”
- ✅ Ask Claude to explain before it starts changing code
- ✅ Verify the result: after changes, ask to run tests
- ✅ Work iteratively: first a small task, then the next one
- ✅ Use Git: you can always roll back changes if something goes wrong
Lesson Summary#
- Claude Code can perform full workflows: bug fixes, reviews, refactoring, Git operations
- The more context you provide (error text, files, problem description), the better the result
- Claude can work with Git: create branches, commits, resolve conflicts
- Always verify the result — ask Claude to run tests or explain the changes
- Work step by step: one task at a time