Skip to main content

Set Up CLAD in Codex

Connect Codex to Lens Studio through the MCP server and install the CLAD plugin, so Codex can build and test Lenses in your project.

  • Snapchat: fully supported
  • SPECS: fully supported
  • Camera Kit Web: not supported
  • Camera Kit Mobile: not supported
  • SnapchatFully supported
  • SPECSFully supported
  • Camera Kit WebNot supported — CLAD's skills cover Snapchat and SPECS Lenses
  • Camera Kit MobileNot supported — CLAD's skills cover Snapchat and SPECS Lenses

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Not supported — CLAD's skills cover Snapchat and SPECS Lenses.

  • Camera Kit Mobile — Not supported — CLAD's skills cover Snapchat and SPECS Lenses.

Codex connects to the project you have open in Lens Studio through the Lens Studio MCP server, and the CLAD plugin gives it the agents and skills to build, test, and publish Lenses. Follow these steps in order: Lens Studio has to be running before Codex starts, so Codex finds its server.

Before you start

Install Codex

Install the Codex command-line tool. The Codex documentation has the current instructions; these are the install commands.

On macOS, in Terminal:

curl -fsSL https://chatgpt.com/codex/install.sh | bash

This downloads the install script (-L follows redirects) and runs it in your shell.

On Windows, in PowerShell:

irm https://chatgpt.com/codex/install.ps1 | iex

This downloads the install script with irm (Invoke-RestMethod) and runs it with iex (Invoke-Expression).

Check that Codex runs:

codex --version

Install the CLAD plugin in Codex

Run these commands in a terminal, before you start Codex.

  1. Add the ls-extensions plugin marketplace:

    codex plugin marketplace add https://github.com/lens-studio-devs/ls-extensions.git
  2. Install the CLAD plugin from it:

    codex plugin add ls-clad@ls-extensions

You can do the same from inside Codex with the /plugins menu:

  1. At the Codex prompt, type /plugins.

    The Codex prompt with /plugins typed
  2. Move to [Add Marketplace], press Enter, and enter https://github.com/lens-studio-devs/ls-extensions.git.

    The Codex plugins menu with Add Marketplace selected
  3. Open the [ls-extensions] tab, select ls-clad, and select Install this plugin now.

The ls-extensions repository has the latest installation steps, and Plugins in the Codex documentation covers the plugin menu.

Start Codex in the project folder

  1. Open a terminal in the project folder: in Lens Studio, select File > Show Project in Terminal, or see Open the project folder in a terminal. The folder holds the .codex/config.toml file that tells Codex where this Lens Studio window's server is.

  2. Start Codex:

    codex
  3. If Codex asks whether you trust the folder, select Yes, continue. Codex reads the project's .codex/config.toml only in a trusted folder.

    Codex asking whether to trust the project folder, with Yes, continue circled

    Codex is ready when its prompt box appears. Type Codex commands there, not at the terminal's own prompt, which starts with a folder path:

    Codex running, with its prompt box under the model and folder
    A terminal prompt that starts with a folder path: Codex hasn't started here yet
  4. Run /plugins and check that ls-clad is installed.

Check that Codex is connected to Lens Studio

Run /mcp at the Codex prompt. lens-studio in the list means Codex can use the Lens Studio tools. If it's missing, see Troubleshoot Lens Studio MCP.

Let Codex work without asking at every step

A Lens build calls hundreds of tools. Lens Studio already approves its own tools in the project's .codex/config.toml. To have Codex review its other actions automatically, add these lines to ~/.codex/config.toml:

approval_policy = "on-request"
approvals_reviewer = "auto_review"

Use it in a project you can restore, such as one under version control.

Build a Lens with Codex and CLAD

Describe the Lens you want at the Codex prompt.

When building for SPECS, name the SPECS Experience Builder in the prompt. Codex follows it more reliably when you do:

Using the SPECS Experience Builder, make a periodic table Lens for SPECS that shows the atomic structure of each element

Codex builds the Lens in the open Lens Studio window, so you can watch the scene and Preview change. A full Lens can take 30 minutes or more.