A demo showing how Claude Code initializes a repository, generates CLAUDE.md, and scaffolds a production-ready Python package from a simple CSV reader script with tests, tooling, and CI
All right — let’s walk through starting your first Claude Code session, analyzing a repository, and scaffolding a production-ready Python package from a simple script.
Quick practical tips for a productive first session:
Run /init to generate a CLAUDE.md file that guides Claude Code for repository-specific actions.
Use Claude Code to analyze files, suggest edits, run bash commands, and help with git workflows.
Be explicit in prompts — include expected behavior, sample inputs/outputs, and any constraints to get precise results.
Be explicit as you would be with another developer — include expected behavior, example inputs/outputs, constraints, and any style or tooling preferences (e.g., black, mypy).
The demo repository starts as a single-file Python script that reads member names from a CSV. It demonstrates basic error handling and flexible header parsing.
Copy
# members_reader.pyimport csvdef read_members(): try: with open('members.csv', 'r', newline='', encoding='utf-8') as file: reader = csv.DictReader(file) for row in reader: first_name = row.get('first_name', row.get('First Name', '')) last_name = row.get('last_name', row.get('Last Name', '')) print(f"{first_name} {last_name}") except FileNotFoundError: print("Error: members.csv file not found") except Exception as e: print(f"Error reading file: {e}")if __name__ == "__main__": read_members()
Scans the repository for files (e.g., package.json, pyproject.toml, requirements, Python sources).
Generates a CLAUDE.md file describing the project, usage, and recommended next steps.
Proposes interactive edits and scaffolding; each change requires your confirmation.
Example interactive prompts you may see while accepting edits:
Copy
Read README.md for important project informationCreate CLAUDE.md file with essential information• Write(CLAUDE.md)Opened changes in Visual Studio CodeSave file to continue...Do you want to make this edit to CLAUDE.md?> 1. Yes 2. Yes, and don't ask again this session (shift+tab) 3. No, and tell Claude what to do differently (esc)
Add pyproject.toml or setup.py for builds and publishing
Project docs
README, CONTRIBUTING, docs for usage and developer guide
Testing & linting
pytest, mypy, black, pre-commit
CLI & workflows
CLI entry point and GitHub Actions for CI/CD
Typical CLI-style prompts for confirming filesystem changes:
Copy
Bash(mkdir -p csv_member_reader/{csv_member_reader,tests,examples,docs})└ Running...Bash command:mkdir -p csv_member_reader/{csv_member_reader,tests,examples,docs}Create proper Python package directory structureDo you want to proceed?> 1. Yes 2. Yes, and don't ask again for mkdir commands in /Users/jeremy/demos/my-awesome-project 3. No, and tell Claude what to do differently (esc)
If you accept, Claude Code will write new files such as __init__.py, exceptions.py, and reader.py. Below are representative, production-oriented excerpts that illustrate the refactor.
"""Custom exceptions for CSV Member Reader."""class CSVMemberReaderError(Exception): """Base exception for CSV Member Reader.""" passclass FileNotFoundError(CSVMemberReaderError): """Raised when the CSV file is not found.""" passclass InvalidDataError(CSVMemberReaderError): """Raised when the CSV data is invalid or malformed.""" pass
ModuleNotFoundError: No module named ‘csv_member_reader’
Package not installed in editable mode or PYTHONPATH misconfigured
Run pip install -e . from the package root or adjust PYTHONPATH
mypy reports duplicate module paths
Ambiguous package layout or init.py placement
Ensure consistent package layout and use explicit mypy options like --explicit-package-bases
pre-commit install fails
Not inside a git repository
Initialize git (git init) before installing pre-commit hooks
Note: On macOS, if your system Python maps to Python 2.x, use pip3:
Copy
pip3 install -e ".[dev]"
Claude Code can generate many useful files and CI scaffolding, but always review generated code, dependency versions, and CI settings. Validate and test changes before committing or publishing.
The typical first session: run /init, review and refine CLAUDE.md, and confirm proposed edits.
Claude Code can scaffold package layout, tests, CLI, docs, and CI — but you must review and iterate on suggestions.
Treat Claude Code as an assistant: provide explicit requirements and verify all generated artifacts before publishing.
The demo illustrated how a simple CSV-reading script can be analyzed and progressively refactored into a production-ready package using Claude Code. Use the patterns above to guide your own repository bootstrap and development workflow.