> For the complete documentation index, see [llms.txt](https://pharaoh.so/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pharaoh.so/docs/setup/github-app.md).

# GitHub App

Pharaoh needs read-only access to your repos to build the knowledge graph. This is the first step before connecting any AI tool.

## Install

1. Go to [github.com/apps/pharaoh-so/installations/new](https://github.com/apps/pharaoh-so/installations/new)
2. Click **Install**
3. Choose your organization or personal account
4. Select **All repositories** or pick specific repos
5. Click **Install**

Pharaoh requests two permissions:

* **Repository contents** (read) - to parse code structure
* **Repository metadata** (read) - to detect pushes and branches

It cannot write to your repos, push commits, or modify code.

## What happens after install

Pharaoh clones each selected repo using read-only installation tokens, parses the code with [tree-sitter](https://tree-sitter.github.io/), builds a Neo4j knowledge graph of the architecture, and discards the source code.

This takes 1-3 minutes per repo depending on size. The graph contains function names, file paths, dependencies, complexity scores, and entry points. No source code is stored.

The graph re-maps automatically on every push to your default branch via webhooks. No maintenance required.

## Managing repos

To add or remove repos after install:

1. Go to **GitHub > Settings > Applications > Pharaoh**
2. Click **Configure**
3. Change repository access

Changes take effect within minutes. Added repos are mapped. Removed repos are purged from the graph.

## Next step

Connect your AI tool: [Claude Code](/docs/setup/claude-code.md) | [Claude.ai](/docs/setup/claude-ai.md) | [Cursor](/docs/setup/cursor.md) | [Windsurf](/docs/setup/windsurf.md) | [OpenClaw](/docs/setup/openclaw.md) | [Headless](/docs/setup/headless.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pharaoh.so/docs/setup/github-app.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
