The AI Spotlight Follow
You Can Build a Real AI Agent in Claude Code Without Writing Code. It's Just Three Text Files
AI Agents

You Can Build a Real AI Agent in Claude Code Without Writing Code. It's Just Three Text Files

An inbox agent that labels every email and drafts replies in your voice, built in plain English inside Claude Code and then put on an hourly cloud schedule. Here's the four-level method, the three files that make it work, and the safety settings you shouldn't skip.

Advertisement

Eight unread emails. One slash command. About a minute later, every thread has a label and almost every one has a reply waiting in the drafts folder, written in the owner's voice, down to the smiley face and sign-off.

Nobody wrote code to build that. The agent is a folder, a few plain-English text files and a connection to Gmail, set up inside Claude Code and then put on an hourly schedule in the cloud.

That's the promise of the current generation of agent tools: if you can describe a job clearly, you can delegate it. Here's the four-level method for building your first agent, the three files that do the heavy lifting, and the guardrails that keep it from embarrassing you.

What an "agent" actually means here

A normal AI chat answers your question. You still do the work.

Advertisement

An agent does the work. You give it a job, and it uses your apps and tools to complete it. In this case: read the inbox, decide what each email is, label it, and draft a reply the way you would.

The key insight is that, inside Claude Code, an agent isn't a program. It's instructions plus access plus memory, all stored as files Claude reads before it works.

Level 0: Give your agent a kitchen

When most people use AI, everything ends up scattered across random chats. Every task starts from scratch, and last week's good output is impossible to find.

It's like cooking in someone else's kitchen: half your time goes to opening cabinets. In your own kitchen, you just reach for the pan.

A workspace is your agent's kitchen. It's simply a folder on your computer, named after the job.

Set it up

  1. Create a folder, for example email-agent.
  2. Open the Claude desktop app.
  3. Open the sidebar and switch to the Code tab.
  4. Choose a folder to work in, select your new folder, open it, and confirm you trust the workspace.

That's it. No terminal, no code.

Why a folder matters

Claude Code can create, read and save files inside the workspace. So anything you teach it can persist.

A silly test makes the point. Ask Claude to create a document listing someone's favourite foods (salmon, ribeye steak and soba noodles, say) and save it to the folder. It might produce a styled HTML page. Ask it to switch the file to Markdown instead.

Markdown matters because both humans and AI read it easily. It will be the format for almost everything your agent uses. Now replace "favourite foods" with what a real business needs: client notes, policies, product facts, analytics. Every new session in that folder can draw on them.

Level 1: Connect your tools

A folder only holds what's on your computer. Your email, calendar and CRM live in the cloud. If Claude can't reach them, it can't automate them.

Connectors fix that. In the Claude app, open the sidebar, go to Customize, then Connectors. The directory spans a huge range of business software, from Microsoft's ecosystem to Stripe, Shopify, HubSpot, Salesforce and Monday.com. When one builder checked recently, the directory listed more than 9,600 options.

Connecting is the same everywhere: click connect, then sign in on the service's own authentication page, just as you would normally. For an email agent, that means connecting Gmail and choosing which inbox, ideally a dedicated support inbox rather than your personal one.

Decide exactly what Claude can touch

This is the step people skip and shouldn't. Each connector exposes individual tools, and they come in two types:

  • Read tools let Claude look at information and bring it back, like listing labels or reading drafts.
  • Write and delete tools let Claude act on your account, like creating drafts, sending emails, applying labels or forwarding messages.

For each tool you can choose always allow, needs approval or block.

A sensible starting configuration for an inbox agent:

  • Allow reading emails, creating drafts and applying labels.
  • Block sending.
  • Block forwarding.
  • Block instant replies.

The result: the agent can prepare everything, but a human is always the one who hits send.

One more useful detail: once a connector is linked to your Claude account, it's available in every workspace. You can build a second agent in a different folder that uses the same Gmail connection without reconnecting.

Test the connection before building anything

Before turning the folder into an agent, try something harmless: ask Claude to fetch your five most recent emails and summarise them with sensitive details redacted. If that works, the plumbing is ready.

But note the gap. Claude can now see your inbox. It has no idea how you would answer any of it. That's what the agent is for.

Level 2: Build the agent from three files

Here's the part most people assume requires a developer. It doesn't.

An agent in Claude Code can be just three files in a folder, written in plain English. And you don't even have to write them. You can have Claude interview you and write them itself.

The "agent builder" prompt

Open a new session in the same workspace and give Claude a structured prompt. Paraphrased, the version that works well goes like this:

I want to build an AI agent in this folder. The job I want to hand off is: [describe it in a sentence or two, e.g. "label my emails and write replies in my voice"]. I'm not technical, so explain anything technical in plain words the first time it comes up, and do all the setup for me.

