Working with Claude Code: 1. Start a New Project

Prerequisites

Before you start, make sure you have Claude Code installed and authenticated. (If you haven't done this, you typically install it via npm: npm install -g @anthropic-ai/claude-code, and then run claude to log in).


Step 1: Create and navigate to your project folder

Claude Code works best when you run it inside the root directory of your project. Open your terminal and create a new folder:

mkdir my-new-project
cd my-new-project

Step 2: Initialize Git (Highly Recommended)

Claude Code is highly aware of your Git status. It uses Git to track the changes it makes, allowing you to easily review its work and revert if it breaks something.

git init

Step 3: Launch Claude Code

Now that you are in your empty project folder, launch the Claude Code interface:

claude

(Note: If this is your first time running it in this directory, it may ask you to confirm that you trust this folder. Type y and hit enter).

Step 4: Give Claude the Initial Prompt

Since the folder is empty, you need to tell Claude what you want to build. A good starting prompt should include:

  1. The tech stack you want to use.
  2. The goal of the project.
  3. A request to scaffold/initialize the project.

Example Prompt:

"I want to start a new project. It's going to be a simple web scraper using Python, BeautifulSoup, and requests. Please initialize the project structure, create a virtual environment, create a requirements.txt, and make a basic main.py file with a template for scraping a URL."

Step 5: Review and Approve Actions

Claude Code is agentic, meaning it doesn't just write text; it proposes actions. When you hit enter on your prompt, Claude will think and then propose a plan.

It might say something like:

It will ask for your permission before executing commands or writing files. You can press:

Step 6: Add a CLAUDE.md file (Best Practice)

Once Claude has scaffolded the basic project, a great next step is to ask it to create a CLAUDE.md file in the root directory.

Why? Claude Code automatically reads CLAUDE.md every time it starts up in that directory. It acts as a long-term memory and project guideline.

Example Prompt:

"Now that the project is set up, please create a CLAUDE.md file in the root directory. In it, document the tech stack we are using, the project structure, and instructions on how to run the code and install dependencies."


Summary of the Workflow

  1. mkdir project && cd project
  2. git init
  3. claude
  4. "Scaffold a project using [Tech Stack] that does [Goal]."
  5. Approve the files/commands Claude generates.
  6. Continue iterating by asking it to add features, fix bugs, or write tests.

ai

Back