Tutorials / Claude Code: AI-Assisted Coding from First Prompt to Daily Workflow / Final project: building a small app step by step

Final project: building a small app step by step

15 min read text
Course contents (20 lessons)
  1. Meet Claude Code
  2. What Claude Code is and how it differs from a chat window
  3. Installing Claude Code and signing in
  4. Your first session: explore, ask, change
  5. Asking well and staying in control
  6. Asking for changes: context, goal, constraints and acceptance criteria
  7. Reading and approving edits
  8. Permission modes: how much freedom to give
  9. Project memory and slash commands
  10. CLAUDE.md: teaching the tool about your project
  11. Slash commands and custom commands
  12. Everyday coding workflows
  13. The plan-first workflow
  14. Understanding unfamiliar code
  15. Debugging with Claude Code
  16. Refactoring safely
  17. Writing tests with Claude Code
  18. Git, small changes, cost and security
  19. Git workflows: branches, commits and pull request descriptions
  20. Keeping changes small and reviewable
  21. Context and cost awareness
  22. Security habits: secrets, commands and untrusted input
  23. Extending the tool, teamwork and a final project
  24. Hooks and MCP servers explained
  25. Team practices for AI-assisted coding
  26. Final project: building a small app step by step

The project

We will build a small command-line habit tracker in Python. It stores habits and check-ins in a local file, and can add a habit, mark it done for today and show a weekly summary. It is small enough to finish in one afternoon, and it exercises every habit in this course. If you prefer another language, keep the steps and change the details.

I describe the prompts and what to look for. Your results will differ from mine, because the tool's output varies. That is fine. The point is the workflow.

Step 0: set up the folder

mkdir habit-tracker
cd habit-tracker
git init
python -m venv .venv
git commit --allow-empty -m "Start project"
claude

Add the virtual environment folder to your ignore file before the first real commit.

Step 1: plan before code

I want to build a small command-line habit tracker in Python 3, standard library only, with pytest for tests.
Features: add a habit, mark a habit done for today, list habits with their current streak, and a weekly summary.
Data is stored in a JSON file in the user's home directory, but the path must be configurable so tests can use a temporary folder.
Do not write code yet. Propose a file layout, the main functions and their responsibilities, how streaks are calculated (including what happens when a day is missed), and the tests you would write. Keep it under 40 lines.

Read the plan. Look for the streak definition and the storage design. Correct anything you disagree with, for example "a streak counts consecutive days ending today or yesterday".

Step 2: create CLAUDE.md early

Create a short CLAUDE.md for this project (under 25 lines) with: what the project is, how to run the app, how to run the tests, and these conventions: standard library only, type hints on all functions, no global state, the data file path always comes from a parameter. Show it to me before saving.

Commit it. Every later session will start with this knowledge.

Step 3: the core, with tests first

Implement step 1 of the plan only: the storage module that loads and saves habits and check-ins to a JSON file at a given path. Write the tests first, including: file does not exist yet, file is empty, file contains invalid JSON (raise a clear error, do not overwrite it), and a save followed by a load returns the same data. Run the tests and show me the result. Change at most 2 source files plus the test file.

Review the diff using the six-point list from the lesson on approving edits. Pay special attention to the invalid JSON case: a tracker that silently overwrites a damaged file destroys the user's data. Commit.

Step 4: streak logic

Implement the streak calculation as a pure function: given a list of check-in dates and today's date, return the current streak. Write tests for: no check-ins, only today, today and yesterday, a gap of one day, duplicates on the same date, dates in the future (ignore them) and a streak crossing a month end and a leap day. Run the tests.

This is the part where the tool is likely to be subtly wrong. Read each test and check the expected value by hand. Then do the break-it check:

Temporarily change the streak function so it counts the gap day as part of the streak, run the tests, and confirm at least one fails. Then restore the function and show me git diff to prove it is restored.

Step 5: the command-line interface

Add the command-line interface using argparse with subcommands: add NAME, done NAME, list and week. Keep the interface layer thin: it parses arguments and calls the functions from the earlier modules. Unknown habit names should print a clear message and exit with a non-zero code. Add tests that call the interface function with a temporary data path. Do not change the storage or streak modules.

Then try the app yourself in the terminal. Tests do not replace using the thing.

Step 6: weekly summary

Add the weekly summary: for each habit, show the last 7 days as a row of marks, and the count out of 7. Pass today's date as a parameter so tests are deterministic. Keep the output format simple and aligned. Add tests with fixed dates.

Step 7: review the whole branch

Review everything on this branch as a strict teammate. Check: bugs, edge cases not covered by tests, error handling, security (file paths, JSON handling), readability and consistency with CLAUDE.md. List issues by severity with file and line. Do not edit anything.

Pick the issues that are real. Ask the tool to fix them one at a time, with a test for each, committing after each.

Step 8: commit history and pull request text

git log --oneline
git diff --stat main
Write a pull request description for this branch. Include a summary, the list of features, how to run the app and tests, design decisions (storage format, streak rule) and known limitations. Use only what is in the code and commits.

Check each statement against the code. Add your own notes on decisions you made, since only you know why.

The common mistake

The common mistake in a project like this is asking for the whole application in one prompt, because it is small. It will produce something that looks complete. But you will not know where the bugs are, you will not understand the code and you will not have learned anything about the workflow. Small steps, tests and review are the course, and they apply even to a toy app.

Try it yourself

Finish the project, then extend it with one more feature of your choice, such as exporting the summary to a text file or a reminder for habits not done today. Use the whole loop: plan, test first, small commit, review. Write a short retrospective of three lines: what worked, what failed, what you will change in your next real project.

This course is free to read. Create a free account to enrol, save your progress and pick up where you left off.

Sign up free I already have an account