Setting Up Local Automation — A Step-by-Step Guide With the clearxx Assistant
The two earlier guides covered the theory: when Cline should write a script instead of reasoning through something, and when a task should live on your own computer instead of inside clearxx at all. This guide is the practical follow-up. It shows the actual workflow for getting a local script built and running — including the question of who actually writes it, the clearxx Assistant or Cline — with the clearxx Assistant guiding you through every step it can help with.
You do not need a technical background to follow this guide. Each step includes a short, concrete example.
The Workflow, in One Table
| Step | What happens | Who does it |
|---|---|---|
| 1. Decide | Confirm this should actually be a local script | You, with the clearxx Assistant |
| 2. Structure | Agree on a folder structure the script can rely on | You, with the clearxx Assistant |
| 3. Naming | Agree on a naming convention for your files | You, with the clearxx Assistant |
| 4. Draft | Decide who writes it, then write and check the script | The clearxx Assistant, or possibly Cline |
| 5. Set up | Install and save the script on your computer | You |
| 6. Run | Decide whether it runs manually or on a schedule | You |
| 7. Fix and improve | Bring problems back to the chat | You, with the clearxx Assistant |
The rest of this guide walks through each step.
Step 1: Decide Whether This Should Be a Local Script
Before anything else, confirm the task actually belongs on your own computer rather than inside clearxx. Read the Article clearxx vs Your local Computer — Where Should the Work Actually Run? to understand if you actually want to build a local script. If the same steps repeat every time, with no judgment involved, and speed or running offline or unattended actually matters, a local script is the right call.
"I do the same automation and folder setup for every new client — same subfolders, same document checklist. Should this be a script?"
The clearxx Assistant can confirm this in a sentence, since the pattern matches "same steps, no exceptions" directly.
Step 2: Agree on a Folder Structure
A script only works as well as its assumptions about where things live. If today a contract sits in one folder and tomorrow it sits somewhere else, the script has no way to know that changed — it will either fail loudly or, worse, quietly look in the wrong place. Fixing this is not something the script can do for you. It has to be decided before the script is written.
This is exactly the kind of decision the clearxx Assistant is good at helping you think through, because it is planning, not execution — no terminal needed for this part at all.
Example — an HR consultant setting up client onboarding:
You: I want to automate part of new-client onboarding. Right now every client's documents just end up loose in one big folder. Help me design a proper structure before we build anything.
clearxx Assistant: A structure that a script can rely on needs to be predictable rather than just organized. Here is a starting point:
Clients/ [ClientName]/ 01_Contracts/ 02_Onboarding_Forms/ 03_ID_Documents/ 04_Correspondence/A few questions before this is final: should the client folder be named by company name or by a client number, in case two clients share a name? And should there be a year subfolder inside each category, or is each client a single ongoing folder?
Notice what happened here: the chat did not just hand over a folder tree. It flagged the one decision — company name versus client number — that would break a script later if left ambiguous. That is the kind of thing worth catching now, before anything gets built on top of it.
Step 3: Agree on a Naming Convention
Folder structure tells a script where to look. Naming convention tells it what to expect once it gets there. The two go together, and skipping this step is one of the most common reasons a working script suddenly stops working a few weeks later.
| Weak (a script cannot rely on this) | Reliable (a script can parse this every time) |
|---|---|
scan (3) copy.pdf |
Vertrag_Muellermann_2025-03-14.pdf |
final_v2_USE THIS ONE.docx |
Angebot_Voss-Partners_2025-Q1.docx |
Kopie von IMG_2931.jpg |
Ausweis_Voss_2025-03-14.jpg |
The right-hand column is not stricter for its own sake — every part of it is something a script can reliably split apart: the document type, the client, and the date, always in the same order, always separated the same way. A script written against the left-hand column would need a special case for every new way a file happens to get named, which defeats the point of writing it once.
You: From now on, every document should be named
[Type]_[Client]_[Date].pdf, with the date as YYYY-MM-DD. Can you check this convention will actually work for a script that sorts these into the folders we just designed?clearxx Assistant: That works well, with one addition: months and days need a leading zero (03, not 3), or a script sorting by date will put "March" after "November" instead of before it. Do you want underscores between all four parts, including inside multi-word client names, or should client names keep their spaces?
Step 4: Decide Who Writes the Script, Then Write and Check It
The folder structure and naming convention are settled. Before asking for the script itself, there is one more decision the clearxx Assistant can help with: should the Assistant write the script directly, as code in a final file you can use locally, or should Cline build it instead? If you are not sure, ask the Assistant first.
Ask the clearxx Assistant to write it directly for anything short and simple — a script the Assistant can reason through in one pass, with little room for it to go wrong. The trade-off is that the Assistant cannot run what it writes. It has no terminal, so the very first time this script actually executes will be on your own computer, in Step 5.
Ask Cline to build it instead for anything longer, more complex, or important enough that you want it proven to work before it ever touches your real files. Cline has a terminal, so it can write the script, run it against sample files inside the clearxx Agent & Build Workspace, see the real result, and fix anything that goes wrong — all before you install a single tool on your own computer.
Since the clearxx Assistant cannot hand a task to Cline on its own, ask it to write the prompt for you to paste into Cline:
You: This script feels like it should go to Cline instead of you writing it directly — can you write me a prompt for Cline?
clearxx Assistant: Here is a prompt for Cline:
"Write a Python script that reads every file in an 'Inbox' folder and moves it into the matching client folder and category, based on the filename pattern
[Type]_[Client]_[Date].pdf. Test it against a few sample files with different clients and document types before confirming it works. Any file that does not match the pattern should be skipped and listed, not guessed at."Paste this into Cline in the Agent & Build Workspace. Once it confirms the script works against its test files, bring the finished script back here and I will check it over before you install anything.
Remember that you need to get or create sample files which Cline can use the check the script, if that's what you want.
That last sentence (Paste this into Cline...) matters. Cline verifying a script runs is not the same as the clearxx Assistant confirming it still matches what you actually agreed on in Steps 2 and 3 — Cline can build something that works perfectly and still drifts from your naming convention in a small way nobody asked for. Paste the finished script back into the chat and ask the Assistant to check it against the plan efore you install anything on your own computer.
You: Here is the script Cline built. Does it match the folder structure and naming convention we agreed on?
clearxx Assistant: Yes, with one thing worth flagging: it treats a missing date as today's date instead of skipping the file the way we agreed. Ask Cline to change that before you install anything locally.
Whichever route you take, a well-drafted script includes one particular safeguard worth checking for either way: doing nothing rather than guessing wrong when a file does not match the expected pattern. If a draft does not mention what happens to a file that breaks the naming rule, ask directly — this is worth catching before you ever run it.
Step 5: Set Up the Tool and Save the Script
This step happens entirely on your own computer. If you have not already installed some tools, like Python, locally on your computer, follow the steps in that Guide Article.
- Install the tool the script needs — usually Python, following the step-by-step instructions in that guide.
- Save the script you ended up with — whether the Assistant wrote it directly or Cline built and tested it — into a file, in the folder you agreed on in Step 2.
- Run it once, on a small test batch — two or three files, not your entire archive — and check the result before trusting it with everything.
That last point matters enough to repeat: never point a new script at your full set of real files the first time. A folder structure and naming convention remove most of the guesswork, but "most" is not "all," and a quick test costs a minute against a mistake that could cost an afternoon to undo.
Step 6: Decide How and When It Runs
There are two honest options, and the right one depends entirely on how often the task comes up.
Run it yourself, when you need it. For anything that happens a few times a week or less, just open PowerShell or Terminal and run it directly, the same way you tested it in Step 5. There is no need to automate the trigger if you are the one deciding when it should run.
Let the computer run it automatically, on a schedule. For something that should happen every night or every week without you remembering to start it:
- Windows: open Task Scheduler (press the Windows key, type
Task Scheduler, press Enter), choose "Create Basic Task," and follow the wizard to set a time and point it at your script. - macOS: open Automator (press Cmd + Space, type
Automator, press Enter), create a new "Calendar Alarm" document, add a "Run Shell Script" action pointing at your script, and save it — macOS will then trigger it through the Calendar app at the time you set.
Both of these are graphical tools — no extra command-line work is needed to schedule something once the script itself is working.
Step 7: Bring Problems Back to the Chat
A script that worked perfectly for months can still break — a client renames their company, a colleague saves a file with a typo in it, a new document type shows up that nobody planned for. When that happens, the fix almost always starts back in the chat, not by guessing at the code yourself.
You: The script stopped moving files for one client. Here is the exact error message it showed: [paste the error]
clearxx Assistant: This error means the script found a filename it could not parse — most likely a file that does not follow the
[Type]_[Client]_[Date]pattern. Here is an updated version that also logs which specific file it could not read, instead of just stopping, so this is easier to catch next time.
Paste the exact error message, not a description of it — the chat can work with the real text far more precisely than with "it just didn't work."
Save the Decisions, Not Just the Script
Once your folder structure and naming convention are settled, write
them into USER.md or AGENTS.md, the way earlier guides in the
Tools section describe. That way, the next time you ask the clearxx
Assistant to draft a script — a different one, for a different task —
it already knows your structure and naming rules without you
re-explaining them from scratch.
Don'ts
- Don't skip Steps 2 and 3 to get to the script faster. A script built before the structure exists almost always has to be rewritten once real files stop matching what it silently assumed.
- Don't let the chat guess your naming convention. State it explicitly, or agree on one together — guessing wrong here is invisible until something files into the wrong place.
- Don't run a new script on your full archive the first time. Test on a handful of files first, every time, no exceptions.
- Don't skip the Assistant's check just because Cline confirmed the script runs. Working and matching your agreed structure are two different things — Cline verifies the first, the Assistant is better placed to verify the second.
- Don't try to fix a broken script yourself before asking the chat. Paste the actual error message back into the chat first — that is almost always faster than guessing.
Simple Rule of Thumb
Decide together in the chat, build together in the chat, run it yourself on your computer.
The chat plans the structure, drafts the naming rules, and writes the script. Your computer is where it actually lives and runs. Keeping that boundary clear is what makes this whole workflow reliable.