# Phantom

> A self-hosted AI co-worker that runs on its own machine, remembers what you tell it and builds its own tools

- Category: Agents & Automation / Assistants & Chatbots
- Language: TypeScript
- Licence: Apache-2.0
- Repository: https://github.com/ghostwright/phantom
- Website: https://ghostwright.dev/phantom
- Canonical page: https://ai-tldr.dev/tools/phantom/

## In short

Phantom is a self-hosted AI co-worker that runs on its own machine, remembers what you tell it and builds its own tools. It sits in the Assistants & Chatbots category of the Agents & Automation tools and is open-source, written in TypeScript and licensed Apache-2.0. To get started: download the compose file and env template.

## Overview

Phantom is an open-source AI co-worker from Ghostwright, built on the Claude Agent SDK. Instead of living in a chat tab on your laptop, it gets its own computer: a dedicated machine or VM where it can install software, run databases and services, and serve what it builds on a public URL behind authentication. You talk to it in Slack, in a browser chat at /chat, or over Telegram, email and webhooks, and it has its own email address for sending reports to people outside your workspace.

It is designed to accumulate context rather than start every session from scratch. A three-tier vector memory (episodic session transcripts, semantic facts and procedural workflows, stored in Qdrant with embeddings from Ollama) is shared across every channel. After each session a self-evolution pipeline observes corrections and preferences, proposes small changes to the agent's own configuration, and runs them through validation gates judged by a separate model before applying them; every version is stored so changes can be diffed and rolled back.

Phantom also works as infrastructure for other agents. It runs an MCP server over streamable HTTP, so Claude Code, Claude Desktop or another Phantom can query its memory, ask it questions and call tools, including tools the agent created and registered for itself at runtime, which persist across restarts. Anthropic is the default model backend, and a YAML block switches it to Z.AI, OpenRouter, Ollama, vLLM, LiteLLM or any Anthropic Messages API compatible endpoint.

## What it does

- Runs on its own machine or VM, so it can install software, run databases and serve dashboards, pages and APIs on a public URL with auth
- Three-tier persistent memory (episodic, semantic, procedural) in Qdrant, shared across Slack, web chat, Telegram, email and webhook channels
- Self-evolution after every session: observe, critique, generate, validate through five gates with cross-model judges, apply and consolidate, with versioned rollback
- Creates and registers its own MCP tools at runtime; they survive restarts and are callable by other connected agents
- MCP server over streamable HTTP with bearer tokens, for Claude Code, Claude Desktop (via mcp-remote) and other Phantoms
- Secrets collected through AES-256-GCM encrypted forms with magic-link auth instead of plain-text config, plus its own email identity

## Getting started

The README recommends Docker. You need an Anthropic API key (or another supported provider) and Docker Compose; Slack is optional, since the web chat at /chat works on its own. The compose file mounts the Docker socket so Phantom can start sibling containers, so the project advises running it on a dedicated machine or VM rather than your personal workstation. Ghostwright also offers a managed Phantom on a dedicated VM at ghostwright.dev/phantom.

1. Download the compose file and env template

```bash
curl -fsSL https://raw.githubusercontent.com/ghostwright/phantom/main/docker-compose.user.yaml -o docker-compose.yaml
curl -fsSL https://raw.githubusercontent.com/ghostwright/phantom/main/.env.example -o .env
```

2. Fill in .env and start it

   Set ANTHROPIC_API_KEY, plus your Slack tokens and OWNER_SLACK_USER_ID if you want Slack (or OWNER_EMAIL to log in to the web chat without Slack). Compose starts Qdrant for memory, Ollama pulls the embedding model, and the agent boots; health is at http://localhost:3100/health.

```bash
docker compose up -d
```

3. Create an MCP token

   Generate a bearer token for Claude Code from inside the container. You can also ask your Phantom in Slack to create one.

```bash
docker exec phantom bun run phantom token create --client claude-code --scope operator
```

4. Connect Claude Code

   Point Claude Code at the MCP endpoint. For a local instance use http://localhost:3100/mcp in place of the hosted URL.

```bash
claude mcp add phantom https://your-phantom.ghostwright.dev/mcp \
  --transport http \
  --header "Authorization: Bearer YOUR_TOKEN"
```

## When to use it

- Give a team an always-on assistant in Slack that remembers project conventions and posts scheduled summaries such as open PRs and CI status
- Have an agent stand up databases, data pipelines and dashboards on its own machine and hand back a shareable URL instead of something stuck on localhost
- Build and register custom MCP tools once, then call them from Claude Code or other agents in later sessions
- Run a long-lived agent on a cheaper or self-hosted model backend through Z.AI, OpenRouter, Ollama, vLLM or LiteLLM
