daBongo LMS AI Training Courses

Claude Code Foundations – Your Daily Dev Workflow

Lesson 3: Your First Real Coding Sessions

Lesson Objectives

By the end of this lesson, students should be able to:

  • Frame a coding task request that gives Claude Code enough context to act effectively
  • Apply the review-then-commit pattern for AI-generated code changes
  • Use Claude Code for debugging with a behavior-first description
  • Run a productive code review session with Claude Code

Lesson Content

The request framing pattern for coding tasks.

Claude Code works best when you describe the behavior you want, not the implementation. Contrast:

  • Weak: "Fix the login." – What about it? What is broken?
  • Strong: "The login form submits but the user is redirected to a 404 instead of the dashboard. The relevant route is in src/routes/auth.js. The expected redirect target is /dashboard."

Behavior description (what is happening vs. what should happen) + location (which file or component) + expected outcome = a request Claude can act on without guessing.

The review-then-commit pattern.

For any code change Claude makes:

  1. Review every changed line before staging
  2. Ask Claude to explain anything you do not understand
  3. Run the relevant tests
  4. Commit only code you understand and own

This is not optional good practice – it is the baseline for maintaining code ownership. Claude Code will make changes confidently that may be wrong, sub-optimal, or introduce subtle issues. Your review is what catches those.

Debugging with behavior-first description.

The most common mistake in AI-assisted debugging: sharing the code you suspect is wrong and asking "what's the bug?" A better pattern:

  1. Describe the observed behavior: what is happening, with what input, producing what wrong output
  2. Share the relevant code (or point Claude to the file)
  3. Share any error messages or logs
  4. Ask Claude to reason about possible causes – not confirm your hypothesis

Hypothesis-confirmation prompts get confirmation. Behavior-first prompts get independent diagnosis.

Code review sessions.

Use Claude Code for focused code reviews:

  • "Review this function for edge cases that are not handled"
  • "Review src/utils/validator.js for potential security issues in the input validation"
  • "Review this PR diff for readability – are there any confusing variable names or unclear logic?"

Each review request is more useful when scoped to a specific concern than when asked generically ("review this code"). Claude produces generic observations for generic requests.

Session length and context.

Claude Code sessions have a context window. For very long sessions, early context may be compressed or lost. For complex multi-step tasks, plan natural break points. The /compact command (or equivalent) compresses session history when context gets long. Check current context management commands at docs.anthropic.com.

Practical Example

A developer has a failing integration test.

She opens Claude Code, describes the failure: "The POST /api/orders test is failing – it returns 422 but the test expects 201.

The request body matches the schema.

The relevant controller is src/controllers/orders.js, the test is in tests/integration/orders.test.js." Claude Code reads both files, identifies a validation middleware that was recently added and is checking a field the test does not include, and proposes a fix.

She reviews the proposed change – it is correct – runs the tests, and commits.

Total time: eight minutes.

Previous approach (manual debugging): thirty to forty-five minutes.

Safety Notes

When using Claude Code in an active development environment – especially one with database write access or connections to external services – be specific about scope. Requests like "fix all the broken things in this module" give Claude broad latitude to make changes. Scoped requests ("fix the validation on the email field in this form component") produce targeted, reviewable changes. Broad requests can produce broad changes.

Log in and enroll to access lesson quizzes.

Scroll to Top