Then spell out five steps:

  1. Interview me about the job. One question at a time, roughly 8 to 12 questions, until you understand how I do it.
  2. Gather examples from my connected tools. If any of them contain past examples of this job done well, tell me what you found and ask before saving anything.
  3. Ask me for anything else you need. Tell me which files would help, such as policies, FAQs, templates, prices or product documentation.
  4. Build the agent as three files inside this folder (details below).
  5. Explain what you made in plain words.

In practice, Claude starts asking things like which email account the agent should work in and what typically lands there. Give it everything. The more context, the more it behaves like a trained employee instead of a generic chatbot.

File 1: CLAUDE.md, the agent's rulebook

CLAUDE.md is an official Claude Code convention. When Claude works in a folder containing one, it loads those instructions every session.

This is where the agent's personality and rules live: who you are, what you sell, how you want things handled, what it must never do. The builder prompt writes it from your interview answers.

Anthropic's docs suggest keeping each CLAUDE.md under about 200 lines. Longer files eat context and reduce how reliably Claude follows them.

File 2: SKILL.md, the step-by-step job

A skill is the second official building block. It's a folder containing a SKILL.md file with two parts:

  • A short header (frontmatter) with a name and a description of when to use it.
  • The instructions: a step-by-step workflow for doing the job the same way every time.

For an email agent, the description might read: labels unread emails and writes draft replies in the owner's voice for review; use when the owner says "do my email," "sort my inbox" or "draft my replies."

The steps might be:

  1. Read CLAUDE.md, the memory file and the reference files (voice guide, product facts, course outline) first, every time.
  2. Fetch unread threads.
  3. Label each one.
  4. Draft a reply in the owner's voice using the examples and references.
  5. Summarise what was done.

Skills in a project live in a hidden folder, .claude/skills/<skill-name>/SKILL.md. On a Mac, press Command + Shift + Period in Finder to reveal hidden folders. The folder name becomes a slash command, so you can run the whole job by typing something like /email-agent.

Once you have a few, slash commands become a personal toolkit. One builder's list includes a daily briefing, a sales-copy writer, a podcast summariser and a presentation creator, each triggered by a single command.

File 3: memory.md, lessons learned

The third file is a simple Markdown notebook where Claude writes down corrections from your feedback. The skill tells the agent to read it before every run, so it stops repeating mistakes.

One nuance worth knowing: unlike CLAUDE.md and SKILL.md, a file named memory.md isn't a special Anthropic format. It works because your instructions tell Claude to read and update it. Claude Code separately has its own built-in auto memory, notes Claude saves for itself based on your corrections, which loads at the start of each session. A hand-made memory file has one big advantage: it lives in your folder, so it travels with the agent, including to the cloud.

Reference files: the secret ingredient

The three core files are the skeleton. The muscle is everything the interview asks you to add. In one real setup, that meant:

  • Transcripts of every module of a paid online course, so the agent can tell a customer exactly where a topic is covered.
  • A voice guide, product facts and a course outline, all in Markdown.
  • Real past examples of the owner solving customer problems, so the agent learns tone and judgement.

Level 3: Ride in the passenger seat

The biggest mistake is putting a new agent on autopilot on day one. A week later you discover it has been doing the wrong job, or the right job badly.

Think of teaching someone to drive. You sit in the passenger seat, watch, and correct. Only when they stop needing you do you let them go alone.

Running locally is the passenger seat. The agent runs on your computer, only when you ask, so you see every result.

What a test run looks like

