Inside Meta’s Developer Tooling: How Integrated Systems and Stack Diffs Revolutionize Code Review
When it comes to software development at scale, Meta (formerly Facebook) stands out not only for its products but for the sophisticated internal tooling that powers its engineering teams. Thomas Rer, a former Meta developer tools engineer and now co-founder of Graphite, shares invaluable insights into Meta's developer ecosystem, the evolution of code review practices like stacked diffs, the shift to monorepos, and the impact of AI on modern software engineering.
Meta’s Unique Developer Tooling Ecosystem
Unlike many companies that rely on popular third-party tools like GitHub or Jenkins, Meta built a deeply integrated internal developer platform from the ground up. This ecosystem includes:
- Fabricator: Meta’s internal code review tool.
- Sandcastle: The continuous integration (CI) system responsible for building and testing before release.
- OnDemand: Internal developer machines that provide consistent dev environments.
- Landcastle: The deployment system that manages code rollout to users.
- Custom Task System: Deeply integrated with pull requests, blending issue tracking and code review.
This level of integration means developers can track a code change from review through testing, deployment, and even experiment results—all within a unified interface. For example, after landing a change, a developer can immediately see rollout percentages, related feature flags, and A/B test outcomes.
Herald and Butterfly Bot: Automating Code Review Workflows
Meta developed a rules engine called Herald, later replaced by Butterfly Bot, enabling automated responses to code review events. Some practical uses included:
- Posting automated comments alerting developers to deprecated APIs and suggesting updated usage.
- Automatically notifying teams or adding reviewers when critical parts of the codebase are modified.
- Managing “subscribers” who want to be CC’d on changes without necessarily reviewing them.
This automation helped enforce best practices and reduce manual overhead during code reviews.
Code Ownership: A Complex Evolution
Code ownership at Meta experienced several iterations:
- Initially, code owners were required to review changes in their respective areas.
- Later, the policy was relaxed to promote a more collaborative culture.
- Then reintroduced again as the complexity of the monorepo grew.
The key takeaway is that effective code ownership balances trust, collaboration, and enforcement, often varying by the criticality of the codebase area (e.g., privacy-sensitive code demands stricter controls).
Compared to GitHub’s coarse CODEOWNERS
file, Meta and Google implemented hierarchical ownership models allowing fine-grained control over reviewers based on folder structure, enabling easier identification of responsible teams.
The Power of Stacked Diffs
One of the most innovative practices developed at Meta is the use of stacked diffs (also known as stacked pull requests). This technique addresses a common blocker in software development: waiting for code review before continuing development on dependent features.
What Are Stacked Diffs?
Instead of creating a single large pull request, developers can create a series of smaller, dependent pull requests stacked on top of each other. This allows:
- Parallel reviews of smaller, more digestible changes.
- Developers to keep building new features without waiting for previous diffs to merge.
- Reduced merge conflicts and faster iteration cycles.
- Easier identification and rollback of faulty changes.
Why Aren’t Stacked Diffs More Common?
While the concept is straightforward, the tooling required to manage branch dependencies and rebasing is complex. Many developers find rebasing intimidating and error-prone without automated support. Meta, Google, and some other large tech companies built internal tools that automate these workflows, making stacking seamless.
Open-source communities and smaller companies often lack these tools or the trust model required for partial, incremental changes, making stacked diffs less suitable for those environments.
Monorepos vs. Polyrepos: Meta’s Journey
Meta started with multiple large repositories ("poly-liths") but moved towards a monorepo strategy, unifying code for iOS, Android, web, and backend services. The advantages include:
- Easier collaboration across teams.
- Simplified dependency management.
- Consistent enforcement of code standards and review policies.
- More reliable and unified CI/CD pipelines.
While monorepos bring challenges, like scaling source control and build systems, Meta and Google’s experiences show that the benefits often outweigh the costs at scale.
GitHub and many open-source projects still favor polyrepos due to the differing needs of distributed authorship, versioning, and independence.
The AI Revolution in Software Development
AI-powered coding tools are transforming how software is written:
- Increased Code Volume: Developers can generate more code faster, increasing the number and size of pull requests.
- Greater Need for Robust Code Review: More code means more potential bugs, making code review and testing more critical.
- AI-Assisted Code Review: AI can automate mechanical checks, flag potential issues, and free human reviewers to focus on design, intent, and architectural concerns.
- Automated Testing: AI can generate tests alongside code, improving coverage and reducing manual QA efforts.
However, AI also presents risks such as developers becoming overly reliant on generated code without fully understanding it, potentially leading to buggy or insecure software. Human accountability remains essential.
Lessons from Building Developer Tooling at Graphite
After leaving Meta, Thomas and his team founded Graphite to bring stacked diff workflows and advanced code review tooling to broader audiences beyond large tech companies. They found that:
- Many companies lack the deeply integrated, mature tooling found at Meta or Google.
- Adoption of new paradigms like stacked diffs requires cultural shifts and education.
- Developer velocity and code review efficiency are increasingly recognized as critical metrics for engineering success.
Key Engineering Metrics to Track
Leading engineering organizations track metrics such as:
- Number of pull requests.
- Time to merge pull requests.
- Time pull requests spend waiting for review with no clear next steps.
- Developer focus time and uninterrupted coding periods.
These metrics help identify bottlenecks and improve team productivity.
Final Thoughts
Meta’s approach to developer tooling—building deeply integrated, custom systems—offers valuable lessons in scaling engineering productivity. Innovations like stacked diffs and hierarchical code ownership help reduce friction, improve code quality, and accelerate delivery.
As AI continues to enter the software development lifecycle, tools and processes will evolve further, but the need for thoughtful code review, testing, and human oversight will remain critical.
For engineering teams looking to improve, understanding these trends and adopting practices like stacked diffs and monorepos can be powerful steps forward.
Recommended Reads and Resources
- Pragmatic Engineer Deep Dives on Stacked Diffs
- "The Timeless Way of Building" by Christopher Alexander (on architecture and creating self-sustaining systems)
- "The Last Days of Night" by Graham Moore (a historical fiction about the race to invent the light bulb)
If you’re interested in how cutting-edge engineering teams operate and want to improve your organization’s developer velocity, keeping an eye on these tooling trends and cultural shifts is essential. The future of software development is integrated, automated, and AI-augmented—but still fundamentally human at its core.