I Handed My 15-Minute Morning Chore Over to an AI, Start to Finish
A hands-on log of automating daily copy-paste, file wrangling, and checks just for you.
Every morning, before I even made coffee, I did the exact same chore.
Open the folder, check yesterday’s logs, eyeball whether any tests broke, paste the diffs that bugged me into a notepad. Each step takes a minute. But all of them together? My coffee was cold by the time I finished. Every day. Every weekday, for ages.
One morning it just hit me: “Wait — do I actually need to be doing this?”
Short answer: no, I didn’t. That routine now gets finished by a tiny script while I’m washing my face. More carefully than I ever did it, too. Today I’ll walk through exactly how, code and all.
”Automation” isn’t just a developer thing
Say “automation” and people picture something intimidating — CI/CD, deploy pipelines, all that. But I’m talking about something way more humble.
That mindless copy-paste you do by hand every single day. Get something else to take it off your plate.
Stuff like this. Pull numbers out of a few files and line them up in a table. Reformat notes into a fixed shape. Lay yesterday and today side by side to see what changed. Surface notes that have gone stale. None of it is “thinking” work — it’s “move your eyes and fingers” work. Humans flub it, get bored by it, and above all, it quietly eats time.
This is exactly where AI — specifically Claude Code — shines. There’s only one rule. Don’t dump the whole thing on the AI. “Just handle it nicely” is how accidents are born (my own war stories below will prove it). Instead, decide up front what it reads, what it does, and what it must never touch — then hand over only the repetitive part. That one habit changes everything.
By the way, the word “harness” comes up a lot here. Literally it means the gear you strap on a horse, but really it’s the outer frame that keeps the AI from bolting. What goes in, how far it’s allowed, how it gets logged, how it stops when things go wrong. Just remember: you build that frame first.
What to delegate, and where to keep your own eyes
Before you delegate, draw one line — just once. Skip this and things look faster but bite you later. My recommendation is four tiers.
| Tier | What the AI handles | What you watch |
|---|---|---|
| Survey | Summarize logs, diffs, file contents | Importance and what order to tackle |
| Organize | Unify formatting, build tables, draft | The judgment calls and the final OK |
| Inspect | Flag failing tests, stale notes, odd diffs | Which flags you actually act on |
| Execute | Routine generation and copy work | The delete / send / publish button |
The line is simple. If it’s reversible, delegate it. If it’s irreversible, press the button with your own finger. Delete, send, charge money, publish. Set all four to “ask me first” at the start. Only promote the ones you’ve confirmed are safe to automatic later. Do it in the wrong order and you’ll cry.
I dig deeper into how to draw this line in how to build approvals and sandboxes, so read them together if you want it to really click.
Let’s run it: handing off the morning check
Enough preamble — let’s run a real thing. I’ll turn my old “read the logs and tests, then jot down what to watch out for today” routine straight into a script. You need Node.js and an Anthropic API key.
Save it as scripts/morning-check.mjs. I’ve kept all the comments in plain language.
#!/usr/bin/env node
import { spawnSync } from "node:child_process";
import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
import { join } from "node:path";
const logDir = ".claude-logs";
const lockFile = join(logDir, "morning.lock"); // the key that prevents a double run
const stamp = new Date().toISOString().replace(/[:.]/g, "-");
const logFile = join(logDir, `morning-${stamp}.log`);
function fail(message) {
console.error(message);
process.exit(1);
}
// A tiny helper to run a command and take its output as-is
function run(command, args, options = {}) {
const result = spawnSync(command, args, {
encoding: "utf8",
shell: process.platform === "win32", // a little charm so it runs on Windows too
...options,
});
const output = `${result.stdout || ""}${result.stderr || ""}`;
if (result.status !== 0) {
writeFileSync(logFile, output);
fail(`Command failed: ${command} ${args.join(" ")} / details in ${logFile}`);
}
return output;
}
// If you forgot the key, stop without doing anything (this matters)
if (!process.env.ANTHROPIC_API_KEY) {
fail("Set ANTHROPIC_API_KEY first.");
}
mkdirSync(logDir, { recursive: true });
if (existsSync(lockFile)) {
fail(`A previous check is still running: ${lockFile}`);
}
writeFileSync(lockFile, String(process.pid));
try {
// 1. Gather the current state (this is just commands, not the AI)
const status = run("git", ["status", "--short"]);
const tests = run("npm", ["test"]);
// 2. Hand the gathered material to the AI and ask only for today's watch-points
const prompt = [
"You are my morning check clerk.",
"Read the git status and test results below, and list what to watch out for today as bullet points.",
"Do not change, delete, commit, or send any code. Read only.",
"Group them under: Auth / Double-run / Rollback / Logs / Needs human judgment.",
"",
"git status:",
status || "(no changes)",
"",
"test output (tail only):",
tests.slice(-12000), // don't hand over the whole log. the tail is plenty
].join("\n");
const report = run("claude", [
"-p", prompt,
"--max-turns", "5",
"--permission-mode", "plan", // read-only mode. don't let it rewrite anything
"--output-format", "text",
]);
writeFileSync(logFile, report);
console.log(`Wrote today's check notes -> ${logFile}`);
} finally {
rmSync(lockFile, { force: true }); // always remove the key when done
}
Running it is just this.
node scripts/morning-check.mjs
A few dozen lines, but it already contains “gather material,” “hand to the AI,” “restrict to read-only,” “lock against double runs,” and “save logs.” That’s the skeleton of automation. If your morning routine is different, just swap the git status and npm test parts for whatever commands you usually type. I wrote it so it runs even if you copy-paste without understanding the internals — but once you’re comfortable, get your hands in there.
Where this pays off (three cases)
1. Merging scattered files into one sheet Seven invoice CSVs, dumped across a folder. Every month I’d open them by hand and total them up. Paste one into Excel, add, double-check, repeat. About 20 minutes. And last month I reported a figure that was off by a digit because of a copy slip — turned beet red later. Now it’s “read every CSV in this folder, and table up the total plus only the rows that stray far from the average.” When a human punches a calculator, they shift a digit. The machine doesn’t. The double-checking step vanished along with the errors.
2. Laying yesterday and today side by side When you only want to know “what changed” between a config file and yesterday’s backup. Reading the whole thing top to bottom is hell — your eyes just slide off where the differences are. So I have it pull out only the diffs, and I decide whether each one is a meaningful change or just a typo. I don’t hand the AI the judgment — only the job of finding the changes. Three minutes of eyeballing became five seconds.
3. Tidying messy notes into a fixed format Scribbled meeting notes. Random dates, no headings, riddled with typos, arrows that mean nothing. I ask it to “reformat this to match the template I set, but don’t add a single thing to the content.” The key here: don’t have it write from scratch — have it fix only the shape. Say “summarize this nicely” and the AI cheerfully invents things you never said. Pin it down with “shape only.” That alone stops it from padding your notes with fiction.
Three accidents I caused myself
No posturing here. My first automations were a string of accidents.
One. I dumped the whole thing with “just tidy this up.” The result: the AI helpfully “tidied” config files that should never have been deleted. The working code survived, but that morning the blood drained out of my face. .env was gone, the service wouldn’t start, and recovery took an hour. Ever since, I always specify the allowed range up front — “only inside this folder,” “do not touch this file.” Don’t expect the AI to read your mind.
Two. I crammed the entire log into the prompt. Trying to be helpful, I handed over tens of thousands of lines — and the one failing line got buried, so the AI pointed at a totally wrong spot and went “here’s your problem.” Only the cost and the time ballooned, and I ended up re-reading it myself. Now, like the code above, I pass only the tail with slice(-12000). The error shows up at the end. The AI reads the last few lines most closely too. So the tail is enough.
Three. I ran the same script twice at once. I botched the task scheduler config and the morning check fired twice, almost simultaneously. The logs overwrote each other and I couldn’t tell which was real. The worst case is when it’s a “writing” job — you generate the same note twice and then delete the duplicate by hand afterward. Once I added a lock file (the key), the later run got bounced with “a previous one is still running” — solved in one move. A three-line trick, but without it you get burned on exactly the busy mornings.
If you’re starting out, start here
Don’t aim for full automation right away. Pick one small task you won’t cry over if it breaks. The morning check, totaling files, tidying notes. That’s the right size.
The steps are always the same. (1) Narrow the scope of what it reads. (2) Put the goal — the finished result — into clear words. (3) Push verification onto commands as much as you can. (4) Pin delete / send / charge / publish to “ask the human.” Only promote the operations you’ve grown confident are safe to automatic, later. Just following that order cuts accidents down by a shocking amount.
Once you want it to run at a fixed time every day, register it with cron or Task Scheduler.
# Linux/macOS: run at 8:15 on weekday mornings
15 8 * * 1-5 cd /path/to/repo && /usr/bin/node scripts/morning-check.mjs >> .claude-logs/cron.log 2>&1
# Windows: register in Task Scheduler to run daily at 8:15
schtasks /Create /TN "MorningCheck" /SC DAILY /ST 08:15 /F /TR "powershell -NoProfile -ExecutionPolicy Bypass -Command \"cd C:\path\to\repo; node scripts\morning-check.mjs\""
For what to look at when it stops, and what fine-grained arguments like --permission-mode actually mean, the official CLI reference is the primary source. When you’re stuck, look there first and save yourself a detour. If you trip on the very first step, skim Claude Code: the first 30 minutes too.
What actually happened when I tried it
Honestly? For the first week the script was slower than doing it by hand. It stopped because I forgot the key, returned weird answers because the log was too long, the scheduler didn’t fire at all. I fixed every bit of it by hand.
But from week two, it started clicking. Now when I wash my face and get back to my desk, .claude-logs has just three to five lines on what to watch today. Like “tests green, but this dependency is old” or “there’s a file in the diff I don’t remember deleting — needs a look.”
The best part was that the daily dread disappeared. The time I used to spend grinding through the same chore out of habit is gone, and I can put it toward work that actually uses my head. Rather than hunting for a smarter AI, hand off your annoying five minutes to the machine, one at a time. It’s unglamorous, but it’s what worked best.
Wrapping up
Automation isn’t some grand thing like deployment. It’s getting a machine to take over the mindless copy-paste you do by hand every day. That’s it.
Three knacks. Narrow the scope of what it reads. Put the finished result into words. Press only the irreversible operations with your own finger. Start by adapting the script above to your own work, and shave one five-minute chore off tomorrow morning.
If you want to learn this more systematically, or automate a whole team’s work at once, the materials list has hands-on, learn-by-doing resources. And if you want to talk through your own case, reach out from there.
Free PDF: Claude Code Cheatsheet
Enter your email and download the one-page Claude Code cheatsheet for commands, review habits, and safe workflows.
We handle your data with care and never send spam.
Level up your Claude Code workflow
Start with the free PDF, use Gumroad guides when you need repeatable workflows, and book consultation when rollout or revenue paths need human judgment.
About the Author
Masa
Engineer focused on practical Claude Code workflows. Runs claudecode-lab.com, a 10-language technical media site.
Related Posts
Claude Code Free PDF Funnel Checklist: Turn Article Traffic into Signups and Product Clicks
A Claude Code checklist for routing article readers to the free PDF, Gumroad products, and consultation.
Claude Code Obsidian to CLAUDE.md Workflow: Stop Re-explaining Context
Turn Obsidian working notes into concise CLAUDE.md operating notes that make Claude Code sessions easier to resume.
Claude Code Revenue CTA Routing: Send Articles to PDF, Gumroad, and Consultation
A Claude Code workflow for routing article readers to the free PDF, Gumroad products, or consultation by intent.
Related Products
Claude Code Quick Reference Cheatsheet
A free one-page reference for daily Claude Code work.
Keep the essential commands, file-reference patterns, CLAUDE.md reminders, prompting habits, review cues, and debugging workflow notes next to your editor.
50 Battle-Tested Claude Code Prompt Templates
Copy, paste, ship. 50 production-ready prompts.
Use proven prompts for code review, refactoring, testing, documentation, debugging, architecture, and incident response.