Skip to main content
In this lesson you’ll learn how to start your first session with Claude Code and scaffold a small Python project. We’ll cover the initial /init step that generates CLAUDE.md, how Claude inspects your repository, and an example of the kind of scaffolding it may propose for a CSV-based utility.
A presentation slide that says "Start your First Session" on the left and a large dark-blue curved area on the right with the word "Demo" in bright blue. A small "© Copyright KodeKloud" appears in the bottom-left.
Getting started: run /init to create a CLAUDE.md file that contains project metadata, developer notes, and usage instructions for Claude. Claude will scan the repository (looking for files like package.json, pyproject.toml, requirements.txt, etc.), infer the project type, and propose edits or scaffolding — for example converting a single script into a small package with tests and a CLI. Treat Claude Code like another engineer: be explicit and concrete when describing expected behavior, file formats, command-line interfaces, and failure modes.
Be specific in prompts — describe file formats, expected command-line behavior, inputs, and error handling, just as you would when assigning a task to a teammate.
Example repository utility
  • Below is the cleaned-up utility script this repository started with. Claude often finds single-purpose scripts like this and suggests packaging and tests. This snippet is robust and includes UTF-8 handling and header name flexibility.
What /init typically produces
  • Claude inspects repository files and creates CLAUDE.md with project metadata, usage instructions, and developer notes.
  • It may propose turning a single-purpose script into a package with packaging files, a test suite, a CLI entrypoint, and CI configuration.
  • When Claude proposes changes, it displays interactive edit prompts so you can accept, decline, or modify suggested edits.
Example interactive prompt (cleaned for readability):
Typical content added to CLAUDE.md
  • Short project description, e.g. “Simple Python project that processes member data from a CSV file”.
  • Runtime & development instructions: Python version, virtual environment activation, and how to run the main script.
  • Short architecture summary: single-purpose script vs package, suggested package layout.
  • Suggested next steps: add pyproject.toml/setup.py, tests, CLI, and CI/CD setup.
Scaffolding a package Claude often suggests a package layout. Below are representative, corrected snippets you might find in the suggestions. They show how small scripts can become a maintainable package with tests and tooling. Files and purpose (summary) Example __init__.py for csv_member_reader:
Example exceptions.py:
Example reader.py (core functionality with dataclass):
Example pyproject.toml excerpt (tooling & testing hints):
CLI helper example (cli.py start):
Example CLI usage script (examples/basic_usage.sh):
Testing
  • Claude can scaffold pytest tests. Example test below verifies the package handles header variations like first_name or First Name.
Common development commands to add to CLAUDE.md
Common issues and verification steps
  • Generated instructions may assume a particular environment or layout. Always open CLAUDE.md and confirm commands before running.
  • If you get ModuleNotFoundError: No module named 'csv_member_reader', ensure you installed the package in editable mode (pip install -e .) or that your PYTHONPATH includes the project root.
  • Mypy errors such as “Source file found twice under different module names” usually indicate package layout or duplicate top-level folders; verify pyproject.toml and source layout.
Generated scaffolding is a strong starting point but not a guarantee of a fully working configuration. Validate tests, linter settings, and packaging instructions before publishing. If Claude suggests commands you don’t understand (for example, pip install -e ".[dev]"), consult the relevant docs and adapt commands for your OS (on macOS you may need pip3).
Wrap-up
  • Run /init to generate CLAUDE.md and let Claude analyze and propose repository changes.
  • Be explicit in prompts; treat Claude as a developer who needs clear requirements.
  • Review and validate any generated package layout, pyproject.toml, tests, and CI before publishing.
  • Use Claude to accelerate repetitive scaffolding (package boilerplate, tests, CLI, docs), but always review and iterate.
Links and references This is how you start your first session: let Claude handle repetitive scaffolding while you validate, test, and refine the generated project structure.

Watch Video