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).
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
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
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).
Since the folder is empty, you need to tell Claude what you want to build. A good starting prompt should include:
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 basicmain.pyfile with a template for scraping a URL."
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:
python -m venv venv"requirements.txt"main.py with the following code..."It will ask for your permission before executing commands or writing files. You can press:
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.mdfile 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."
mkdir project && cd projectgit initclaudeai