Pharaoh Blog

How AI coding agents break real codebases, and what to give them before they edit.

Assessing shared library change risk before making updates

How to Assess the Risk of Changing a Shared Library

The article explains why small changes to shared libraries can create large, delayed failures across applications, jobs, and teams. It recommends assessing actual exports, defaults, direct and transitive runtime consumers, compatibility risks, and critical paths such as authentication or billing—not

Kyle · · 23 min read
AI edited wrong file and how to find the correct one

Why AI Edited the Wrong File—and How to Find the Right One

The article explains why AI coding agents often edit wrappers, legacy copies, generated files, or other inactive modules when repositories contain duplicate names and unclear structure. It argues that filename search and plausible diffs are insufficient; developers should trace the runtime entry poi

Kyle · · 26 min read
Find interface implementations—codebase checks before changing a contract

How to Find Interface Implementations Before Changing a Contract

The article presents a workflow for safely changing TypeScript interfaces and other contracts. It emphasizes finding explicit and structural implementers, tracing factories, dependency-injection bindings, registries, adapters, and polymorphic callers—not just searching for `implements`. IDE navigati

Kyle · · 26 min read
Trace feature flag usage before safely removing a flag

How to Trace Feature Flag Usage Before Removing a Flag

The article explains how to safely remove stale feature flags by combining exact searches, dependency-graph mapping, runtime telemetry, and flag configuration review. It distinguishes rollout completion from cleanup safety and advises preserving intentional kill switches. A repeatable workflow cover

Kyle · · 25 min read
Component dependency graph for assessing shared UI changes

Use a Component Dependency Graph Before Changing Shared UI

The article argues that shared UI changes require evidence-based impact analysis, not import counts or tribal knowledge. It recommends using a local component dependency graph to trace direct callers, wrappers, routes, props, and high-risk user flows before editing. The graph should be supplemented

Kyle · · 23 min read
Code testing workflow showing what tests to run after code change

Which Tests Should You Run After a Code Change?

The article argues that post-change test selection should be based on behavioral impact and code reachability, not simply rerunning CI or choosing tests from a diff. It recommends mapping callers, entry points, affected modules, data boundaries, and contracts, then selecting tests by confidence laye

Kyle · · 17 min read
Knowledge graph vs RAG comparison for helping AI understand and change code

Knowledge Graph vs RAG: Which Context Helps AI Change Code?

The article compares RAG and code knowledge graphs for AI-assisted software changes. RAG efficiently finds source details, errors, tests, and examples, while graphs expose callers, dependencies, ownership, and potential blast radius. It argues for a hybrid workflow: map relationships first, retrieve

Kyle · · 26 min read
Background job dependency mapping from scheduled jobs to the code they rely on

How to Map Background Jobs to the Code They Depend On

Background jobs create hidden change risk because triggers, workers, shared services, data stores, retries, and follow-on jobs often span multiple modules. The article recommends mapping every async entry point, tracing execution to side effects, and documenting upstream, downstream, retry, and fail

Kyle · · 27 min read
Code tracing workflow to find entry points in a codebase

How to Find the Real Entry Point for a Feature

The article explains how to identify a feature’s real runtime entry point instead of editing the first file that appears in search results. It recommends starting with a concrete trigger, tracing the first application-owned handoff, checking callers and side effects, and verifying the path with test

Kyle · · 24 min read
Claude Code workflow for safe, coordinated changes across multiple files

A Claude Code Workflow for Safe Multi-File Changes

The article presents a controlled workflow for safe Claude Code multi-file edits: map the blast radius, trace callers and dependencies, inspect source, and identify tests and configuration before changing code. It recommends approving a precise plan with file boundaries, executing in phases or isola

Kyle · · 24 min read
One-shot coding with Pharaoh for complete projects

How I One-Shot Coding Projects with Pharaoh

The article presents a map-first workflow for one-shot coding with Pharaoh in existing multi-module repositories. It recommends defining acceptance criteria, checking map freshness, tracing callers and blast radius, and inspecting source before briefing an agent. The approach emphasizes reuse, narro

