Skip to main content

Automation Track

This track covers automating repetitive tasks with scripts and Claude Code assistance—file organization, report generation, and scheduled workflows.

The Automation Mindset
If you do it more than twice, automate it

What You'll Automate

Task TypeTime SavedWhat You'll Build
File organization2-5 hrs/weekSmart file sorter
Report generation3-8 hrs/weekAuto-reporter
Data pipelines5-20 hrs/weekETL automation
Scheduled backupsPeace of mindBackup scripts
Code formattingOngoing frictionVS 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.

File Organizer Flow

Build It with Claude

Bash
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

Bash
# First, see what would happen (safe!)
python organize.py --dry-run
# If it looks good, run it for real
python organize.py
# Check what was moved
cat organize.log

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.

Report Pipeline

Build It with Claude

Bash
Create a weekly sales report generator:
1. Read data from sales.csv
2. Calculate KPIs:
- Total revenue
- Week-over-week growth
- Top 5 products
- Regional breakdown
3. Generate charts with matplotlib:
- Revenue trend line
- Product pie chart
- Regional bar chart
4. Create a professional PDF report
5. 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

Bash
Extend the report generator to email the PDF:
1. Use smtplib for sending
2. Attach the PDF
3. Send to team@company.com
4. Include summary stats in email body
5. Use environment variables for credentials

Project 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

Bash
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

Bash
# 1. Preview what will happen
python 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 it
python renamer.py
# 3. Made a mistake? Undo!
python undo_rename.py

Project 4: Data Pipeline

The problem: Manual data processing is slow, error-prone, and mind-numbing.

The solution: An automated ETL (Extract, Transform, Load) pipeline.

ETL Pipeline Architecture

Build It with Claude

Bash
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

Bash
# Run manually
python pipeline.py
# Or schedule daily at 6 AM
# crontab: 0 6 * * * python /path/to/pipeline.py

VS Code Task Automation

Automate your development workflow right inside VS Code.

Create tasks.json

Bash
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

JSON
{
"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:

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

When to Run What

Cron Syntax Quick Reference

ScheduleExpressionExample Use
Every minute* * * * *Health checks
Every 5 minutes*/5 * * * *Data sync
Every hour0 * * * *Log rotation
Daily at 9 AM0 9 * * *Morning reports
Monday at 9 AM0 9 * * 1Weekly summary
First of month0 9 1 * *Monthly cleanup

Cron Commands

Bash
# Edit your cron jobs
crontab -e
# List current jobs
crontab -l
# Remove all jobs (careful!)
crontab -r

Best Practices

1. Always Test First

Python
# Every automation script needs this
import 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

Python
import logging
from 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

Python
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 file

4. Use Absolute Paths

Scheduled tasks run from different directories. Always use absolute paths:

Python
import os
# Get the directory where the script lives
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
# Build paths relative to script
DATA_PATH = os.path.join(SCRIPT_DIR, 'data', 'input.csv')
OUTPUT_PATH = os.path.join(SCRIPT_DIR, 'output', 'report.pdf')

5. Version Control Your Scripts

Bash
# Initialize git for your automation scripts
git init automations
cd automations
git add .
git commit -m "feat: add file organizer script"
# Now you can track changes, rollback mistakes, share with team

Troubleshooting

Script Not Running on Schedule

Permission Errors

Bash
# Make script executable
chmod +x myscript.py
# Check who owns the file
ls -la myscript.py
# Run with explicit Python
python3 /full/path/to/myscript.py

Environment Issues

Scripts run by cron don't have your shell environment:

Bash
# In crontab, set PATH explicitly
PATH=/usr/local/bin:/usr/bin:/bin
# Or use full paths to executables
0 9 * * * /usr/bin/python3 /home/user/scripts/report.py

Practice Projects

Ready to automate more? Try these:

ProjectDifficultyWhat You'll Learn
Email SorterMediumGmail API, rules engine
Backup ScriptEasyFile operations, cloud sync
Web ScraperMediumHTTP requests, parsing
API MonitorMediumHealth checks, alerts
Invoice GeneratorHardPDF generation, templates

Start Here

Bash
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. 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. 2

    Build Your Toolkit

    Start a folder of automation scripts. Version control it. Add to it whenever you find yourself doing something repetitive.

  3. 3

    Level Up


Resources