Type the slash command in a new session inside the workspace (if the builder didn't create one, ask Claude to). In the run described at the top of this article, the agent:

  • Processed 8 threads in roughly 60 seconds.
  • Wrote 7 drafts.
  • Flagged 2 as needing the owner's personal attention.
  • Labelled 1 without drafting.

Labels included categories like draft ready, customer support, noise, pitch, win, hot leads and refund request.

Correct it like an employee

Then read every draft. One reply accepted a podcast invitation and asked for available times. Fine, except the owner didn't want any podcasts for the rest of 2026.

So the instruction was simply: I don't want to do any podcasts for the rest of 2026; change that draft and add it to my memory.

The new draft politely declined, explained the focus on filming and building, thanked the host and wished the show well, smiley face included. And the rule is now in memory for every future run.

Two kinds of feedback:

  • Preferences and facts go into memory.
  • Missing steps (something the agent should do every single time) go into the skill file. Ask Claude to update SKILL.md directly.

Plan to do this manually for a week or two. It's minimal effort, and it's how the agent becomes genuinely yours.

Level 4: Put it in the cloud

Once you trust it, one problem remains. A local agent only works when your laptop is open and you remember to run it. The point was to take tasks off your list.

Think of a coffee maker. You can press the button every morning, or set the timer the night before. Nothing about the machine changes. You just stop being the one who presses it.

Step 1: Back it up on GitHub

GitHub stores a copy of your folder in the cloud, called a repository. Developers use it to share code. You can use it to keep a private copy of your agent that cloud runs can access.

You don't need to learn Git. Claude Code can use the terminal for you. Ask: "Is GitHub installed? If not, could you install it for me?" Claude will check for the GitHub CLI (gh), help you sign in, and, when asked, turn the folder into a private repository and push it. Afterwards, the same folder structure appears in your GitHub account. Whenever you change something locally, just say "push that to GitHub."

Step 2: Create a scheduled task

Anthropic calls these scheduled tasks (formerly "routines"). They are saved Claude Code configurations, a prompt plus repositories plus connectors, that run on Anthropic's cloud even when your laptop is closed.

You can simply ask Claude to create one: run my email agent skill every hour from this repository. The resulting task carries instructions written for unattended runs, essentially "nobody is watching this session, so never stop to ask a question; run the skill."

Facts worth knowing, from Anthropic's documentation:

  • Scheduled tasks are in research preview and available on Pro, Max, Ultra, Team and Enterprise plans.
  • Manage them at claude.ai/code/routines or with /schedule in the CLI.
  • Presets include hourly, daily and weekly. Custom cron schedules are allowed, but anything more frequent than once an hour is rejected.
  • Each run clones your repository fresh and pushes any changes to branches prefixed with claude/.
  • Skills committed to the repository are available to cloud runs. Personal skills stored only in your home folder are not, which is one more reason to keep the agent's files inside the project.
  • If your GitHub connection expires, runs are skipped, and after 72 hours without reconnecting, the task turns off.

You can also enable push notifications in the Claude mobile app so each run tells you when new drafts are waiting.

If you want scheduling without the cloud, Anthropic also offers desktop scheduled tasks, which run on your own machine with access to local files.

Why this matters

For years, "build an AI agent" meant frameworks, APIs and deployment. This method replaces almost all of that with three ideas anyone can grasp:

  • A folder is the agent's home and long-term storage.
  • Plain-English files are its job description, procedure and memory.
  • A schedule turns a helpful tool into a worker that shows up on its own.

The pattern isn't limited to email. A sales agent, a weekly report writer, a research assistant or a bookkeeping helper is the same workspace, a different set of connectors, and a different interview.

Counterpoints and risks

  • Prompt injection is real. An inbox agent reads text written by strangers. A malicious email could try to instruct the agent to do something you didn't intend. Blocking send and forward tools, and keeping a human on the final click, is your best defence.
  • Secrets and privacy. Your reference files may contain customer data. Keep the repository private, and don't commit passwords or API keys. Ask Claude to set up a .gitignore for anything sensitive.
  • Usage costs. An hourly task runs 24 times a day, every run consuming part of your plan. Consider business-hours schedules.
  • Preview software changes. Scheduled tasks are explicitly a research preview; names, limits and behaviour may shift.
  • Auto-send is tempting. Some builders hope to let the agent send replies one day. Many never should. Drafts-only is the safe default.

Practical takeaways

  • Pick one narrow job. "Label and draft replies for my support inbox" beats "run my business."
  • Over-feed the interview. Policies, FAQs, prices, real past replies. Context is what makes the voice convincing.
  • Lock down write tools first, then relax them only if you have a reason.
  • Test manually for one to two weeks before scheduling.
  • Route feedback correctly: preferences to memory, missing steps to the skill.
  • Keep everything in the project folder so the cloud version behaves like the local one.

FAQ

Do I need to know how to code? No. You describe the job in plain English, answer Claude's interview questions, and let it create the files and handle setup, including GitHub.

What are the three files? CLAUDE.md (rules and personality), a skill's SKILL.md (the step-by-step workflow, run with a slash command), and a memory file where Claude records lessons from your corrections.

Will the agent send emails without asking me? Only if you allow it. You can block the send and forward tools in the connector's permissions so it can only create drafts.

How often can a cloud scheduled task run? At most once an hour. Anthropic rejects schedules more frequent than that.

Does the cloud version work while my computer is off? Yes. Cloud scheduled tasks run on Anthropic-managed infrastructure and clone your repository at the start of each run.

The bottom line

The most powerful idea here isn't Gmail, GitHub or even Claude. It's that an agent is just a well-written job description, a repeatable procedure and a notebook of lessons, kept in a folder and given the right keys.

Build the kitchen. Connect only the tools it needs. Let Claude interview you and write the three files. Ride in the passenger seat until you stop correcting it. Then set the timer and wake up to the coffee already made.

Sources

Google's Cheapest Gemini 4 Model Nearly Matches Claude Sonnet 5.5 at a Third of the Cost. Then It Got a Senior EngineerUp next · 14 min readGoogle's Cheapest Gemini 4 Model Nearly Matches Claude Sonnet 5.5 at a Third of the Cost. Then It Got a Senior EngineerGemini 4 Hydrogen landed on November 12 as Google's fast, everyday model. Independent tests put it one point behind Claude Sonnet 5.5 at roughly a third of the cost per task, and a new Orchestrator mode lets it trade places with Gemini 4 Carbon mid-job.Keep reading →