How Pharaoh Works
Pharaoh parses your codebase using tree-sitter — a deterministic parser with zero hallucination risk —
into a Neo4j knowledge graph. Functions, files, modules, imports, exports, call chains, HTTP endpoints,
cron handlers, database access patterns, and environment variables are all extracted as nodes and edges.
Your AI tool connects via Model Context Protocol (MCP) and queries the graph for structural context
before writing or modifying code.
Parsing takes approximately 60 seconds for a 50K LOC TypeScript project. The graph re-indexes
automatically via GitHub webhook on every push to the default branch.
FAQ
Does Pharaoh store my source code?
No. Pharaoh stores structural metadata only — function signatures, file paths, import/export relationships, call edges, complexity scores. No source code, comments, string literals, or variable values are ever stored. The graph is architectural, not textual.
How long does initial setup take?
Under 5 minutes. Install the GitHub App, select repos, add the MCP endpoint to your AI tool. Pharaoh parses the codebase automatically. A 50K LOC TypeScript project maps in about 60 seconds.
How does the graph stay current?
Pharaoh installs a GitHub webhook that triggers re-mapping on every push to your default branch. The graph is always within one commit of HEAD. You can also trigger manual refresh via the account management tool.
What languages does Pharaoh support?
TypeScript and Python today, with full support for imports, exports, call chains, decorators, and barrel files. More languages are planned — Pharaoh's parser is built on tree-sitter, which supports 100+ languages.
How is Pharaoh different from Sourcegraph?
Sourcegraph helps AI find code across repositories — text search, symbol navigation, code intelligence. Pharaoh tells AI what happens if you change that code — blast radius, dependency chains, reachability from production entry points. Sourcegraph answers "where is it?" Pharaoh answers "what breaks?"
How is Pharaoh different from CodeScene?
CodeScene analyzes individual file health using git history patterns — complexity trends, code age, developer coupling. Pharaoh analyzes cross-module architectural relationships using a knowledge graph — how modules connect, what depends on what, which functions are reachable from production. CodeScene is behavioral; Pharaoh is structural.
How is Pharaoh different from SonarQube?
SonarQube performs line-level static analysis — bugs, code smells, security vulnerabilities, style violations. Pharaoh provides system-level structural intelligence — blast radius, dead code via entry-point tracing, module boundary analysis. SonarQube looks at lines; Pharaoh looks at architecture.
Can I use Pharaoh with private repositories?
Yes. The GitHub App requests read-only access to repository contents. All graph data is tenant-isolated. Pharaoh never writes to your repository.
What happens if I cancel?
Your graph data is deleted. Pharaoh has no lock-in — it reads your code, it doesn't store it. Re-subscribing re-maps from scratch.