Skip to main content

Capstone: Organize a Messy Project

Time: 30-60 minutes | Skills: Chat, Read, Edit, Bash, Glob, Grep, Web Fetch

The Scenario

You have been handed a project folder called messy-project. A previous team member left it in terrible shape: files are in the wrong folders, naming is inconsistent, there are duplicate files, mystery files with no clear purpose, and no README to explain any of it. Your job is to use Claude Code to explore, understand, and reorganize this project into something clean and logical.

This capstone uses every core feature you have learned in Module 02:

SkillHow You Will Use It
ChatAsk Claude to analyze and make decisions about organization
ReadExamine file contents to understand their purpose
Edit / WriteRename, move, and create files
BashRun commands to create folders, move files, and verify structure
GlobFind files by name and extension
GrepSearch file contents for clues about what files do

Setup: Create the Messy Project

First, create the disorganized project that you will clean up. Start Claude Code in your practice directory and give it these instructions:

> Create a folder called "messy-project" and fill it with the following files. Make sure
> the contents are realistic but messy -- this is simulating a badly organized project.
>
> Files to create:
> - messy-project/app.js (a simple Express.js server with TODO comments)
> - messy-project/APP_BACKUP.js (an older copy of app.js with slight differences)
> - messy-project/styles.css (basic CSS styles)
> - messy-project/style.css (a near-duplicate with a few extra rules)
> - messy-project/test1.py (a Python test file that imports from "utils")
> - messy-project/TEST_OLD.py (an older version of the same test)
> - messy-project/utils.py (Python utility functions used by the test)
> - messy-project/data.csv (a small CSV with 5 rows of sample data)
> - messy-project/data_final.csv (same data but with one row corrected)
> - messy-project/data_FINAL_v2.csv (same data with two rows corrected)
> - messy-project/notes.txt (random project notes)
> - messy-project/meeting-notes-jan.txt (meeting notes)
> - messy-project/meeting-notes-feb.txt (meeting notes)
> - messy-project/logo.txt (contains just the text "placeholder for logo.png")
> - messy-project/temp.tmp (contains "delete me")
> - messy-project/config.json (a JSON config file with a database connection string)
> - messy-project/.env (contains DATABASE_URL=fake_connection_string)

After Claude creates the files, you are ready to begin.

Part 1: Explore and Understand

Your first task is to figure out what you are working with. Do NOT start moving files yet.

Step 1: Get an Overview

> What files and folders are in messy-project? Give me a full listing.

Step 2: Find File Types

> What types of files are in messy-project? Group them by extension.

This uses Glob to find patterns like **/*.py, **/*.js, **/*.css, etc.

Step 3: Identify Duplicates

> Read APP_BACKUP.js and app.js. Are they duplicates? What are the differences?
> Compare style.css and styles.css. Which one is more complete?
> Compare all three data CSV files. Which one is the most up-to-date?

This uses Read to examine file contents and compare them.

Step 4: Search for Clues

> Search all files for the word "TODO". Which files have unfinished work?
> Search for "import" to see which files depend on other files.
> Are there any files that mention "delete" or "temporary"?

This uses Grep to search file contents.

Part 2: Plan the Reorganization

Now that you understand the project, plan a new structure. Ask Claude for help:

> Based on what we've found, this project has:
> - A JavaScript web app (app.js, CSS files)
> - Python test files (test1.py, utils.py)
> - Data files (CSV)
> - Documentation (notes, meeting notes)
> - Junk files (backups, temp files, duplicates)
>
> Suggest a clean folder structure for this project. Put related files together,
> remove obvious junk, keep only the latest versions of duplicate files, and
> create a README.md explaining the project.

Claude will propose a new structure. Review it and adjust if you disagree.

Part 3: Reorganize

Now execute the plan. Work through it step by step with Claude:

Step 1: Create the Folder Structure

> Create the folders we agreed on inside messy-project (like src, tests, data, docs).

Step 2: Move and Rename Files

> Move app.js into src/ and styles.css into src/.
> Move test1.py and utils.py into tests/. Rename test1.py to test_utils.py for clarity.
> Move data_FINAL_v2.csv into data/ and rename it to data.csv.
> Move the meeting notes and notes.txt into docs/.
Review Each Change

As Claude proposes each move or rename, review the command before approving. This is a great time to practice reading Bash commands and understanding what they do before pressing Y.

Step 3: Clean Up Junk

> Delete the duplicate/backup files: APP_BACKUP.js, style.css, TEST_OLD.py,
> data.csv (the original), data_final.csv, temp.tmp, and logo.txt.
Check Before Deleting

Before you approve deletions, make sure you are not removing the wrong file. Ask Claude to confirm which version is the "keeper" if you are unsure.

Step 4: Create a README

> Create a README.md in messy-project that explains:
> - What this project is (a sample web app with Python tests)
> - The folder structure and what each folder contains
> - How to get started

Step 5: Handle Sensitive Files

> Should the .env file be in this project? What about config.json with the
> database connection string? What is the best practice?

Claude should explain that .env files and files with secrets should not be shared. Ask Claude to create a .gitignore file that excludes .env.

Part 4: Verify

Confirm everything looks right:

> Show me the final folder structure of messy-project as a tree.
> Read the README.md to make sure it is accurate.
> Search for any remaining TODO comments.
> Are there any files that look like they do not belong?

Self-Assessment

After completing the capstone, check off each item:

  • Explored the project to understand its contents using Read, Glob, and Grep
  • Identified duplicate files and determined which versions to keep
  • Created a clean folder structure with logical organization
  • Moved and renamed files through Claude using Bash commands
  • Removed junk and duplicate files
  • Created a README.md documenting the project
  • Handled the .env file appropriately with a .gitignore
  • Verified the final structure is clean and makes sense
Going Further

If you want extra practice, try these bonus challenges:

  • Ask Claude to search the web for "best practices for project folder structure" and compare the advice to what you created
  • Have Claude add line-by-line comments to the Python and JavaScript files explaining what each part does
  • Ask Claude to create a simple .bat script that backs up the data folder

Help Us Improve

How was this lesson? Take 2 minutes to share your feedback — it helps us make the tutorials better for everyone.

Give Feedback →