Skip to content

Blog · AI Agents ·

How to build a personal AI assistant with Claude Code: what a month of using one taught me

By Khadim Hussain · 18 min read

In short

A personal AI assistant on Claude Code is a Git repository the agent works in: a CLAUDE.md with your rules, one skill per recurring job, notes about you, and small scripts and hooks for reminders, phone access, a logged-in browser and the actions it must never take alone. Mine, Klone, has run my day-to-day work for about a month and had 79 skills by late November. It runs on a Claude plan from $20 a month; a product you build for other people needs an API key, because Anthropic doesn't let third-party products offer claude.ai login without approval.

Contents

A personal AI assistant built on Claude Code is a Git repository that Claude Code works in: a CLAUDE.md with your rules, one skill for each job you repeat, notes about you, and a few small scripts and hooks for what a chat window can't do on its own, like reminders, phone access and a logged-in browser. I have used one every day for about a month. I call it Klone, my personal agent: a clone, with a K for Khadim. Its own instruction file says what the name asks of it: "A clone that learns nothing stays a script collection." By 25 November it had 79 skills, 24 numbered rules and about 2,470 commits.

This post is the build path, with a small example for each piece. I wrote the examples for this post rather than copying them from my repo, and ran every script on Windows 11 (the chat server with a stand-in for the claude binary). After the steps come the mistakes that shaped it and what it costs to run. If Claude Code isn't installed yet, start with my Claude Code on Windows guide.

What is a personal AI assistant on Claude Code?

Claude Code is Anthropic's coding agent: it reads files, runs commands and edits code in the folder you open it in. Open it in a folder built around you instead of a codebase, and it becomes a personal AI agent that knows your rules and your tools. Every piece of mine maps to a Claude Code feature or a short script:

PieceWhat it doesBuilt with
InstructionsRules that load in every sessionCLAUDE.md
SkillsOne procedure per recurring job, loaded when a request needs itskills/<task>/SKILL.md
MemoryWho you are and how you want it to workMarkdown notes in Git, plus Claude Code's auto memory
RemindersDates that come back without you askingOne JSON file per reminder, read by a SessionStart hook
Phone accessA chat you can open anywhereA small web server that runs claude -p
Browser and screenWork inside apps you're logged intoA dedicated browser profile and an accessibility-first screen tool
Hard limitsRules that hold when the model forgets themPreToolUse hooks and a git pre-push hook

What can a personal AI assistant do for one person?

Mine does the reading, the drafting and the clicking. In a normal week it triages my inbox and calendar and tells me what needs me, drafts replies bottom line first for me to approve, reviews code changes waiting on me, keeps a running note for each project, publishes this website and runs my YouTube channel. Outside work it has sorted the files on my phone over ADB and dug through a laptop's event logs to find out why it kept dying.

It doesn't act in my name on its own judgement. An email, a post or a delete waits for my yes, unless I've given a standing yes for one kind of job (publishing this site is one), and a login wall or a CAPTCHA waits for me to clear it. That line is what lets me leave it working while I'm away from the desk.

How to build a personal AI assistant with Claude Code, step by step

Start with an empty Git repository that belongs to the assistant, open Claude Code in it, and add one piece at a time. The examples assume Node.js 20 or later and, for the screen step, Python on Windows.

1. Write a CLAUDE.md with your rules and a way to learn

Claude Code loads CLAUDE.md in full into every session, so it holds what must always apply. Begin with a few rules and a table that tells Claude where a lesson goes when you correct it:

# CLAUDE.md
 
At the start of a session, read about-me/profile.md and about-me/working-style.md.
 
## Rules
1. Ask before anything that sends, posts, pays, deploys or deletes. Drafts are fine.
2. Start every reply with the answer, or with the question you need answered.
3. When I correct you, write the lesson down before you finish (see Learning).
 
## Learning
| What you learned | Where it goes |
|---|---|
| A procedure you will repeat | skills/<task>/SKILL.md |
| A lasting fact about me | about-me/ |
| A rule for all work | this file, with the date and the reason |
| Anything else worth keeping | notes.md |

