Lesson 3Basics
Your First Session
Hands-on introduction
Starting a Session
Open terminal at your project root and run Claude:
$ cd my-project
$ claude
✓ Project detected: my-project
✓ Git repository found
✓ Found CLAUDE.md with instructions
> _
Basic Commands
/helpShow help for commands/clearClear chat history/compactCompress context while keeping essence/modelSwitch model (sonnet, opus, haiku)/costShow token usageCtrl+CInterrupt current operationEscapeCancel current inputNatural Language Interaction
Just describe what you need, as if talking to a colleague:
> Show me the project structure
Analyzing directory structure...
📁 src/
├── components/
├── pages/
└── utils/
📁 src/
├── components/
├── pages/
└── utils/
> Which tests are failing?
Running tests... Found 2 failing tests in auth.test.ts
Editing Files
Claude shows diff before applying changes:
> Add email validation to the registration form
Editing src/components/RegisterForm.tsx
- const handleSubmit = () => {
+ const handleSubmit = () => {
+ if (!validateEmail(email)) {
+ setError('Invalid email');
+ return;
+ }
? Apply changes? [y/n]
Running Commands
Claude can run any commands (with your permission):
> Run tests and fix the errors
? Execute: npm test? [y/n]
y
✓ Tests running
❌ 1 test failed: UserService.test.ts
Analyzing error...
❌ 1 test failed: UserService.test.ts
Analyzing error...
Creating Commits
After making changes, ask Claude to create a commit:
> Commit these changes
Analyzing changes...
Proposed commit:
Proposed commit:
feat(auth): add email validation to registration form
- Add validateEmail helper function
- Implement validation in RegisterForm
- Add error message display
- Implement validation in RegisterForm
- Add error message display
? Create commit? [y/n]
Example Tasks
Fixing a bug
> In auth.ts the login function doesn't handle empty password case. Fix this.
→Claude reads file, finds function, adds validation, shows diff
Writing a test
> Write a unit test for the calculateTotal function in utils.ts
→Claude analyzes function, creates test file, runs verification
Refactoring
> Split UserProfile component into smaller components
→Claude analyzes structure, proposes plan, creates new files
Tips for Your First Session
- •Start with simple tasks to understand how Claude works
- •Be specific in requests — mention files and functions
- •Use /compact if context becomes too large
- •Don't hesitate to interrupt (Ctrl+C) if Claude goes off track