Przejdź do głównej zawartości

Starting New Projects with Claude Code

Ta treść nie jest jeszcze dostępna w Twoim języku.

Starting a new project traditionally involves hours of boilerplate setup: creating directory structures, configuring build tools, setting up linting, initializing git, writing initial documentation, and establishing project conventions. Claude Code transforms this multi-hour process into a guided conversation that produces a production-ready project foundation in minutes.

The Challenge: From Blank Directory to Working Project

Section titled “The Challenge: From Blank Directory to Working Project”

Every developer knows the friction of starting fresh. You have an idea or requirement, but between that vision and writing actual feature code lies a maze of setup tasks. Should you use TypeScript or JavaScript? How should you structure directories? What testing framework fits best? What about linting, formatting, deployment configuration?

Claude Code doesn’t just generate boilerplate—it acts as an experienced architect who understands your requirements and makes informed decisions about project structure, tooling, and conventions.

Before starting, ensure you have:

  • Claude Code installed (npm install -g @anthropic-ai/claude-code)
  • A blank directory or repository where you want to create your project
  • Node.js 18+ installed (for JavaScript/TypeScript projects)
  • Any language-specific tools installed (Python, Elixir, PHP, etc.)
  1. Create your project directory and navigate to it

    Terminal window
    mkdir my-awesome-project
    cd my-awesome-project
    claude
  2. Initialize with project context

    > /init

    This creates an initial CLAUDE.md file. Claude will analyze any existing files and generate appropriate context documentation.

  3. Describe your project vision

    > I need to build a task management API with the following requirements:
    > - RESTful API with user authentication
    > - PostgreSQL database
    > - Email notifications for task assignments
    > - Admin dashboard for monitoring
    > - Should be built with Node.js and TypeScript
    > - Need Docker support for deployment
  4. Let Claude create a comprehensive plan

    > Based on these requirements, think hard about the best architecture
    > and create a detailed implementation plan. Include technology choices,
    > directory structure, and key implementation steps.
  5. Review and refine the plan Claude will present a detailed plan. Review it and ask for adjustments:

    > Let's use Fastify instead of Express for better performance.
    > Also, add Redis for caching and session management.
  6. Execute the project setup

    > Great plan! Now let's implement the project structure and initial setup.
    > Start with creating all directories, configuration files, and package.json.
  7. Set up development environment

    > Set up the development environment including:
    > - TypeScript configuration
    > - ESLint and Prettier
    > - Git hooks with Husky
    > - Initial Docker configuration
    > - Environment variable structure
  8. Create initial implementation

    > Now implement the basic server setup with:
    > - Health check endpoint
    > - Basic error handling
    > - Database connection
    > - Logging setup
  9. Add testing foundation

    > Set up the testing framework with:
    > - Jest configuration for TypeScript
    > - Example unit and integration tests
    > - Test database configuration
    > - GitHub Actions for CI
  10. Document and commit

    > Create a comprehensive README with:
    > - Project overview
    > - Setup instructions
    > - API documentation structure
    > - Development workflow
    > Then create an initial git commit with a descriptive message
> I need a Next.js SaaS starter with:
> - Authentication (NextAuth with Google/GitHub)
> - Stripe integration for subscriptions
> - PostgreSQL with Prisma ORM
> - Tailwind CSS with shadcn/ui components
> - Email sending with Resend
> - Landing page, dashboard, and settings pages
> Think through the architecture and implement it step by step
> Create a Python FastAPI microservice for image processing:
> - Accept image uploads
> - Resize images to multiple sizes
> - Store in S3-compatible storage
> - PostgreSQL for metadata
> - Redis for job queue
> - Docker-ready with proper structure
> Use modern Python with type hints and async throughout
> Build an Elixir Phoenix API for a real-time analytics platform:
> - GraphQL API with Absinthe
> - Real-time subscriptions
> - TimescaleDB for time-series data
> - Authentication with Guardian
> - Rate limiting per API key
> - Prometheus metrics
> Follow OTP best practices and use contexts properly
> I need a monorepo setup for our full-stack application:
> - Frontend: Next.js app
> - Backend: Node.js API
> - Shared: TypeScript types and utilities
> - Mobile: React Native app
> - Use pnpm workspaces
> - Set up build orchestration
> Think about the structure and implement it

Claude will create a sophisticated monorepo structure with:

  • Workspace configuration
  • Shared TypeScript configurations
  • Cross-package dependencies
  • Unified testing setup
  • CI/CD pipeline configuration
> Design a microservices architecture for an e-commerce platform:
> - API Gateway (Kong or custom)
> - User Service (authentication)
> - Product Service (catalog)
> - Order Service (transactions)
> - Notification Service (email/SMS)
> - Use Docker Compose for local development
> - Include service discovery and health checks

Claude designs inter-service communication, shared libraries, and orchestration.

> Create a CLI tool for database migrations:
> - Support multiple database types
> - Version control for migrations
> - Rollback capability
> - TypeScript with Commander.js
> - Distribute via npm
> - Include man pages and shell completions

Start with Clear Requirements

The more specific your initial requirements, the better Claude’s initial plan. Include technical constraints, performance requirements, and deployment targets.

Iterate on the Plan

Don’t accept the first plan blindly. Ask Claude to explain trade-offs, suggest alternatives, or dive deeper into specific architectural decisions.

Leverage Claude's Knowledge

Claude knows about latest best practices, security considerations, and common pitfalls. Ask it to review its own suggestions for potential issues.

Customize CLAUDE.md Early

As soon as the project structure exists, customize the CLAUDE.md file with project-specific conventions, making future development smoother.

  • Skipping the planning phase: Jumping straight to implementation often leads to refactoring later
  • Not customizing generated code: Claude’s output is a starting point—adapt it to your specific needs
  • Ignoring documentation: The initial setup is the best time to establish good documentation practices
  • Forgetting environment setup: Ensure all team members can run the project with minimal friction

Once you have a successful project setup, create a custom slash command:

.claude/commands/create-api.md
Create a new TypeScript API project with our standard setup:
- Fastify with TypeScript
- Our standard folder structure
- PostgreSQL with our migration setup
- Our ESLint and Prettier configs
- Standard GitHub Actions
- Our logging and monitoring setup
Project name: $ARGUMENTS

Create a collection of project-specific patterns:

> # remember our standard error handling middleware:
> - Global error handler with proper logging
> - Structured error responses
> - Correlation ID tracking
> - Sentry integration for production

A well-initialized project should have:

  • ✅ Clear directory structure following language conventions
  • ✅ All necessary configuration files
  • ✅ Development environment that starts with a single command
  • ✅ Test setup with at least one passing test
  • ✅ Linting and formatting configured and passing
  • ✅ Git repository with meaningful initial commit
  • ✅ README with clear setup instructions
  • ✅ CLAUDE.md with project-specific context
  • ✅ Basic CI/CD pipeline configuration

Starting new projects with Claude Code fundamentally changes the development experience. Instead of spending hours on setup, you engage in a high-level architectural discussion with an AI that translates your requirements into a working project foundation. The key is to think of Claude not as a code generator, but as an experienced developer who can help you make informed decisions and implement them consistently.

Remember: the goal isn’t to have Claude do everything automatically, but to collaborate on creating a solid foundation that accelerates your actual feature development. Every minute saved on boilerplate is a minute you can spend on what makes your project unique.