Pharaoh - Your AI breaks things it can't see
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Pharaoh answers structural questions about mapped repos from a graph of each repo's default branch: functions, callers, modules, dependencies, endpoints, cron jobs and reachability, for TypeScript, JavaScript, Python, C and C++. No source code is stored.
Which tool answers which question
Pharaoh answers these questions from the graph:
Question | Tool |
Does X already exist? Where is Y implemented? | search_functions |
What calls X? What breaks if I change it? Which endpoints or cron jobs reach it? | get_blast_radius |
What's in this module, what does it depend on, who calls into it? | get_module_context |
Is this code dead or wired in? What can I delete? | get_unused_code |
How is the repo laid out? Which module owns this? What's the repo called? | get_codebase_map |
Several of these at once (planning a change, reviewing a PR) | pharaoh_recon |
The graph reflects the default branch at its last mapped push, and a response says when a newer push is still being mapped. Grep and file reads cover what it leaves out: code that isn't on the default branch yet (other branches, uncommitted edits), literal text (strings, error messages, config values, comments, non-code files) and renames, which change every reference, tests and mocks included.
On a verified local connection, get_blast_radius also analyzes saved worktree files. The active NPX hook supplies the checkout reference for local analysis. Hosted scope queries the default-branch graph.
Repos
Repos are mapped through the Pharaoh GitHub App, installed on the account or org that owns them: https://github.com/apps/pharaoh-so/installations/new. The App reads the repositories it is installed on and the organization's membership; its only write permission is posting check results. Mapped repos re-map on every push. search_functions accepts any of the user's mapped repo names.
Tools take the short repo name in their repo parameter (e.g. "pharaoh", not "org/pharaoh"). Unambiguous short names resolve automatically. A name that doesn't resolve returns suggestions and the user's repos grouped by organization.
Account
pharaoh_account shows each workspace's plan. Every repo is mapped during the trial and on Pro; after the trial, get_codebase_map keeps answering and the other tools say what's needed. pharaoh_manage_repo queues a re-map of a repo now.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| resources | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_codebase_mapA | A repo's architecture in one call. CALL THIS WHEN: • Orienting in a repo or locating a module • The mapped repo name is unknown RETURNS: Modules and LOC, dependencies and cycles, hot files (5), endpoints (50), entry points (30), exact clones and high-risk functions without direct test links. |
| pharaoh_reconA | Several Pharaoh queries in one call, run in parallel: codebase map, module profiles, function searches, blast radius and module dependency paths. CALL THIS WHEN: • Planning a change, reviewing a PR or assessing architecture, when the modules and functions to check are known RETURNS: Each requested section in one response, as the single-purpose tools return it. Per call: up to 5 modules, 3 searches, 3 blast radius targets, 3 dependency pairs. |
| get_module_contextA | One module's profile: what it contains, depends on and is called by. CALL THIS WHEN: • Changing code in a module, or planning a change to it • Finding what a module exports, depends on, or which code calls into it RETURNS: Files, LOC, exported signatures with complexity, imports in and out, DB tables, endpoints, cron jobs, env vars, and callers in other modules, grouped by module. |
| get_blast_radiusA | What a change to a function, file or module reaches. CALL THIS WHEN: • Changing a signature, refactoring or deleting code • Finding a change's callers or entry points RETURNS: Detected production callers (depth 1 is direct only). Hosted adds risk, endpoints, cron jobs and DB operations. Verified worktrees report saved-file callers and coverage. |
| search_functionsA | Find functions by name or concept across the whole codebase. CALL THIS WHEN: • Checking whether a function, helper or utility already exists • Finding where something is implemented (e.g. "retry", "validate", "notify") RETURNS: Matching functions with file path, line range, module, signature, export status and complexity. Matches name parts (camelCase, snake_case) and file paths, not comments; test code ranks last. SCREAMING_SNAKE queries, and queries no function matches, return matching constants with up to 80 characters of each value. |
| get_unused_codeA | Find code nothing runs: functions no production entry point (endpoint, CLI command, cron job, event handler, worker, entry file) reaches. CALL THIS WHEN: • Cleaning up a module or deleting a function • Confirming new code is reached from an entry point RETURNS: Reachability through the call graph, not text references.
• Dead: unreached, named in no other file, and no import of its file could reach it.
• Possibly unused: unreached, but named in other files (string dispatch, dynamic loading) or an import of its file could reach it. Listed with the files that name it.
• Used only by tests: exported functions and class methods only test files reference.
With |
| get_issueA | A Codebase Health issue by its Pharaoh ID: one repo's exact duplicates, dependency cycles or complex functions, or one finding among them. CALL THIS WHEN: • A prompt or an earlier answer gives you an issue ID (pharaoh:owner/repo:…) RETURNS: The repo's live Health score and mapped commit; each finding's ID, files, related findings and file-disjoint group; and the points its removal adds to the score. |
| pharaoh_setupA | Pharaoh's connection and setup status for the repo you're working in. Writes no files. CALL THIS WHEN: • The user asks to set up Pharaoh, or to check its setup • Pharaoh was just connected and the user asks what to try first RETURNS: Connection, mapped-repo and access status, a Codebase Health link, optional first-use choices, and the Pharaoh-first instructions line only when needed. |
| pharaoh_accountA | Your Pharaoh plan and mapped repos in each workspace. Changes nothing. CALL THIS WHEN: • Checking which plan a workspace is on • A tool says the plan doesn't include it, or a repo isn't mapped • Finding the setup page or the billing page RETURNS: Each workspace you can access with its plan and tracked-repo count, whether its repos are mapped on every push, the setup page, and the billing page when a workspace has a billing account. |
| pharaoh_manage_repoA | Re-map a repo now. Every repo is mapped during the trial and on Pro, and re-maps on every push. • refresh_repo { repo, full? }: queue a re-map of one repo. • set_free_repo { repo }: retired; it changes nothing, since there is no live repo to choose. CALL THIS WHEN: • A repo's graph looks out of date, or needs a full rebuild RETURNS: The queued job. |
| pharaoh_updateA | Update the npx proxy to the newest Pharaoh release, with the user's consent. CALL THIS WHEN: • The user asks to update Pharaoh, or accepts a notice that a new Pharaoh version is available RETURNS: On the npx proxy, whether the newest release passed verification (npm's registry signature and its build provenance) and is staged; it becomes active at the next session start. On a hosted connection, that it is already current. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| pharaoh-trace | Compact, expandable evidence from Pharaoh tool results. |
TDQS
Scored across 11 tools
Most tools target distinct concepts: architecture map, module profile, function search, blast radius, dead code, health issue, and account/setup/update admin. However, pharaoh_recon explicitly batches get_codebase_map, get_module_context, search_functions and get_blast_radius, so an agent must decide between the batch call and the single-purpose tools; get_module_context's 'callers in other modules' also partially overlaps get_blast_radius.
Two clear families exist: query tools use get_/search_ prefixes (get_blast_radius, get_issue, get_codebase_map, get_module_context, get_unused_code, search_functions) and admin tools use a pharaoh_ prefix (pharaoh_account, pharaoh_setup, pharaoh_update, pharaoh_manage_repo, pharaoh_recon). The grouping is readable, but mixing get_ with pharaoh_ prefixes and noun-style names (pharaoh_account, pharaoh_setup) with verb-style names (pharaoh_update, pharaoh_manage_repo) is a minor inconsistency.
11 tools is well within a comfortable range and each covers a distinct analysis surface or a distinct account operation. No tool feels like filler; pharaoh_recon is a justified convenience wrapper and pharaoh_update/setup are small but purposeful.
The read-only codebase-intelligence surface is broad (map, module, search, blast radius, dead code) but get_issue requires a Pharaoh issue ID from elsewhere, and no tool lists a repo's Codebase Health findings — an agent with no ID hits a dead end. There is also no way to enumerate all findings across a repo or filter them, though core analysis workflows are otherwise covered.