How to start a new project with Claude Code
Start a new Claude Code project in an empty Git repository, describe a small working feature, then use /init to record conventions once code exists.
To start a new project with Claude Code, create a folder, run git init, then start claude there and describe the first working feature you want.
You can begin with an empty folder or run your framework's generator first. Once there's code, use /init to draft CLAUDE.md and review its instructions. Decide which checks must pass before the session ends; otherwise, a working-looking demo can leave you with no repeatable way to check the next change.
What's the fastest way to start a new project with Claude Code?
An empty Git repository is enough to begin if Claude Code is installed and you can sign in. Run these commands from the parent directory where you keep projects:
mkdir log-scan
cd log-scan
git init
claudeClaude Code opens in that directory, which becomes the starting point for its work. On first use, follow its sign-in prompts. Anthropic's Claude Code quickstart covers installation and authentication if the claude command isn't available yet.
Give Claude one feature it can finish and you can exercise locally. For a log-filtering CLI, ask it to read a file and print entries at a requested severity. Leave publishing and remote services for later. You can inspect the result by running it against a short sample file whose expected output you already know.
Use /init after the first implementation gives Claude something to inspect. It analyzes the codebase and proposes a starting CLAUDE.md with commands and conventions it finds. Review the result for commands that actually work, then add decisions it couldn't infer. Anthropic's project instruction documentation explains the file and how it loads in later sessions, and these CLAUDE.md examples for Go, Next.js and Python show what a reviewed one holds.
Keep the instructions short enough to review. Record the actual test command and where the main code lives. A promise such as "always produce high-quality code" gives the next session less useful guidance than "run the CLI against the sample log and compare the output with the fixture."
Should I run create-next-app before starting Claude Code?
Run the framework generator first when you've already chosen the framework. For a Next.js application, start in your projects directory and let the generator create a separate folder:
npx create-next-app@latest my-app
cd my-app
claudeReview the generator's choices before accepting them. Then ask Claude to inspect the generated project and implement your first feature using its existing conventions. This gives it a concrete starting structure. You can also ask Claude to run the generator itself. Name the framework and have it pass the generator's options as flags, because the agent's shell commands can't answer interactive prompts.
A generator answers framework setup questions, but your acceptance criteria still need writing. Inspect the generated scripts to see which checks exist. Ask Claude to add a test for the feature you're building and document how to run it. Avoid assuming that a successful development-server startup proves the feature works.
An empty folder makes more sense when the framework choice is still open. Ask Claude to recommend an approach and explain the tradeoff before it creates files. State constraints such as an existing deployment target or your team's preferred language. Otherwise, you're asking it to choose those things while it implements the app.
What should the first prompt include?
The first prompt should describe a small observable result and the constraints that would change the implementation. Give Claude enough information to choose the next action without asking it to design the entire future product. For the empty log-scan repository, a useful request is:
Build a Go CLI named log-scan that reads a local log file and prints
entries matching a severity flag. Start with newline-delimited JSON.
Malformed input should report the line number and exit unsuccessfully.
Keep it local. Don't add a database or publishing workflow.
Use current stable dependencies and check their current documentation.
Add tests for matching entries and malformed input.
Before finishing, run the tests and build the binary, then exercise it
against a sample file. Record the commands in CLAUDE.md.The malformed-input requirement gives the agent a concrete failure case to test. The local-only constraint rules out work you don't need yet. If the file format is uncertain, ask it to show sample input and expected output for approval before implementation.
Make the stopping condition explicit in your request. "The tests pass, the binary builds, and this sample produces these lines" is something you can check. "Set up the project properly" leaves the agent to decide how much setup counts as finished.
A repository template is a reasonable way to reuse this setup across projects. Keep its instructions aligned with the commands it ships, and review dependency choices when you copy it. If you maintain the template yourself, you also own keeping its checks useful as the tools change.
How do I give Claude Code a definition of done from day one?
Write down the checks before implementation grows beyond the first feature. You can do this yourself with project scripts and CLAUDE.md. For a web app, include an HTTP check alongside the build so you verify that the app actually responds. For a CLI, exercise its output and exit status.
stacks (@steamfield/stacks) packages this setup as a curated recipe called a stack, with shared additions called fragments. Its 0.7.0 release includes 41 stacks and 23 fragments. You choose the recipe, inspect its checks, and hand the agent a build brief with a recorded definition of done.
The terminal path starts before you create the target folder. stacks needs Node 22 or later and git on macOS or Linux; this Go example also needs the tools listed by show, including Go and make. With Claude Code installed, run:
npm install -g @steamfield/stacks@latest
stacks search "Go command line tool" --kind stack --limit 2 --local
stacks show go-cli
stacks new go-cli log-scan --launch claudeUse a missing or empty log-scan directory outside another repository. The Go CLI's default CI and git-hook fragments need their own repository root. If you're following the earlier manual example, choose a fresh target name. The new-project guide explains target directories and fragment choices.
new copies starter files and writes .stacks/BRIEF.md plus .stacks/manifest.json, then launches Claude with an instruction to read the brief and carry it out. It installs no dependencies and runs no framework generator. The agent does that work. Recipes leave dependency versions unpinned and tell the agent to resolve current stable versions that work together.
The brief describes the work; the manifest records what stacks verify runs. The agent implements the project and fixes failures until verify reports green. Checks come from the selected recipe and fragments, so inspect them with show before choosing. The concepts guide explains how those pieces fit together.
Verify checks recorded steps, so application-specific requirements still need tests. Editing the prose brief doesn't add a check. Its digest check also covers only the recorded verify steps, environment and preset; reviewing test contents remains your job. If those recorded inputs change against the local state record, verify runs nothing until a person accepts the change at a terminal. The CLI refuses acceptance inside a detected agent session.
Can Claude Code start the project itself?
Claude Code can run stacks from its current session and continue building the result. Tell it to search for a recipe and read it before creating the project. Inside a detected agent session, stacks hands instructions back to that agent without launching another one.
Start a small Go CLI that filters log files by severity. Keep it local for now.
I’ll search the catalog and read the Go CLI recipe.
●Bash(stacks search "Go command line tool" --kind stack --limit 2 --local)
●Bash(stacks show go-cli)
Go CLI includes configuration, JSON output and tests. I’ll use its sandbox preset and keep this agent session open.
●Bash(stacks new go-cli log-scan --sandbox --no-launch)
●Bash(cat log-scan/.stacks/BRIEF.md)
The brief says to build on the starter and loop on verify. I’ll initialize the module before adding the severity filter.
●Bash(cd log-scan && go mod init log-scan)
The module is initialized. Next I’ll add severity parsing and tests, then run the recorded checks.
The scripted demo shows the setup portion of a captured stacks 0.7.0 run. Its --sandbox choice takes the recipe's defaults for a local experiment and leaves out deploy and release fragments unless explicitly included. --no-launch makes the continued use of the current session explicit. The demo ends after go mod init; dependency installation, feature implementation and a green verify are still ahead.
The terminal example uses the default preset so the brief asks you about its decisions. For a local experiment like the demo, add --sandbox. After creation, have the agent read the brief in the new project directory and add your feature requirements to its task.
The agent skill instructions teach Claude the search, show, new and verify workflow. Install that skill with stacks skill install if you want to start future projects with a chat request. A client using the MCP server can list recipes, create a project and run verify through named tools; that server exposes no search or show tool.
What do I commit after the first session?
Review the generated files and the checks the agent says it ran before making the first commit. Keep the source, dependency lockfile and project instructions that another developer needs. Open the app or run the CLI yourself against the example you used to define success.
For a stacks project, commit .stacks/manifest.json so a clone has the recorded verification steps. The generated ignore file excludes the brief, notes and run history. stacks new initializes git when appropriate but commits nothing. A fresh clone has no local state record, so its initial digest check uses the manifest's copy only.
Ask the agent's handoff to name any checks it couldn't run and the tools they require. Record unresolved product decisions where the next session can find them. Before committing, inspect git status and the diff for local data or credentials that shouldn't enter the repository.