Without the learning table, every session starts as ignorant as the first. My version is rule 10, and the agent has standing permission to add and correct skills, notes and rules without asking. Rules get the date and the reason they exist. One of mine says, in short: give the screen back to the terminal before asking me anything, because a question asked behind a browser window looks exactly like a stalled run.

Also write down which source wins when two disagree. In mine, what I say in the conversation beats what the agent just measured, which beats the rules file, then the task's skill, then memory, then loose notes.

2. Turn every job you repeat into a skill

A skill is a folder with a SKILL.md file. Claude Code keeps only each skill's name and description in context and loads the rest when a request matches, so dozens of skills cost little until one is used:

---
name: inbox-triage
description: Read my unread email and list what needs me. Use when I ask "anything in my inbox", "what needs me today" or "check my email".
---
 
# Inbox triage
 
1. Read unread mail from the last 48 hours. Never reply, archive or delete anything.
2. Keep only what needs me: a question to me, a deadline, a payment, a changed meeting.
3. One line each, most urgent first: who, what they need, by when.
 
## Gotchas
- An invitation I haven't accepted doesn't show on the calendar. Look for it in the mail.

The Gotchas section is where a skill gets better. When a run goes wrong, the fix goes there, and the next run doesn't repeat it. My bar for a new skill has three parts: the job recurs, it cost real discovery (dead ends, a non-obvious order of steps), and writing it down makes the next run clearly faster or safer. A one-off finding goes into a note instead. Klone's 79 skills cover jobs such as reviewing code, publishing this site and diagnosing a crashed laptop. How Claude decides to load a skill, with a 108-run test, is in my Claude Code skills post.

3. Give it a memory of you

Memory has two layers. The first is a folder of plain Markdown about you that you keep in Git. Mine, about-me/, has 14 files; four load at the start of every session, and the rest only when a task touches them:

about-me/
├── README.md              # what each file holds (every session)
├── profile.md             # who I am (every session)
├── working-style.md       # how I want it to behave (every session)
├── work.md                # what I work on (every session)
├── coding-preferences.md  # read before writing any code
└── environment.md         # my machines, read when a task needs them

The second layer is Claude Code's auto memory, which Claude writes itself under ~/.claude/projects/<project>/memory/. An index file, MEMORY.md, loads at session start (its first 200 lines or 25 KB), and each note sits in its own file. Mine holds corrections such as "say what a command will do before running it" and "send me HTML, I can't open Markdown files". This laptop has 42 of them.

Auto memory stays on one machine. Once the assistant runs on a second computer, anything both need belongs in the repo, where a git pull delivers it. And neither layer is a guarantee. Anthropic's memory documentation is blunt about it: "Claude treats CLAUDE.md files and auto memory as context. They aren't enforced configuration." Step 7 covers what to do about that.

4. Add reminders that come back on their own

A chat has no clock. Claude Code's /loop and in-session scheduled tasks belong to one session, cloud scheduled tasks run on Anthropic's servers and can't see your files, and the Desktop app's local tasks fire only while the app is open and the computer is awake. I wanted "ask about the test results on Thursday" to reach whichever session is running on Thursday, so reminders became files:

// remind.mjs: one JSON file per reminder, so two machines never edit the same file.
//   node remind.mjs add 2026-12-01T09:00 "Renew the domain"
//   node remind.mjs due          (run by the SessionStart hook)
//   node remind.mjs done <id>
import fs from 'node:fs';
import path from 'node:path';
 
const dir = path.join(import.meta.dirname, 'reminders');
const [cmd, arg, ...words] = process.argv.slice(2);
const file = (id) => path.join(dir, `${id}.json`);
 
if (cmd === 'add') {
  const due = new Date(arg);
  if (Number.isNaN(due.getTime())) throw new Error(`not a date: ${arg}`);
  fs.mkdirSync(dir, { recursive: true });
  const id = Date.now().toString(36);
  fs.writeFileSync(file(id), JSON.stringify({ id, due: due.toISOString(), text: words.join(' '), done: false }, null, 2));
  console.log(`added ${id}`);
} else if (cmd === 'done') {
  const r = JSON.parse(fs.readFileSync(file(arg), 'utf8'));
  fs.writeFileSync(file(arg), JSON.stringify({ ...r, done: true }, null, 2));
} else if (cmd === 'due') {
  const horizon = Date.now() + 24 * 60 * 60 * 1000; // overdue, or due in the next 24 hours
  for (const f of fs.existsSync(dir) ? fs.readdirSync(dir) : []) {
    const r = JSON.parse(fs.readFileSync(path.join(dir, f), 'utf8'));
    if (!r.done && Date.parse(r.due) <= horizon) console.log(`Reminder ${r.id}, due ${r.due}: ${r.text}`);
  }
}