Kyle · · 23 min read
Developer performing code change impact analysis safely before deployment

How to Perform Code Change Impact Analysis Safely

The article explains how code change impact analysis replaces guesswork with evidence before modifying shared logic, APIs, schemas, queues, or other high-risk areas. It recommends defining the change boundary, checking direct and transitive dependents, tracing database and service contracts, assessi

Kyle · · 18 min read
Repository context for AI coding as the missing layer

Repository Context for AI Coding: The Missing Layer

AI-generated code can compile yet harm a repository when it lacks awareness of existing helpers, callers, tests, service boundaries, and dependencies. The article argues that repository context—a relationship-preserving map or graph—is more valuable than larger prompts for preventing duplication, ar

Kyle · · 23 min read
Developer improving results with architecture aware AI coding

Using Architecture-Aware AI to Improve Coding Results

Architecture-aware AI coding gives assistants a map of system boundaries, dependencies, callers, contracts, consumers, dead code, and blast radius before they edit. The article argues that stronger prompts cannot replace missing architectural context, especially for shared events, distributed system

Kyle · · 24 min read
Monorepo dependency analysis mapping code dependencies across projects

Monorepo Dependency Analysis: How to Map Code Dependencies

Monorepo dependency analysis maps internal relationships—imports, calls, build targets, entry points, and transitive dependents—to reveal blast radius, cycles, dead code, and CI impact. The article recommends layered, continuously refreshed graphs that distinguish runtime, type-only, external, and c

Kyle · · 25 min read
11 codebase context essentials for effective AI coding assistants

11 Codebase Context Essentials for AI Coding Assistants

The article argues that AI coding assistants need more than file-level context to make safe changes in complex repositories. It outlines 11 key context layers, including architecture, dependencies, conventions, type hierarchies, history, symbols, call graphs, blast radius, affected tests, and dead c

Kyle · · 24 min read
Dependency impact analysis before code refactoring

Dependency Impact Analysis Before Refactoring

The article presents dependency impact analysis as a way to map refactoring risk before editing shared code. It distinguishes direct, transitive, and contextual impact, emphasizing callers, entry points, contracts, runtime wiring, and test gaps. It recommends using dependency graphs and behavioral m

Kyle · · 20 min read
AI coding tools comparison for navigating and maintaining complex codebases

AI Coding Tools Comparison for Complex Codebases

This comparison evaluates seven AI coding tools for complex codebases, emphasizing repository comprehension, dependency tracing, multi-file changes, testing, failure recovery, and governance over autocomplete. Claude Code leads for deep repo understanding and long refactors; Cline offers control and

Kyle · · 34 min read
Service dependency graph for modern software teams

Service Dependency Graph for Modern Software Teams

The article explains how living service dependency graphs reveal relationships among services, code, repositories, data stores, deploys, environments, and owners. It argues that combining static, runtime, and declared dependency data improves incident response, blast-radius analysis, refactoring, de

Kyle · · 24 min read
Software dependency graph for engineering teams

Software Dependency Graph for Engineering Teams

The article explains how living, queryable software dependency graphs reveal blast radius, callers, downstream services, test coverage, deployment relationships, and dead code before changes are made. It argues that combining static and runtime data is essential for refactoring, service retirement,

Kyle · · 26 min read
Code knowledge graph enabling smarter software architecture

Code Knowledge Graph for Smarter Software Architecture

The article argues that folder trees, grep, vector search, and large prompts cannot reliably reveal software architecture. Code knowledge graphs model typed relationships—callers, entry points, dependencies, configuration, data flows, and cross-repository paths—to support blast-radius analysis, safe

Kyle · · 19 min read
Engineer’s guide to RAG for code generation

RAG for Code Generation Explained: A Guide for Engineers

The article explains how RAG improves AI code generation by retrieving relevant code, tests, configuration, and dependency information before edits. It emphasizes hybrid retrieval, sensible chunking, fresh indexes, focused context, and iterative validation over simply expanding prompts or context wi

Kyle · · 25 min read
AI coding tools overlooking hidden code dependencies

