A standing Claude agent that lives on your own hardware, answers in your Discord, and remembers you between restarts.
Karakos is one Docker container. Point it at a Discord server and an Anthropic login, and you get an assistant that is always up: it holds a conversation across process restarts, keeps a searchable knowledge graph of what it learns, tracks what it spends and stops at a cap you set, and can be extended with your own tools without you writing any process-management code.
The infrastructure you would otherwise build first — session lifecycle, memory consolidation, cost guards, a message queue, a web dashboard, agent orchestration — is the part this package is.
- How it fits together
- Install
- Running it day to day
- Talking to it
- What ships in the box
- Requirements and cost
- Security model
- Documentation
Everything runs inside one container. There is no multi-service compose
stack to reason about — supervisord starts four long-lived processes that
share a workspace on disk.
You You
(Discord) (browser)
│ │
│ message │ http :3000
▼ ▼
┌─────────────┐ ┌─────────────┐
│ relay.py │ │ dashboard │
│ (gateway) │ │ (Next.js) │
└──────┬──────┘ └──────┬──────┘
│ │
│ HTTP + bearer token │
└────────────┬───────────────┘
▼
┌──────────────────┐ ┌──────────────┐
│ agent-server.py │◀──────▶│ scheduler.py │
│ :18791 │ poke │ (heartbeats, │
│ │ │ oneshots) │
│ • message queue │ └──────────────┘
│ • cost guard │
│ • turn loop │
└────────┬─────────┘
│ stdin/stdout, stream-json
▼
┌──────────────────┐ ┌──────────────┐
│ claude CLI │───────▶│ MCP tools │
│ (one child │ MCP │ server │
│ per agent) │ │ + skills/ │
└────────┬─────────┘ └──────────────┘
│
▼
┌──────────────────────────────────────────┐
│ data/ — SQLite + JSONL, on a volume │
│ queue · cost · memory · audit · spool │
└──────────────────────────────────────────┘
The short version: Discord and the browser are both just clients. They put a message on the agent server's queue; the agent server owns the Claude subprocess, runs one turn at a time per agent, and writes the answer back the way it came in. Nothing else talks to Claude directly.
Full technical reference: docs/ARCHITECTURE.md.
Linux / macOS
curl -fsSL https://raw.githubusercontent.com/mcarmody/karakos-package/main/install.sh | bashWindows (PowerShell as administrator)
irm https://raw.githubusercontent.com/mcarmody/karakos-package/main/install.ps1 | iexThe installer checks prerequisites (Docker, Git, jq), clones the repo to
~/karakos, then hands off to the setup wizard, which asks you for a system
name, an Anthropic login, your Discord bot token and channel IDs, and your
spend caps. It finishes by pulling the prebuilt image from GHCR (~1.2 GB, no
local build) and starting the container.
When it's done, open http://localhost:3000 and log in as admin with the
password the wizard printed.
The dashboard listens on 127.0.0.1 only and serves plain HTTP. To reach it from another device, set
DASHBOARD_BIND=0.0.0.0 in config/.env and restart, and put an HTTPS proxy in front of it
(set KARAKOS_COOKIE_SECURE=1 when you do). Failed logins are throttled: five wrong passwords from one
address lock that address out for up to 15 minutes.
Prefer to drive it yourself, or already have the repo?
git clone https://github.com/mcarmody/karakos-package.git ~/karakos
cd ~/karakos
./setup.sh # wizard — resumable, safe to quit and re-run
make install # preflight, pull, startStep-by-step walkthrough, including the Discord bot: docs/QUICKSTART.md and docs/DISCORD_SETUP.md.
The compose file lives at config/docker-compose.yml, not at the repo root,
so a bare docker compose up in your checkout will not find it. Use the
make targets, which point at the right file for you:
| Command | What it does |
|---|---|
make install |
Preflight checks, pull the image, start the container |
make up |
Start (or restart) the container |
make down |
Stop it — agents finalize their sessions first, up to 45s |
make logs |
Follow the container log |
make shell |
Open a shell inside the container as the karakos user |
make pull |
Fetch a newer image without starting it |
make preflight |
Host checks only, starts nothing |
make help |
List the targets |
If you'd rather type Docker directly, every command needs the file flag:
docker compose -f ~/karakos/config/docker-compose.yml logs -f
docker compose -f ~/karakos/config/docker-compose.yml exec karakos bashAddress the container by its service name, karakos. There is one
service, so docker compose logs relay or docker compose logs dashboard
will not work — those are processes inside the single container, and their
individual logs are under logs/ in the workspace.
Pinning a version. Set KARAKOS_VERSION in config/.env to stay on a
release and upgrade on your own schedule; the default is latest. See
docs/UPGRADING.md.
Self-upgrade. Run make install-upgrade-agent on the host once; after that
an agent can upgrade the install with bin/self-upgrade.sh request vX.Y.Z
(host-side, rolls back on failure; see
Self-upgrade).
Discord. Message the bot in a channel it watches. That is the main path and the one the system is designed around.
Dashboard at http://localhost:3000: status, chat, costs, conversations and
the fleet. Its source is dashboard/, built into the
image; the routes it uses are in
docs/package-backend-contract.md. Chat
replies stay out of Discord.
Terminal. bin/kara is a small Python CLI that speaks the same HTTP API
as the dashboard:
./bin/kara "what's on my calendar?" # one-shot
echo "summarize this" | ./bin/kara # from a pipe
./bin/kara # interactive REPLREPL commands: /health, /agents, /agent <name>, /cost, /reset,
/reload, /restart, /help, /quit. Set AGENT_SERVER_TOKEN (from
config/.env); AGENT_SERVER_URL defaults to http://127.0.0.1:18791.
Agents. Two run by default: primary, the general-purpose assistant you
talk to, and the monitor (you name it in the wizard), a cheap agent that
watches heartbeats, drift and stalls and raises alerts. Agents can have several
shards (parallel conversations that share memory) which talk to each other
through the hive (buzz and hive_call). Two more are one command away — builder, which takes a spec and
opens a pull request, and reviewer, which reviews adversarially before
merge:
make shell
bin/create-agent.sh --template builder --model sonnet builderOn first boot a fresh agent runs an onboarding conversation to learn who you are, rather than starting from a blank persona.
Memory. Durable memory is a knowledge graph (entities, links and
observations) in data/memory/graph.db. Each human prompt gets a short recall
block from it, and top facts load at session start; semantic search runs on
local embeddings, so recall costs no API calls.
Delivery. Discord replies go through a durable outbox with retries and an
audit trail, so a Discord outage delays an answer instead of losing it. An agent can
answer with rich embeds by putting a fenced embed block in its reply.
Cost control. Every turn's spend is recorded per agent. Daily and monthly caps are enforced at the point a message is queued, and warnings post to your signals channel before the cap bites.
Scheduled work. Heartbeats, health sweeps, memory consolidation and data purges run on a built-in scheduler. Agents can also schedule arbitrary one-off work at runtime — "check back in ten minutes" is a real mechanism, and it survives a container restart.
Self-modification, fenced. Builder agents can change the system's own
code, but config/protected-paths.json hard-blocks the files that own
process lifecycle and security, and flags a second tier for review.
Your own tools. Drop a tools.json and a script into skills/<name>/ and
the MCP server registers it at startup. See
docs/EXTENDING.md — and note that this is Karakos's
own skill convention, not Claude Code's SKILL.md frontmatter feature.
| Hardware | 4 GB RAM minimum, 8 GB recommended; 2+ cores; 10 GB disk |
| OS | Ubuntu 22.04+, Debian 12+, macOS 12+, Windows 10/11 |
| Software | Docker Engine 24+ with Compose v2, Git, jq |
| Auth | An Anthropic account — claude login, no API key to paste |
| Network | A stable connection; the box is expected to run 24/7 |
Expected spend: $5–15/week for typical household use, and the cost caps are there so a surprise stays small.
A Raspberry Pi 4 or 5, a mini PC, or a small VM all work.
Read this before you point the bot at a channel other people can write in.
- Agents run without permission prompts. Each agent is a headless
claude -psession started with--dangerously-skip-permissions; nobody is there to click "allow". What an agent may not do is set bypermissions.denyinconfig/claude-settings.json. - The default deny list is a guard rail, not a wall. It stops the Read and Edit tools on
.envfiles and on the Claude login files, and the common shell commands that print them (cat,less,more,head,tail,printenv,env). A determined prompt injection (a Discord message, a web page the agent reads) can still run another command that reads a mounted file. Assume anything the container can read, an injected agent can read. - What the container can read.
config/(includingconfig/.env: the Discord bot tokens, the dashboard password and, if you set it, the Claude OAuth token),agents/, the data volume, and your~/.claudelogin, all writable.AGENT_SERVER_TOKENis also passed to every agent process; see the credentials section of ARCHITECTURE.md. - Network egress is allowed by default, because agents browse and call APIs. To turn it off for every agent, add
"WebFetch","Bash(curl:*)"and"Bash(wget:*)"topermissions.deny. Individual agents can also be limited withdisallowed_toolsinconfig/agents.yaml. - Practical limits. Run Karakos on a machine or VM that holds nothing else you care about; use a bot account dedicated to it and invite it only to channels you trust; set
OWNER_DISCORD_IDso only you can answer asks and approve actions; keep the cost caps (COST_DAILY_LIMIT,COST_MONTHLY_LIMIT) on. - Known gap.
config/.envstill sits inside the tree the agents can see. Moving it out of the agent-visible tree is planned work because it changes the mounts and the setup paths.
To loosen or tighten the default list, edit permissions.deny in config/claude-settings.json; bin/hooks-sync.py rewrites only the hooks section and leaves permissions alone.
| Doc | Read it when |
|---|---|
| QUICKSTART.md | Installing for the first time |
| DISCORD_SETUP.md | Creating and inviting the bot |
| ARCHITECTURE.md | You want to know how it actually works |
| EXTENDING.md | Adding skills, tools or agents |
| ASKS.md | Non-blocking asks with a recommendation, answered by buttons or reactions |
| AGENT_CHECKS.md | Checking that an install has its capabilities (make agent-check, and the agentic layer) |
| UPGRADING.md | Moving to a new release, or from 1.x to 2.0 |
| OVERLAY.md | Keeping your config, personas and skills in a private overlay repo instead of a fork |
| CONTRIBUTING.md | Sending a patch |
| Agents: AGENTS.md, docs/AGENT_GUIDE.md | A coding agent installing, repairing, improving or contributing to Karakos |
bin/verify-public-safety.py scans for household PII (names, addresses, IPs and
the like) using a rules file that lives outside the repo, so the denylist is never
published. It prints only path:line: kind (rule section[index]), never the match.
Enable the pre-commit hook once per clone:
git config core.hooksPath .githooksThe rules file is the first of: --rules PATH, the KARAKOS_PII_RULES environment
variable, then ~/.karakos/secrets/pii_rules.json. With no rules file the check
prints a notice and passes; --require-rules makes that an error (exit 2). Paths
exempt from the check go in .public-safety-allow (GLOB or GLOB:KIND). CI runs
the same check when the PII_RULES_JSON secret is set, plus gitleaks.
MIT. Contributions welcome — see CONTRIBUTING.md.
Built with Claude Code (Anthropic).