Then run due from a SessionStart hook in .claude/settings.json. Claude Code adds the hook's plain output to Claude's context, so every new session starts knowing what is due:

{
  "hooks": {
    "SessionStart": [
      { "hooks": [{ "type": "command", "command": "node \"$CLAUDE_PROJECT_DIR/remind.mjs\" due" }] }
    ]
  }
}

Klone also checks on every prompt (a UserPromptSubmit hook), so a reminder that falls due mid-session appears once, and a Windows scheduled task checks every 5 minutes and starts a read-only run through the chat server from step 5 for reminders that need a check done on time. I added reminders on 27 October; by 25 November the folder held more than 280. The one rule that keeps them useful: when the work is done, mark the reminder done in the same turn, or it comes back in every session.

5. Reach it from your phone

If you only want to continue a session from your phone, try Anthropic's Remote Control first. It connects the Claude app or claude.ai/code to a Claude Code session running on your computer, and it works on the Pro, Max, Ultra, Team and Enterprise plans.

I built my own web chat in the first week. It has since gained several chats running at once, runs that keep going when my phone drops the connection, a model picker and voice dictation, but the core is a small server that starts claude -p for each message and streams the output back. Anthropic's Agent SDK overview describes the same route for languages other than Python and TypeScript: run the CLI as a subprocess with the -p flag. The core fits in about 40 lines:

// chat-server.mjs: a private endpoint that runs Claude Code headless and streams the reply.
//   CHAT_TOKEN=<long random string> ASSISTANT_DIR=$HOME/assistant BIND=<your VPN address> node chat-server.mjs
import http from 'node:http';
import crypto from 'node:crypto';
import readline from 'node:readline';
import { spawn } from 'node:child_process';
 
const expected = Buffer.from(`Bearer ${process.env.CHAT_TOKEN}`);
const authorized = (header = '') => {
  const given = Buffer.from(header); // header only: a token in a URL ends up in logs and history
  return given.length === expected.length && crypto.timingSafeEqual(given, expected);
};
 