Hidden Code Dependencies That AI Coding Tools Miss

AI coding tools can miss hidden dependencies beyond imports and local symbol references, causing delayed failures despite passing tests. The article catalogs risks involving dynamic loading, async events, feature flags, implicit configuration, generated code, and cross-repository consumers. It recom

Kyle · · 20 min read
AI coding multiple repositories for engineering teams

AI Coding Across Multiple Repositories for Engineering Teams

AI coding across multiple repositories requires more than opening several folders or writing better prompts; it depends on understanding contracts, callers, ownership, infrastructure constraints, and merge order. The article recommends mapping dependencies before editing, defining the shared contrac

Kyle · · 24 min read
Microservices dependency graph illustrating distributed system connections

Microservices Dependency Graph for Distributed Systems

The article argues that microservices dependency graphs reduce change risk by revealing code-level and runtime relationships across services, endpoints, events, data stores, configuration, and external systems. It distinguishes build-time dependencies from runtime failure paths, emphasizing asynchro

Kyle · · 25 min read
Service dependency mapping across multiple code repositories

Service Dependency Mapping Across Repositories

Service dependency mapping reveals how repositories, services, APIs, events, schemas, configuration, deployment order, and ownership are connected, helping teams assess change impact before incidents occur. The article distinguishes cross-repository service maps from local code and monorepo graphs,

Kyle · · 22 min read
Seven static analysis limitations in large codebases

7 Static Analysis Limitations in Large Codebases

The article explains why static analysis alone cannot reveal a large system’s full behavior, especially with reflection, dynamic dispatch, configuration-driven wiring, generated code, async boundaries, and path complexity. It contrasts local linting and defect detection with architecture intelligenc

Kyle · · 25 min read
AI-generated illustration of a developer evaluating code and dependency notes

A Framework for Evaluating 8 AI Code Understanding Tools

The article compares eight AI code understanding tools, including Pharaoh, Amazon Q, Greptile, Qodo, Cody, Cursor, Bito, and GitHub Copilot. It distinguishes architecture mapping, IDE assistance, PR review, governance, and context-routing tools, emphasizing that they solve different problems. The ke

Kyle · · 28 min read
Compare Claude Code and Cursor: six tools for navigating large code repositories

Compare Claude Code and Cursor: 6 Tools for Large Repos

The article compares Aider, Amazon Q Developer, Cursor, GitHub Copilot, Claude Code, and Cline for large-repository development. It argues that dependency awareness, cross-module context, testing, recovery, and change visibility matter more than terminal-versus-editor interfaces. Each tool suits dif

Kyle · · 27 min read
Repository intelligence vs. code search for AI development

Repository Intelligence vs. Code Search for AI Development

The article compares code search with repository intelligence in AI-assisted development. While search locates names and text, repository intelligence maps callers, dependencies, live paths, tests, dead code, and blast radius, enabling safer refactors and edits. It explains when each approach is app

Kyle · · 24 min read
Best MCP servers for Codex compared by features and use cases

Best MCP Servers for Codex: Top Picks Compared

The article compares three MCP servers for Codex based on the type of context they provide: Pharaoh for repository architecture, dependencies, blast-radius analysis, and fresh codebase intelligence; Sentry MCP Server for production errors, performance issues, and incident debugging; and AgentScout f

Kyle · · 33 min read
Architecture graph showing system components and dependencies for engineering teams

Architecture Graphs: A Practical Guide for Engineering Teams

Architecture graphs provide a living, queryable model of repositories, services, modules, callers, endpoints, events, config usage, and ownership. Unlike static diagrams, dependency trees, or code search, they reveal real change impact across monorepos and multiple repositories. The article explains

Kyle · · 16 min read
8 best MCP servers for Cursor for developers

Best MCP Servers for Cursor: 8 Picks for Developers

The article reviews eight MCP servers for Cursor, arguing that usefulness comes from scoped, current evidence—not the largest tool list. It covers Pharaoh for codebase dependencies, Context7 for versioned docs, Playwright for browser workflows, Supabase for database operations, PostHog and Sentry fo

Kyle · · 30 min read