Automation Track
Automate repetitive tasks with scripts and Claude assistance
This track covers automating repetitive tasks with scripts and Claude Code assistance — file organization, report generation, and scheduled workflows. Build four real automation projects that save hours every week.
The Math of Automation
A 5-minute daily task costs you 30+ hours per year. Spend 2 hours automating it, and you've saved 28 hours—every year, forever. That's not just efficiency; it's compound interest on your time.
What You'll Automate
| Task Type | Time Saved | What You'll Build |
|---|---|---|
| File organization | 2-5 hrs/week | Smart file sorter |
| Report generation | 3-8 hrs/week | Auto-reporter |
| Data pipelines | 5-20 hrs/week | ETL automation |
| Scheduled backups | Peace of mind | Backup scripts |
| Code formatting | Ongoing friction | VS Code tasks |
Prerequisites
- Completed Start Here track
- Basic Python or Bash familiarity (or willingness to learn!)
- Terminal/command line comfort
Project 1: File Organizer
The problem: Your Downloads folder is chaos. Hundreds of files, no organization, can't find anything.
The solution: A smart script that sorts files automatically by type and date.
Build It with Claude
Write a Python script to organize my Downloads folder:- Move images (.jpg, .png, .gif, .webp) to Pictures/- Move PDFs to Documents/PDFs/- Move videos (.mp4, .mov, .mkv) to Videos/- Move code files (.py, .js, .ts) to Projects/- Create dated subfolders (2025-01/)- Keep a log of everything moved- Include --dry-run mode to preview changes Make it safe: never overwrite existing files.Expected Features
Claude will create a script with:
- File type detection — Extensions + MIME types for accuracy
- Safe moves — Renames conflicts instead of overwriting
- Dry run mode — See what would happen before committing
- Detailed logging — Track every action for debugging
- Configurable rules — Easy to customize for your needs
Run It
# First, see what would happen (safe!)python organize.py --dry-run # If it looks good, run it for realpython organize.py # Check what was movedcat organize.logSafety First
Always use --dry-run first. Never run file operations on important folders without testing. Once a file is in the wrong place, finding it is painful.
Make It Automatic
Project 2: Report Generator
The problem: Every week, you pull the same data, make the same charts, format the same PDF. It takes hours.
The solution: One command generates everything automatically.
Build It with Claude
Create a weekly sales report generator: 1. Read data from sales.csv2. Calculate KPIs: - Total revenue - Week-over-week growth - Top 5 products - Regional breakdown3. Generate charts with matplotlib: - Revenue trend line - Product pie chart - Regional bar chart4. Create a professional PDF report5. Save as weekly_report_YYYY-MM-DD.pdf Use Python with pandas and matplotlib.Handle missing data gracefully.Include error handling and logging.Output Structure
- weekly_report_2025-01-15.pdf
- weekly_report_2025-01-08.pdf
- revenue_trend.png
- top_products.png
- regional_breakdown.png
- report.log
Schedule It
Add Email Notification
Extend the report generator to email the PDF:1. Use smtplib for sending2. Attach the PDF3. Send to team@company.com4. Include summary stats in email body5. Use environment variables for credentialsProject 3: Batch File Renamer
The problem: 500 photos named IMG_1234.jpg, IMG_1235.jpg... Useless for finding anything.
The solution: Smart renaming with dates, sequences, and undo capability.
Build It with Claude
Create a batch file renamer: Features:- Rename IMG_1234.jpg to 2025-01-15_photo_001.jpg- Extract date from file metadata (EXIF for photos)- Add sequential numbering- Preview mode (show old → new before changing)- Generate an undo script- Handle duplicates safely- Support custom patterns via config file Include comprehensive error handling.Safe Workflow
# 1. Preview what will happenpython renamer.py --preview # Output:# IMG_1234.jpg → 2025-01-15_photo_001.jpg# IMG_1235.jpg → 2025-01-15_photo_002.jpg# ... # 2. If it looks right, do itpython renamer.py # 3. Made a mistake? Undo!python undo_rename.pyProject 4: Data Pipeline
The problem: Manual data processing is slow, error-prone, and mind-numbing.
The solution: An automated ETL (Extract, Transform, Load) pipeline.
Build It with Claude
Create a data pipeline that: 1. EXTRACT - Fetch data from https://api.example.com/data - Retry on failure (3 attempts with backoff) - Log all API responses 2. TRANSFORM - Clean: Remove nulls, fix data types - Validate: Check required fields, ranges - Transform: Calculate derived fields 3. LOAD - Insert into SQLite database - Track processed records - Generate summary statistics 4. NOTIFY - Email on success with stats - Alert on failure with error details Use Python with requests and sqlite3.Include comprehensive logging with timestamps.Run It
# Run manuallypython pipeline.py # Or schedule daily at 6 AM# crontab: 0 6 * * * python /path/to/pipeline.pyVS Code Task Automation
Automate your development workflow right inside VS Code.
Create tasks.json
Create VS Code tasks for my Python project: 1. Run current file (F5)2. Run all tests (Ctrl+Shift+T)3. Format with black (Ctrl+Shift+F)4. Lint with flake8 (Ctrl+Shift+L)5. Deploy to server (Ctrl+Shift+D) Create .vscode/tasks.json with proper keyboard shortcuts.Example Configuration
{ "version": "2.0.0", "tasks": [ { "label": "Run Python File", "type": "shell", "command": "python ${file}", "group": { "kind": "build", "isDefault": true }, "presentation": { "reveal": "always", "panel": "new" }, "problemMatcher": [] }, { "label": "Run Tests", "type": "shell", "command": "pytest tests/ -v --tb=short", "group": "test", "presentation": { "reveal": "always" } }, { "label": "Format Code", "type": "shell", "command": "black ${file}", "presentation": { "reveal": "silent" } } ]}Keyboard Shortcuts
Add to keybindings.json:
[ { "key": "ctrl+shift+t", "command": "workbench.action.tasks.runTask", "args": "Run Tests" }, { "key": "ctrl+shift+f", "command": "workbench.action.tasks.runTask", "args": "Format Code" }]Scheduling Reference
Cron Syntax Quick Reference
| Schedule | Expression | Example Use |
|---|---|---|
| Every minute | * * * * * | Health checks |
| Every 5 minutes | */5 * * * * | Data sync |
| Every hour | 0 * * * * | Log rotation |
| Daily at 9 AM | 0 9 * * * | Morning reports |
| Monday at 9 AM | 0 9 * * 1 | Weekly summary |
| First of month | 0 9 1 * * | Monthly cleanup |
Cron Commands
# Edit your cron jobscrontab -e # List current jobscrontab -l # Remove all jobs (careful!)crontab -rPro Tip
Use crontab.guru to build and verify cron expressions. It shows you exactly when your job will run.
Best Practices
1. Always Test First
# Every automation script needs thisimport argparse parser = argparse.ArgumentParser()parser.add_argument('--dry-run', action='store_true', help='Preview changes without executing')args = parser.parse_args() if args.dry_run: print(f"Would move {src} to {dst}")else: shutil.move(src, dst)2. Log Everything
import loggingfrom datetime import datetime logging.basicConfig( filename=f'automation_{datetime.now():%Y%m%d}.log', level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') logging.info('Starting file organization')logging.info(f'Moved {filename} to {destination}')logging.error(f'Failed to process {filename}: {error}')3. Handle Errors Gracefully
def safe_process(filepath): try: process_file(filepath) logging.info(f'Processed: {filepath}') except FileNotFoundError: logging.error(f'File not found: {filepath}') except PermissionError: logging.error(f'Permission denied: {filepath}') except Exception as e: logging.error(f'Unexpected error with {filepath}: {e}') # Don't crash—continue with next file4. Use Absolute Paths
Scheduled tasks run from different directories. Always use absolute paths:
import os # Get the directory where the script livesSCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) # Build paths relative to scriptDATA_PATH = os.path.join(SCRIPT_DIR, 'data', 'input.csv')OUTPUT_PATH = os.path.join(SCRIPT_DIR, 'output', 'report.pdf')5. Version Control Your Scripts
# Initialize git for your automation scriptsgit init automationscd automationsgit add .git commit -m "feat: add file organizer script" # Now you can track changes, rollback mistakes, share with teamTroubleshooting
Script Not Running on Schedule
Permission Errors
# Make script executablechmod +x myscript.py # Check who owns the filels -la myscript.py # Run with explicit Pythonpython3 /full/path/to/myscript.pyEnvironment Issues
Scripts run by cron don't have your shell environment:
# In crontab, set PATH explicitlyPATH=/usr/local/bin:/usr/bin:/bin # Or use full paths to executables0 9 * * * /usr/bin/python3 /home/user/scripts/report.pyPractice Projects
Ready to automate more? Try these:
| Project | Difficulty | What You'll Learn |
|---|---|---|
| Email Sorter | Medium | Gmail API, rules engine |
| Backup Script | Easy | File operations, cloud sync |
| Web Scraper | Medium | HTTP requests, parsing |
| API Monitor | Medium | Health checks, alerts |
| Invoice Generator | Hard | PDF generation, templates |
Start Here
Help me build a [project name] automation:1. What libraries do I need?2. What's the basic structure?3. How do I handle errors?4. How do I schedule it?5. How do I monitor it's working?What's Next?
- 1
Automate One Thing This Week
Pick the most annoying repetitive task you do. Spend an hour with Claude building a script to automate it. Even if it's not perfect, you'll learn and save time.
- 2
Build Your Toolkit
Start a folder of automation scripts. Version control it. Add to it whenever you find yourself doing something repetitive.
- 3
Level Up
- Data Analysis: Automate data workflows
- App Builder: Build UIs for your automations
- Git & GitHub: Automate your git workflows
Resources
- Automate the Boring Stuff with Python — Free book, perfect for beginners
- Cron Expression Generator — Build and verify cron schedules
- VS Code Tasks Documentation — Official task automation guide
Start Automating!
Pick one repetitive task you did this week. Describe it to Claude. Build a script. Run it. Feel the satisfaction of never doing that task manually again. That's the automation mindset.