Skip to main content
Early access — new tools and guides added regularly
🟢 Zero to Claude Code — Guide 4 of 6
View track
>_ claude codeBeginner20 min

Build Your First Automation with Claude Code

Write a script that automates a real task — renaming files, processing CSVs, or organising photos. Your first taste of AI-powered productivity.

What you will build
A working automation script that saves you time on a real task

What automation means in practice

Automation is making the computer do repetitive work for you. Not the grand vision of robots running factories — the practical kind. Renaming 200 files so they follow a consistent pattern. Converting a CSV export into a formatted report. Resizing every image in a folder to the right dimensions. Checking a list of URLs to find broken links. These are tasks that take a human 30 minutes to an hour but take a script 5 seconds. Claude Code is the bridge between having an idea for an automation and having a working script. You describe what you want in plain English, and Claude Code writes, tests, and refines the script. You do not need to know any programming language. You need to know what you want the script to do — Claude Code handles the how. The best first automations are tasks you already do manually. Think about your last week: what did you do that was repetitive, tedious, and rule-based? That is your first automation candidate.

Project: bulk file renamer

Let us build something useful. Create a new folder: mkdir ~/projects/file-renamer && cd ~/projects/file-renamer && git init. Start Claude Code: claude. Now say: "Write a Node.js script that takes a folder path as input, finds all files in that folder, and renames them to lowercase-kebab-case. For example, 'My Photo 2024.jpg' becomes 'my-photo-2024.jpg'. The script should show a preview of all renames before executing them, and ask for confirmation." Watch Claude Code work. It will create a script file, add the logic for reading the directory, transforming filenames, showing a preview, and asking for confirmation. It will handle edge cases like duplicate names and already-correct filenames. Test it on a folder of test files (create some dummy files first). Run the script, verify the preview, confirm, and check the results. You just built a reusable tool in minutes that you can use forever. This is the power of automation with Claude Code: describe the task, get a working solution, and keep it for future use.

Project: CSV report generator

Data processing is one of the highest-value automations. Create a new project: mkdir ~/projects/csv-reporter && cd ~/projects/csv-reporter && git init && claude. Say: "Write a Node.js script that reads a CSV file, calculates summary statistics (total rows, min/max/average for numeric columns, most common values for text columns), and outputs a formatted markdown report. It should handle missing values gracefully." Claude Code will create a script that parses CSV, detects column types, computes statistics, and generates a clean report. Test it with any CSV you have — an expense export, a contact list, a sales report. The script works on any CSV structure because Claude Code builds it to detect columns dynamically. Now extend it: "Add a flag that lets the user filter rows where a specific column matches a value. For example: --filter 'status=active'." Claude Code adds the filtering logic. This iterative pattern — build the basic version, then extend it conversationally — is how you build sophisticated automations without writing any code yourself.

Project: image organiser

Here is a practical automation that non-developers love. Create the project folder and start Claude Code. Say: "Write a script that scans a folder of images, reads their EXIF data to find the date taken, and organises them into subfolders by year and month. For example, a photo from March 2024 moves to 2024/03-March/. If there is no EXIF date, put the file in an 'unsorted' folder. Show a preview before moving anything." Claude Code will install the necessary image-processing library, write the script, and handle all the edge cases — images without EXIF data, duplicate filenames in the destination, and permission issues. This is a script that professional photographers pay for in dedicated apps. You just built it for free in 10 minutes. The general pattern for automation projects: start with a clear description of inputs (a folder of images), the transformation (read date, determine destination), and outputs (organised folder structure). The clearer your description, the better Claude Code's first attempt.

Making your automations reusable

A script that only works on your machine is useful. A script that anyone can run is a product. Ask Claude Code: "Turn this script into a proper CLI tool with a --help flag, argument validation, and error messages." Claude Code will restructure the script with a proper argument parser, helpful error messages, and documentation. Now ask: "Add a package.json so someone can install this globally with npm install -g." Claude Code creates the package configuration, sets up the binary entry point, and makes it installable. You now have a command-line tool that anyone can install and use. Take it further: "Add a --dry-run flag that shows what would happen without actually doing it." Safety features like dry-run make automations trustworthy. Store your automations in a Git repository. Over time, you will build a personal toolkit of scripts that save you hours every week. Each one started as a plain English description to Claude Code and evolved into a polished tool through iterative conversation.

Related Lesson

AI Automation Fundamentals

This guide is hands-on and practical. The full curriculum covers the conceptual foundations in depth with structured lessons and quizzes.

Go to lesson