phantom: Instructions file for Claude Code

CLAUDE.md

phantom CLAUDE.md is an instructions file for Claude Code from ghostwright/phantom. It costs 9,391 tokens per session, scanned D, original, Apache-2.0.

A project instruction file for Phantom, an autonomous AI co-worker that runs as a long-lived Bun and TypeScript process. It documents Phantom’s technology, configuration, commands, testing, and communication channels.

In plain words
What is it for?
Use it when building, testing, configuring, or changing Phantom, including its memory system, chat channels, provider settings, and MCP server.
Why use it?
It gives coding agents the project context they need to work consistently in a large codebase and follow its required conventions.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is ghostwright/phantom's own configuration. It tells Claude Code how to work on phantom itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything phantom configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/specter/phantom.

About the project

Phantom is an AI co-worker that operates its own computer, maintains persistent memory, uses MCP tools, and builds software and infrastructure in its workspace. It is for people who want an agent that can continue work across sessions through Slack or web chat while keeping its workspace separate from the user's computer. The catalogue skills and instruction support workflows for Phantom.

ghostwright/phantom · 1,488 stars · on GitHub · ghostwright.dev

Reuse

Borrowing it

Nothing to install: this file belongs to ghostwright/phantom. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ghostwright/phantom/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/ghostwright/phantom

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for phantom CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ghostwright/phantom/claude-md/github.svg)](https://agentmods.dev/instructions/ghostwright/phantom/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/ghostwright/phantom/claude-md"><img src="https://agentmods.dev/badge/instructions/ghostwright/phantom/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for phantom CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ghostwright/phantom/claude-md"><img src="https://agentmods.dev/badge/instructions/ghostwright/phantom/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9,391 This file is loaded in full into every session.
When invoked 9,391 The same file — it is already loaded in full.
Security scan D 3 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.09391 $0.09391
Opus 5.5 $0.03756 $0.03756
Sonnet 5.5 $0.01878 $0.01878
Haiku 4.5 $0.00939 $0.00939

Measured 2mo ago against content hash a3489a52dc14, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade D, and why

phantom CLAUDE.md scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- **Don't run as root in Docker.** Claude Code CLI rejects --dangerously-skip-permissions as root. The non-root phantom user with group_add for Docker socket is the correct pattern.

Cloud metadata endpointhighServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

**Key fetch.** `src/email/key-fetcher.ts` exposes `ResendKeyFetcher` (gateway-backed, 15-minute cache; `GET http://169.254.169.254/v1/secrets/resend_api_key`) and `EnvKeyFetcher` (env-backed for local dev / OSS Docker wi

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl https://<slug>.phantom.ghostwright.dev/health/build-info
CLAUDE.md · 434 lines

How it starts

The opening of the file, as written. The whole thing — 434 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Phantom

Phantom is an autonomous AI co-worker that runs as a persistent Bun process on a VM. It wraps the Claude Agent SDK as a subprocess (Anthropic by default, swappable via a provider: config block to Z.AI/GLM-5.1, OpenRouter, Ollama, vLLM, LiteLLM, or any Anthropic Messages API compatible endpoint). It maintains vector-backed memory across sessions, rewrites its own configuration through a validated self-evolution engine, communicates via Slack/Web Chat/Telegram/Email/Webhook, and exposes all capabilities as an MCP server. 30,000+ lines of TypeScript, 1,819 tests, v0.20.2. Apache 2.0, repo at ghostwright/phantom.

Tech Stack

Layer Technology
Runtime Bun (TypeScript-native, built-in SQLite, no bundler)
Agent Claude Agent SDK (@anthropic-ai/claude-agent-sdk) subprocess. Provider is configurable via src/config/providers.ts: Anthropic (default), Z.AI, OpenRouter, Ollama, vLLM, LiteLLM, custom.
Memory Qdrant (vector DB, Docker) + Ollama (nomic-embed-text, local embeddings)
State SQLite via Bun (sessions, tasks, metrics, evolution versions, scheduled jobs)
Channels Slack (Socket Mode), Web Chat (SSE streaming), Telegram (long polling), Email (IMAP/SMTP), Webhook (HMAC-SHA256), CLI
Chat Client React 19 + Vite + shadcn/ui + Tailwind v4 SPA at /chat
Web UI Tailwind v4 Browser CDN + DaisyUI v5, static files from public/
MCP Streamable HTTP on /mcp, bearer token auth, 17+ tools
Infrastructure Docker (compose), Specter VMs (Hetzner), systemd (bare metal)
Lint/Format Biome
Test bun:test

The Cardinal Rule

TypeScript is plumbing. The Agent SDK is the brain.

The Agent SDK (Opus 4.7) has full computer access: Read, Write, Edit, Bash, Glob, Grep, WebSearch, Agent tools. It can understand natural language, read code, explore repos, detect tech stacks, clone repos, install packages, write configs, and reason about anything.

TypeScript handles: starting processes, routing messages, managing sessions, storing data, serving HTTP endpoints, tracking state. Mechanical, deterministic work.

Read the full file on GitHub · 434 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 434 lines · 9,391 tokens per session scan D a3489a52dc14

Subscribe to this mod's changes

phantom CLAUDE.md is an instructions file published in the GitHub repository ghostwright/phantom (1,488 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 9,391 tokens to every session, about $0.0376 per session on Opus 5.5. A static security scan graded it D with 3 findings (asks for root, cloud metadata endpoint, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

phantom CLAUDE.md compared with instructions from other repositories

phantom CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
phantom CLAUDE.mdghostwright/phantomInstructions file1.5k4mo agoApache-2.0D9,391Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode