Wed, Dec 17, 2025Inside Replit’s Snapshot Engine: The Tech Making AI Agents Safe
How Replit's snapshot engine makes AI agents safe: instant filesystem forks, versioned databases, and isolated sandboxes enable reversible AI development. Introduction At Replit, we’ve built a compute and storage fabric that allows us to make changes in an isolated, reversible way, almost like time travel. Envisioned initially to make Replit more powerful for professional developers and team collaboration, these primitives enable developers to experiment more frequently and faster, thanks to the speed at which they can clone a compute environment and start making changes to it. Later, when we built Replit Agent in 2024, we realized that the same primitives could superpower coding agents: not only does the system help the human driving the Agent, but the Agent itself also greatly benefits from these tools! One motivating example we discovered early in the development of Replit Agent is that giving an AI Agent direct access to your code and database can be risky: it might make a change you don’t like, or drop or alter your database in irreversible ways.
Mon, Dec 15, 2025Enabling Agent 3 to Self-Test at Scale with REPL-Based Verification
How Replit built a novel REPL-based verification system that combines code execution with browser automation to catch "Potemkin interfaces" (features that look functional but aren't), enabling Agent 3 to work autonomously for 200+ minutes. In 1783, Russia annexed Crimea from the Ottoman Empire. With war looming, the Russian Empress embarked on a six-month trip with several foreign ambassadors to garner more support. Grigory Potemkin, the minister responsible for rebuilding the region, realized the Empress and her visitors would never actually go ashore. He devised a scheme to hide the war-torn landscape by constructing "mobile villages." His men would dress as residents when Catherine's barge arrived, then disassemble the village after it left. Potemkin realized it was much cheaper to create the illusion of a vibrant town than to actually build one. If the people looking at the output don't look that close, why do more work than you need to?
Tue, Dec 9, 2025Building Production-ready Apps with Automated Database Migrations on Replit
Audience: Programmers and Engineers Skill level: Intermediate Introduction Separating development and production databases is fundamental to safe software development - it prevents accidental data loss, allows developers to test changes freely, and ensures production data remains stable and secure. Yet managing database changes between environments can be hard at the best of times, even sometimes for us engineers. Now imagine replacing the engineer with an AI agent, operating on behalf of a user who may not be aware of why having separate development and production databases is important or what a database migration even is - that’s when things get interesting. At Replit these are the types of challenges we strive to solve on a day to day basis. And managing database changes between environments seamlessly, safely and with as little user intervention as possible, was one of our most recent.
Wed, Mar 5, 2025Using Tvix Store to Reduce Nix Storage Costs by 90%
For the past few years, Replit has been using Nix to serve packages/dependencies and provide consistent development environments to our users. Nix on Replit allows users to have access to a large number of packages and libraries that can be seamlessly integrated into a user's project. Motivation In order to quickly serve thousands of packages to our users, we attach a large Nix store persistent disk to all development containers serving Replit apps. While this approach has worked well for a while, this persistent disk grows with every subsequent NixOS release (eventually reaching a size of 20Tb). When considering ways to reduce the size of this disk, one important constraint was to never remove store paths from the cache. Project that depend on packages in older Nix channel releases could still link to these store paths, so in order to maintain backwards compatibility those store paths must remain. Tvix Store Tvix is a new modular implementation of Nix that contains a series of components that can be used individually. One of these components is the Tvix store. tvix-store is a Nix store implementation backed by the tvix-castore. The tvix-castore manages blobs (file contents) and directory info (file metadata, like names, permissions, etc). tvix-store manages nix path info metadata, effectively creating a mapping of Nix store paths to tvix-castore contents.
Thu, Feb 27, 2025Introducing Workflows
With Workflows, you can easily save your development processes and organize them as a sequence of Tasks. Instead of having to repetitively type commands into your shell and remember them, Workflows provide an intuitive interface to configure your frequently used commands and execute them with the click of a button. Simplifying development with Workflows Workflows give you the ability to better organize your project execution pipeline, while offering an accessible interface to reuse them. Using the Workflows pane, you can easily configure specific buttons to run specific commands, and even link multiple Workflows together in a chain. Instead of copy pasting "cd ./client && npm run dev && cd ../server && node server.js", you can define the procedure as a Workflow with multiple Tasks. Let's see how it works with an example.
Wed, Feb 26, 2025Replit's All-new Database Editor
This week, we launched a new Database Editor feature on Replit. This feature is another addition to Replit’s full suite of tools that make it easy for anyone to build an app — no coding knowledge required. When you build an app on Replit, you get a fully-functioning project that’s ready to send out to the world. This includes real databases powered by Postgres: the most popular database in the world, that powers many of the applications you use every day. Did you know? Postgres is used by half of all professional software developers, according to StackOverflow’s developer survey. Replit handles all the setup and management of your databases, so it’s never been easier to get started. Now, we’re making it even easier to use databases on Replit. Inside your app’s workspace, head to the “database” pane, and click to the “My Data” tab. Here, you’ll see a spreadsheet-like view of your app’s data.
Tue, Nov 26, 2024So you suspect you have a memory leak...
Programming languages with Garbage Collectors are fantastic! You no longer need to keep track of every single piece of memory that your program needs to run and manually dispose of them. This also means that your programs are now immune to bugs like double-free (accidentally freeing a resource more than once, leading to crashes or security vulnerabilities) and most memory leaks (accidentally not freeing a resource, leading to crashes by running out of memory). But it is still possible to have a memory leak. Consider this TypeScript snippet: The global cache makes fibonacci fast, but it relies on a global cache that has no way of being cleared, so it will always accrue memory when it is called with larger and larger numbers. Slowly but surely. At some point during the development of Replit Agent, one of our engineers spotted the following graph in our dashboard: We had strong evidence that the agent processes were running out of memory roughly once an hour, and that likely means a memory leak. Since we were constantly serializing each agent process’ state to its Repl, we were able to recover without losing any data, but that meant that we had to re-run several LLM calls, and those tend to add up. This also implies that users would sometimes see some spurious slowdowns, so that was suboptimal too.
Fri, Oct 11, 2024Shell2: 200× faster, persisted, multiplayer-native Shells
What even is a terminal? Back when computers were still in their infancy, the “computer” usually was a big cabinet in the middle of a room. They typically exposed some internals via a front panel with lots of knobs and ports. Users would connect a terminal device (sometimes called a teletype or a TTY) to this front panel in order to input text and print the corresponding output. In the 1970s when microcomputers like the Apple I started becoming more mainstream, displays and keyboards started to be integrated into the computers themselves. The rise of the graphical user interface meant that the displays and keyboards weren’t just used for the terminals themselves but for various other graphical programs too. At some point, smart computer people thought “wait a minute, we can make a graphical program that just emulates what a terminal would have done anyways!” and thus the terminal emulator was born. In these emulators, the wires of the traditional TTY are replaced with pairs of file descriptors (an abstraction for a stream of bytes) known as the PTY (short for pseudo-TTY). Importantly for Replit, the PTY doesn’t use a serial port to connect the TTY to the computer which means we can operate a PTY remotely over a network!
Wed, Aug 14, 2024How Replit makes sense of code at scale
Data privacy and data security is one of the most stringent constraints in the design of our information architecture. As already mentioned in past blog posts, we only use public Repls for analytics and AI training: any user code that's not public — including all enterprise accounts — is not reviewed. And even for public Repls, when training and running analyses, all user code is anonymized, and all PII removed. For any company making creative tools, being able to tell what its most engaged users are building on the platform is critical. When the bound of what’s possible to create is effectively limitless, like with code, sophisticated data is needed to answer this deceivingly simple question. For this reason, at Replit we built an infrastructure that leverages some of the richest coding data in the industry. Replit data is unique. We store over 300 million software repositories, in the same ballpark of the world’s largest coding hosts like GitHub and Bitbucket. We have a deeply granular understanding of the timeline of each project, thanks to a protocol called Operational Transformation (OT), and to the execution data logged when developers run their programs. The timeline is also enriched with error stack traces and LSP diagnostic logs, so we have debugging trajectories. On top of all that, we also have data describing the developing environment of each project and deployment data of their production systems. It’s the world’s most complete representation of how software is made, at a massive scale, and constitutes a core strategic advantage. Knowing what our users are interested in creating allows us to offer them focused tools that make their lives easier. We can streamline certain frameworks or apps. Knowing, for instance, that many of our users are comfortable with relational databases persuaded us to improve our Postgres offering; knowing that a significant portion of our most advanced users are building API wrappers pushed us to develop Replit ModelFarm. We can also discover untapped potential in certain external integrations with third-party tools, like with LLM providers. It informs our growth and sales strategy while supporting our anti-abuse efforts. And, of course, it allows us to train powerful AI models. Ultimately, this data provides us with a strong feedback loop to better serve our customers and help them write and deploy software as fast as possible. While all this is true, it’s also not an easy feat. Several challenges come with making the best use of this dataset, and all stem from the astronomical magnitude of the data. We store on Google Cloud Storage several petabytes of code alone, and our users edit on average 70 million files each day, writing to disk more than 1PiB of data each month. This doesn’t even consider OT data, and execution logs, both in the same ballpark for space taken and update frequency. Going from this gargantuan amount of raw programming files to answering the question “What is being built?”, all while being mindful of user privacy, is, well, hard.
Mon, Jul 1, 2024Improved Dependency Management
We recently revamped the dependency management experience in your Replit workspace. You can now use and configure multiple languages in one Repl. We’ve consolidated language support, packages, and system dependencies into one new Dependencies pane for beginners and experienced developers alike! System Dependencies and Modules At Replit, we want to make it as easy as possible to spin up a project in the language of your choice without spending too much time on configuration. But, sometimes you have more specific requirements! That’s where System Modules and Dependencies come into play, under the “System” tab. We support most programming languages by bundling language servers, formatters and packagers via System Modules. For example, for Python there’s the Python Tools module, for Node.js there’s the Node.js Tools module, and so forth. If you use a template or import a project via GitHub, we do our best to automatically install the modules you need. If you want to use additional languages, you can simply add Modules that suit your needs. Under the hood, system modules are powered by Nix.
Fri, Apr 5, 2024Advanced port configuration
We recently spent a few months making ports easier to work with on Replit, so you can develop more complex apps predictably. What are ports? When a computer receives a TCP/UDP request, ports define which program that request should route to. (If you need a more basic explanation of TCP ports, start here). On a normal computer, you only have one layer of ports: your programs define a port that they listen to, and when traffic hits that port on your computer from the internet, it gets routed to the appropriate process. Some protocols have defined standard ports — for example, Simple Mail Transfer Protocol Secure (SMTPS), the email protocol, generally listens on port 587, and most web servers listen on either port 80 (HTTP, unencrypted) or port 443 (HTTPS, encrypted). You can think of ports like mailboxes. Imagine those big mailrooms in skyscrapers that ensure the mail lands in the right mailbox — the mail is the data being sent and received, and the mailboxes are the ports.
Fri, Mar 29, 2024Searching Nixpkgs in Under 30 Milliseconds
Today, we’re releasing the first version of rippkgs, a CLI utility for indexing and searching Nix expressions. With rippkgs, you can quickly search the nixpkgs available to your system with accurate results. Read on for more details about why we created it, how to use it, and how it works. Motivation At Replit, we use Nix to empower millions of users with hundreds of programming languages. The power of Nix’s reproducible expressions allows us to share system packages fearlessly and quickly with ultimate flexibility for end users. However, users are often not familiar with Nix, so we need to give them the tools they need to interact with it comfortably. Experienced Nix users looking to install or use a package may reach for nix-env, nix search, nix-locate, or search.nixos.org. These tools are excellent for visibility into what’s available in the largest package repository, nixpkgs. Unfortunately, none of these tools give us what we need to provide great search for Replit users: nix-env and nix search are bundled with Nix, which means they’re already accessible in Replit environments, but searching for a package can take several seconds - way too long for those of us who are impatient and just want to find what we’re looking for quickly. nix-locate works by indexing built derivation paths, which is great when you know the path you’re looking for (like /bin/jq), but not great when looking for a package with unknown output formats.
Thu, Feb 15, 2024Replit + pip
First-class pip support We’re thrilled to announce that first-class pip support is now available on Replit! This should work out-of-the-box when importing existing repositories from GitHub. For developers who want to switch from poetry to pip: start by deleting poetry.lock, then move your dependencies over from [tool.poetry.dependencies] to requirements.txt (structure hint: flask = "^3.0.2" would become flask>=3.0.2,<4 in requirements.txt), and finally, delete the other [tool.poetry...] sections from pyproject.toml. After that, the packaging infrastructure will use pip for all future operations going forward. Where we started When we first chose how to support Python packaging, we went with poetry: a newer packager, offering a compelling feature set. While we stand by the value of having reproducibility and the stability that brings, we also acknowledge the significance of pip as a tool in the wider Python ecosystem. One challenge we were trying to address in this change came in the form of following suggestions from AI assistants, StackOverflow, or blog posts that were written with the framing of pip being the “standard” packaging interface. Packages installed in this way would exist in an ephemeral state: both immediately available for use, but not yet recorded in the dependency list. This would no doubt result in frustration as a project that ran fine interactively in a Repl resulted in a ModuleNotFoundError during deployment.
Tue, Feb 6, 2024Easier Editing for .replit Files
At Replit, we want to make it easy to support any project configuration possible. This includes ensuring your binaries are in the right place and intelligent code completion works. Historically, the .replit file has been at the center of this, but the experience of editing the file is a process shrouded in mystery. While documentation exists for the file and what various configurations imply, it’s much more convenient if the documentation is visible inside the Workspace. Starting today, you’ll be able to edit your .replit file fearlessly. We’re now providing intelligent code completion and documentation for all .replit files, powered by Taplo - an LSP server for TOML files. Happy configuring! How we did it With Taplo, the only requirement for providing TOML linting and LSP functionality is a JSON Schema for the TOML file being described. Since we consume the .replit file in a Go codebase, we could use the Go jsonschema module to use our already-existing field tags for TOML deserialization in our JSON Schema properties. This means we were able to generate a JSON Schema without changing our struct definition!
Thu, Dec 28, 2023Landscape or Portrait? You Decide
People have expected apps to rotate with their mobile devices since before the introduction of the iPhone in 2007. It’s especially important for productivity apps to adapt and let people choose how they want to utilize their screen space. With the newest version of the Replit Mobile App, you can now code in both landscape and portrait modes. This creates a significantly improved experience on smaller tablets like the iPad mini or larger phones like the Pixel Fold. Want to code on the go with your iPad mini? Simply rotate it to portrait, then later, when you’re home, connect it to your wireless mouse & keyboard and rotate it to landscape for maximal screen space. This is the first of many more improvements to the Replit Mobile App, unlocking your ability to build and launch your next startup from your phone. Updating the Replit Mobile App to respond to orientation changes required navigating a few key areas: Accounting for screen edge insets Creating a friendly API for reacting to and inspecting orientation information Sizing screen content correctly based on orientation The Replit app is built using Expo for React Native, and we use the react-native-safe-area-context library to ensure we display UI in the safe areas of the screen. The addition of camera cut-outs and gesture-based navigation to most smartphones in recent years has made it even more important to account for screen-safe areas when building for a wide range of mobile devices. Properly accounting for screen-safe areas means that the app’s interface isn’t shown under the camera cut-out or behind the system navigation UI. Here’s an example with an iPhone 15 Pro: the non-safe areas where the camera cut-out and system navigation UI live are highlighted in red.