http.createServer((req, res) => {
  if (req.method !== 'POST' || req.url !== '/chat' || !authorized(req.headers.authorization)) {
    res.writeHead(401).end();
    return;
  }
  let body = '';
  req.on('data', (chunk) => (body += chunk));
  req.on('end', () => {
    let prompt, sessionId;
    try {
      ({ prompt, sessionId } = JSON.parse(body));
    } catch {
      res.writeHead(400).end();
      return;
    }
    const args = ['-p', String(prompt), '--output-format', 'stream-json', '--verbose', '--include-partial-messages'];
    // Session ids are UUIDs. Anything else could smuggle in a flag, so it is dropped.
    if (/^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(sessionId ?? '')) args.push('--resume', sessionId);
    const child = spawn(process.env.CLAUDE_BIN ?? 'claude', args, {
      cwd: process.env.ASSISTANT_DIR, // the repo with your CLAUDE.md, skills and hooks
      stdio: ['ignore', 'pipe', 'inherit'],
    });
    res.writeHead(200, { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache' });
    child.on('error', (err) => res.end(`data: ${JSON.stringify({ error: err.message })}\n\n`));
    readline.createInterface({ input: child.stdout }).on('line', (line) => res.write(`data: ${line}\n\n`));
    child.on('close', () => res.end());
  });
}).listen(8080, process.env.BIND ?? '127.0.0.1');

A phone page POSTs the prompt with the token in the header, shows the events as they arrive, and sends the session_id from the first event back with the next message to continue the conversation. Two checks in it came from reviewing my own server. The token is read only from the Authorization header, because a token in a URL leaks into logs and browser history. The session id must be a UUID: --resume takes an optional value, so a crafted id such as --dangerously-skip-permissions would become a flag of its own (a security pass on Klone caught that). The server listens only on a private network, a VPN between my own devices.

A headless run can't stop to ask for permission, so decide in advance what it may do: an allowlist with --allowedTools, or a permission mode. Full permissions turn the token into a key to your computer, so an allowlist is the safer default. Klone's chat also has an approvals switch: the agent describes a risky step, ends its turn and waits until I tap approve.

Some jobs need the whole desktop rather than a chat, such as starting a session in another folder or checking a page in Chrome myself. For those I control the PC from my phone with Kustdesk, my fork of RustDesk's Android app with a real trackpad.

6. Let it use your browser and your screen

Most personal work happens in web apps you are already logged into. Give the assistant its own browser profile, log in to each site once by hand, and reuse that session from scripts. Chrome 136 and later refuse remote debugging on your everyday profile, so a separate profile is needed anyway, and it keeps the agent's sessions apart from yours:

// browser.mjs: one browser profile that belongs to the assistant, logged in once by you.
//   node browser.mjs login https://example.com        (visible window: log in, then close it)
//   node browser.mjs https://example.com /api/me      (headless: call the site's API as you)
import { chromium } from 'playwright';
 
const [first, second] = process.argv.slice(2);
const login = first === 'login';
const ctx = await chromium.launchPersistentContext('./agent-profile', { headless: !login });
const page = ctx.pages()[0] ?? (await ctx.newPage());
 
if (login) {
  await page.goto(second);                                  // you type the password and clear any CAPTCHA
  await new Promise((resolve) => ctx.on('close', resolve)); // closing the window saves the session
} else {
  await page.goto(first);
  // fetch() inside the page carries the profile's cookies, so you get JSON instead of scraped HTML.
  const data = await page.evaluate(async (url) => (await fetch(url, { credentials: 'include' })).json(), second);
  console.log(JSON.stringify(data, null, 2));
  await ctx.close();
}

In Git Bash on Windows, set MSYS_NO_PATHCONV=1 before the second command: Git Bash rewrites /api/me into a Windows path, and the fetch fails with a bare "Failed to fetch". It cost me a few minutes while testing this script.

Calling a site's own API from inside the logged-in page returns clean JSON, which is faster and steadier than reading the page. Klone never tries to beat a CAPTCHA. It opens a visible window and waits; after I clear the check once, the cookie it leaves in the profile usually keeps the next runs going.

For desktop apps with no API, Klone drives the real screen on Windows with its own screen tool. (Claude Code's computer use in the CLI is a research preview for macOS and doesn't run with -p; the Desktop app has computer use on Windows.) The order that works: find the control by its accessible name, fall back to the OCR built into Windows, and take a screenshot only for what has no name:

# find_control.py: find a control by its accessible name before looking at pixels (Windows).
#   python find_control.py "Taskbar" "Start"
import re
import sys
 
from pywinauto import Desktop
 
title, name = sys.argv[1], sys.argv[2]
window = Desktop(backend="uia").window(title_re=f".*{re.escape(title)}.*", found_index=0)
matches = [el for el in window.descendants() if el.window_text() == name]
if len(matches) != 1:
    sys.exit(f"{len(matches)} controls named {name!r}; refusing to guess")
rect = matches[0].rectangle()
print(matches[0].element_info.control_type, rect, "click at", rect.mid_point().x, rect.mid_point().y)

When I measured it on 8 targets in a desktop chat app, a lookup by name took 0.8 to 0.9 seconds and no tokens. A screenshot read by a small vision model took 4.2 to 4.6 seconds and about 33,000 tokens for one target, and landed on the same spots. Screenshots never enter the main session either: a sub-agent looks at the image and returns coordinates, so the main context stays text.

7. Put hard limits in hooks, not in instructions

CLAUDE.md is advice the model weighs. A hook is code that runs before a tool call and can refuse it, whatever the model decided, and Anthropic's memory documentation recommends a PreToolUse hook for anything that must be blocked regardless of what Claude decides. I learned this when a sub-agent that had been told not to send anything or call any outside service did both while reproducing a bug. Here is a hook that refuses force-pushes and asks before any connected tool sends, posts or deletes in your name:

// ask-before-sending.mjs: a PreToolUse hook. Claude Code sends the tool call as JSON on stdin.
let raw = '';
for await (const chunk of process.stdin) raw += chunk;
const { tool_name: tool = '', tool_input: input = {} } = JSON.parse(raw || '{}');
 
const decide = (permissionDecision, permissionDecisionReason) =>
  console.log(JSON.stringify({
    hookSpecificOutput: { hookEventName: 'PreToolUse', permissionDecision, permissionDecisionReason },
  }));
 
const command = typeof input.command === 'string' ? input.command : '';
if (tool === 'Bash' && /\bgit\s+push\b.*(--force\b|\s-f\b)/.test(command)) {
  decide('deny', 'Never force-push. Pull with --rebase and push again.');
} else if (/^mcp__.*(send|reply|forward|post|publish|delete)/i.test(tool)) {
  decide('ask', `${tool} acts in my name. Show me the exact text before it goes.`);
}
// No output and exit code 0: no decision, the normal permission rules apply.

Register it under PreToolUse in the same settings file, with "command": "node \"$CLAUDE_PROJECT_DIR/ask-before-sending.mjs\"". A deny blocks the call and shows Claude the reason; an ask puts the decision in front of you. Klone's mail hook is stricter: it refuses to send an email unless the exact text sits in a draft file that passed a check (at most about 150 words, written as "I", with a line saying what was verified). A git pre-push hook runs every test before a push, since the day I found the Python test suite had been failing for six days with nobody running it.

What went wrong, and what I changed

What happenedWhat I changed
A sub-agent told not to send anything sent somethingOutward actions are blocked by hooks; instructions count as advice
A click on a search box didn't take focus, so the typed search went into an open document, which saved it at onceThe agent compares the field's pixels before and after the click and won't type if fewer than 25 changed
A select-all, meant to copy a webmail page's text, selected 6,263 messages, one click from deleting themNo select-all on any screen that lists records: mail, tickets, files
A window matched by part of its title was an email pop-up, and a Delete key meant for the address bar deleted the open email; Trash saved itInput goes only to allow-listed windows, re-checked before every input, and never a bare Delete or Enter to navigate
PyAutoGUI typed non-ASCII characters as nothing on Windows while reporting successTyping goes through Windows' SendInput instead
I built a native Android app with push notifications and never used itDeleted it; the web chat in my phone's browser is enough
CLAUDE.md kept growing, past 120 KBThe long incident stories moved to a handbook; every rule keeps its reason in the main file

The last row isn't solved. Anthropic's memory docs suggest keeping a CLAUDE.md under 200 lines, and mine had 1,296 lines and 128 KB on 25 November. Every session now starts with about 100,000 tokens of context before its first word. I accept that on purpose: each rule in that file came from a real mistake, and the growth is the record of what the assistant learned.

What does a personal AI assistant on Claude Code cost?

For yourself, on your own computer, it costs a Claude plan. Klone's chat server runs the Claude Code CLI under my own login, with no API key. On 25 November 2026, claude.com/pricing listed:

PlanPriceUsage
Pro$20 a month, or $17 a month billed yearlyIncludes Claude Code
Max$100 a month5 times Pro's usage every 5 hours and every week
Ultra$200 a month10 times Pro's usage every week, no 5-hour limit for verified accounts

An assistant that works all day uses far more than occasional coding, so the plan's usage limit is the cost that matters. Context is what uses it up. Sending my 100,000 tokens of start-up context to Claude Opus 5.5 would cost $0.40 at the API's base input price of $4 per million tokens, or $0.02 when it is read from the prompt cache. Every price and a cost calculator are in my Claude API pricing post.

Screenshots add up the same way. My transcripts hold 1,117 screenshot reads by sub-agents. A small read-only sub-agent took a median 7.5 seconds and 32,000 tokens per look, while general-purpose ones took 13 to 16 seconds and about 95,000, because they ran on the big model and loaded the whole CLAUDE.md. A hook now refuses any image read that isn't on the small model.

Can I use my Claude subscription for an assistant I build for someone else?

Not by passing your login along. My web chat is me using Claude Code from my own phone under my own account. A product for other people is a different case, and Anthropic's Agent SDK overview is explicit: "Unless previously approved, Anthropic does not allow third party developers to offer claude.ai login or rate limits for their products, including agents built on the Claude Agent SDK. Use the API key authentication methods described in the Quickstart instead." For a team, each person runs Claude Code under their own account, or the product uses an API key and pays per token.

What a personal AI assistant on Claude Code can't do

It works only while the computer it lives on is switched on and awake. Cloud scheduled tasks keep running when your computer is off, but they can't reach your files or your logged-in browser.

It stops at CAPTCHAs, MFA prompts and Windows' administrator prompts, and I keep it that way. Outward actions wait for my yes, so it saves me reading and clicking time and leaves the decisions with me.

It gets better only as fast as you correct it: every row in the table above became a rule, a code change or a memory note. For file jobs without a terminal, Anthropic's Cowork is simpler to start with, and my Claude Cowork test on three messy folders shows what it does well.

If you would rather have this built for you, setting up Claude Code with skills for your recurring jobs and hooks that ask before a deploy or a send is part of my AI agent consulting, for one person or a whole team.

Next

Frequently asked questions

Can I make my own personal AI assistant?

Yes, without training a model. With Claude Code you need a paid Claude plan or an API key, a folder for the assistant and a CLAUDE.md with your rules; skills, memory, reminders and hooks can follow one at a time. Mine started as a script that drove a logged-in browser and grew from there.

How do I create a personal AI assistant with Claude Code?

Make a Git repository for it and write a CLAUDE.md with your rules and a table that says where each lesson goes. Then add a skill for each job you repeat, a folder of notes about you, reminders delivered by a SessionStart hook, a private web chat that runs claude -p for your phone, a dedicated browser profile, and PreToolUse hooks that block or ask before anything leaves the machine.

What is a personal AI agent?

An AI agent that works for one person: it knows that person's preferences and accounts, uses their tools, and does recurring jobs such as triaging email, drafting replies or filing notes. The difference from a chatbot is that it takes actions, so it needs rules about which actions wait for a yes.

How much does it cost to build your own AI assistant with Claude Code?

The scripts are yours to write, so the running cost is a Claude plan. On 25 November 2026 Pro cost $20 a month, Max $100 and Ultra $200, with Max at 5 times Pro's usage and Ultra at 10 times Pro's weekly usage. An assistant that runs all day needs more usage than occasional coding, and a large CLAUDE.md or many screenshot reads use it up faster.

Can I use my Claude subscription for an AI assistant I build for other people?

Not by passing your login along. Anthropic's Agent SDK documentation says that, unless previously approved, third-party developers may not offer claude.ai login or rate limits for their products, and points to API key authentication instead. Each person can run Claude Code under their own account, or the product can use an API key.

Can I reach my Claude Code assistant from my phone?

Yes. Anthropic's Remote Control connects the Claude app or claude.ai/code to a Claude Code session running on your computer, on Pro, Max, Ultra, Team and Enterprise plans. I use my own small web server that runs claude -p per message, which lets several chats run at once and keeps a run going when the phone disconnects.

Is it safe to let an AI assistant use my accounts?

Safer with three habits. Give it its own browser profile that you log in to by hand, let a person clear every CAPTCHA and MFA prompt, and put the actions that must never happen alone (sending, posting, deleting, force-pushing) in hooks, because Claude treats CLAUDE.md as context and hooks run as code.

What is the best personal AI assistant?

It depends on how much you want it to do. For chat and writing, the Claude or ChatGPT apps are enough. For file jobs on your desktop without a terminal, Anthropic's Cowork is the easiest start. If you want an assistant that follows your own rules, learns new jobs as skills and works in your logged-in tools, build your own AI assistant on Claude Code as this post shows, or start from OpenClaw, an open-source agent project.

How is a Claude Code personal assistant different from OpenClaw?

OpenClaw is an open-source personal AI agent project you install and connect to your apps; it had about 395,000 GitHub stars in November 2026. A personal AI assistant on Claude Code, like mine, is a folder of your own rules, skills and scripts that Claude Code works in, so every behaviour is a file you wrote and can change. I haven't run OpenClaw myself, so I can't compare the two on results.

Want a second pair of eyes on this?

Book a 15-minute intro call. Bring the problem, and you leave with a concrete next step.