---
title: "Build an artifact into your codebase"
description: "Hand the changes you made to an artifact to the agent, which writes them into the page of your app the artifact came from."
url: https://help.modeinspect.com/en/articles/51-build-an-artifact-into-your-codebase
collection: "Build mode"
updated: 2026-11-27
language: en
---

# Build an artifact into your codebase

Hand the changes you made to an artifact to the agent, which writes them into the page of your app the artifact came from.

When an artifact looks the way you want, send its changes to the agent so it writes them into your real code. The agent works on the page the artifact came from.

**Before you start**

-   An artifact made from a Portal, with changes, see [Edit an artifact with the agent](https://help.modeinspect.com/en/articles/52-edit-an-artifact.md). If you picked a variant or changed a control, that is the version that gets built.
    

## Steps

1.  Select the artifact on the canvas and click **Build in Codebase** at the top of the design panel. Right-clicking the artifact gives the same item.
    
    ![The design panel of a selected artifact with Build in Codebase highlighted](https://staticfiles.gleap.io/p6a1872808f187689a3937fa3/AvQAxRRdI6x1lKlBfvhRwOSRhZN0s0SXvHX4pGgC3Qp8DftltkIgxQ8vdSsIu0RPGdm7artHCJV.png)
2.  Build Mode opens on the Portal the artifact came from, at the same page and width. The artifact sits above the message field as a chip.
    
3.  Type anything the agent should know, or leave the field empty. An empty send gives it the instruction "Build the artifact's changes into the product."
    
4.  Send. The agent compares the artifact with the page it was made from and changes the code to match. The page on the stage reloads with the change.
    
    ![Build Mode after the build. The agent's reply names IssueRow.tsx, and every issue row on the stage is amber with a bold title](https://staticfiles.gleap.io/p6a1872808f187689a3937fa3/3aahno2yWKrgKW6YnM7yXjK2V62xDx9zAIzvhV8WoolfT0cVUDYIygQRXG4kPhHXiI0XgTUPzb9.png)

From here it is a normal Build Mode change: check it on the stage, then open a pull request, see [Create a pull request](https://help.modeinspect.com/en/articles/46-create-a-pull-request.md).

In Build Mode on the artifact itself, **Build in Codebase** also appears above the message field once the artifact has changes.

## If it does not work

-   **"This artifact has no changes to build yet"**: the artifact still matches the page it came from. Change it first.
    
-   **"Add the app to this page to build into it"**: the canvas page has no Portal to build into. Add one, see [Add a Portal to the canvas](https://help.modeinspect.com/en/articles/31-add-a-portal.md).
    
-   **"This artifact is still importing its interactions"**: wait until the artifact is unlocked, then try again.
    

## Related

-   [What is an artifact](https://help.modeinspect.com/en/articles/54-what-is-an-artifact.md)
    
-   [See the code the agent changed](https://help.modeinspect.com/en/articles/49-view-code-changes.md)
    
-   [Create a pull request](https://help.modeinspect.com/en/articles/46-create-a-pull-request.md)

## Related

- [What is Build Mode](https://help.modeinspect.com/en/articles/30-what-is-build-mode.md)
- [Open Build Mode and move around your app](https://help.modeinspect.com/en/articles/29-open-build-mode-and-move-around-your-app.md)
- [Preview your app at different screen sizes](https://help.modeinspect.com/en/articles/27-preview-your-app-at-different-screen-sizes.md)
- [From a captured frame to code](https://help.modeinspect.com/en/articles/25-from-a-captured-frame-to-code.md)
- [Attach a frame to the build chat](https://help.modeinspect.com/en/articles/22-attach-a-frame-to-the-build-chat.md)
