> 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/tools-reference/orient.md).

# Orient Tools

Understand the codebase before changing it. All Orient tools are free.

## pharaoh\_recon

**Question it answers:** "What do I need to know about this codebase before starting work?"

Batched reconnaissance — runs codebase map, module context, function search, and blast radius queries in parallel, server-side, in a single call. Designed for the start of any task that needs multiple pieces of context at once.

**When to use:** Starting a new task, running a plan review, PR review, or architecture assessment.

**Parameters:**

* `repo` (required): Repository name
* `include_map` (optional): Include codebase map (default: true)
* `modules` (optional): Module names to get context for (max 5)
* `functions` (optional): Function search queries (max 3)
* `blast_radius` (optional): Blast radius targets (max 3)
* `dependencies` (optional): Module dependency pairs to trace (max 3)

## get\_codebase\_map

**Question it answers:** "What modules exist and how do they relate?"

Returns all modules with file counts and lines of code, the dependency graph with weights and bidirectional warnings, hot files (most changed in the last 90 days), and all HTTP endpoints with their handler files.

**When to use:** Starting any new conversation. This is the first call — always.

**Parameters:**

* `repo` (required): Repository name
* `include_metrics` (optional): Include LOC, complexity, change frequency

## get\_module\_context

**Question it answers:** "What does this module look like before I modify it?"

Returns the complete module profile in \~2K tokens: file count, LOC, all exported function signatures with complexity, dependency graph (imports from + imported by), DB table access, HTTP endpoints, cron jobs, env vars, vision spec alignment, and external callers from other modules.

**When to use:** Before modifying code in a module, writing a PRD, or checking what depends on a module.

**Parameters:**

* `repo` (required): Repository name
* `module` (required): Module name (e.g., "auth", "db", "mcp")

## search\_functions

**Question it answers:** "Does this already exist somewhere?"

Searches all functions across the entire codebase by name or partial match. Returns file paths, line numbers, module, export status, async flag, complexity scores, and full signatures.

**When to use:** Before creating any new function. Search first, import if it exists.

**Parameters:**

* `repo` (required): Repository name
* `query` (required): Function name or partial match
* `module` (optional): Filter to a specific module
* `exported_only` (optional): Only show exported functions

## get\_design\_system

**Question it answers:** "What UI components and tokens already exist?"

Discovers design system components, color tokens, typography scales, spacing values, and common anti-patterns in the codebase.

**When to use:** Before creating any UI component. Check what already exists and follow established patterns.

**Parameters:**

* `repo` (required): Repository name


---

# 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/tools-reference/orient.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.
