# Settings, and where artifacts are kept

[中文](settings.zh-CN.md)

An artifact is a folder on your disk. This page says where a new one goes, how you choose, and where Open Artifacts
keeps its settings: one file of your own, and an optional file in a project.

## Where a new artifact goes

When the agent's call names no folder, Open Artifacts picks one and names it from the title:

| Location | Folder | What it means |
| --- | --- | --- |
| `home` | `~/OpenArtifacts/<project>/<slug>` | Under your **Open Artifacts folder**, one folder per project. Nothing lands in the repository, so `git status` stays clean, and the artifacts outlive a deleted checkout or worktree. |
| `workspace` | `<session's folder>/artifacts/<slug>` | In the folder the agent works in. The artifacts sit beside the code and can be committed with it. |

Which one applies, when nothing is set:

| The session's app | Default | Why |
| --- | --- | --- |
| Claude Code, Codex, Cursor, GitHub Copilot, Antigravity, Grok Build, ZCode, Devin, DeepSeek Harness | `workspace` | In their usual modes the ones that were measured ask before, or refuse, a write outside the working folder ([below](#let-your-app-write-to-the-open-artifacts-folder)); the others are kept the same until they are measured. |
| ChatGPT on the web (`open-artifacts chatgpt`) | `workspace` | The connector tells its artifacts apart by their path. |
| Pi, OMP, Hermes Agent, the `open-artifacts` command line, any app without a profile | `home` | Nothing stops the write. |
| An app that starts the daemon with `OPEN_ARTIFACTS_WORKSPACE_FOLDERS_ONLY=1` | `workspace`, always | A confined daemon keeps every folder in the workspace; no setting or call changes that. |

When an app's default puts artifacts in a Git checkout and Open Artifacts has to make the `artifacts/` folder, it also
writes `artifacts/.gitignore` (one line, `*`), so the artifacts stay out of `git status`. Delete that file to track
them. A folder that was already there, or one that you, the project or the call chose, gets no `.gitignore`: there the
artifacts are meant to be seen by git.

Artifacts you make on the home page (no session) go to `~/OpenArtifacts/artifacts/<slug>`, as before.

### The Open Artifacts folder

```text
~/OpenArtifacts/
├── artifacts/                     made on the home page
│   └── reading-list/
├── shop/                          the project ~/code/shop
│   ├── .open-artifacts-project.json
│   ├── launch-plan/
│   └── q3-review/
└── app-3f9c/                      a second project whose folder is also called "app"
```

- **A project** is the Git checkout the session works in (its top folder), whichever folder inside it the agent
  started in. Every worktree of a repository is the same project. A folder in no checkout is its own project. A folder
  with a project settings file ([below](#the-projects-file)) is a project too, which is how a package of a monorepo
  gets its own.
- A project's folder is named after the project's folder. `.open-artifacts-project.json` says which project it holds;
  when two projects have the same name, the second gets a few digits of a hash of its path (`app-3f9c`), the same ones
  every time.
- The folder itself is `homeWorkspace` in your settings (`open-artifacts config set homeWorkspace ~/Documents/Artifacts`).

"This project's artifacts" (what `Artifact {action: "list"}` shows a session, and what `quickstart` offers to reuse) are
the ones made for the project, wherever their folders are, plus any whose folder is inside the session's folder.

You see the projects too. On the home page (`open-artifacts open`) each card names the project its artifact was made
for (the full folder shows when you point at it), and when your artifacts are of more than one project a row above the
list narrows it to one: **All**, each project with how many artifacts it has, and **No project** for the ones made on
the home page or before projects were kept. Two projects of one name are told apart by the folder each is in
(`app (work)`, `app (play)`). In Open Artifacts Desktop the library says the project under each title, its filter menu
has a **Project** submenu, the search finds a project by its path, and a row in the sidebar shows the project when you
point at it.

### Choosing

| You want | Do |
| --- | --- |
| One artifact somewhere else | Tell the agent: "put it in the project" or "put it in my Open Artifacts folder". It passes `location: "workspace"` or `location: "home"`. Name an exact path and it passes `folder`. A folder inside `~/.agents/open-artifacts/` (or `$OPEN_ARTIFACTS_HOME`), which holds the settings and keys, or a folder that holds it, is refused (`invalid_argument`). |
| Everything in your Open Artifacts folder | `open-artifacts config set artifactsLocation home`, and [let your app write there](#let-your-app-write-to-the-open-artifacts-folder). |
| Everything in the workspace, visible to git | `open-artifacts config set artifactsLocation workspace` |
| One project differently, for you only | In the project: `open-artifacts config set artifactsLocation home --local` |
| One project the same way for everyone | In the project: `open-artifacts config set artifactsLocation workspace --project`, then commit `.agents/open-artifacts/settings.json` |
| Back to the default | `open-artifacts config unset artifactsLocation` (with `--local` or `--project` for those) |

Nothing that exists moves: a setting decides where the **next** artifact goes, and every artifact made before stays
where it is and stays in its project's list.

## Let your app write to the Open Artifacts folder

An agent writes an artifact's files with its own file tools. Most agent apps limit those to the working folder, which
is why their default is `workspace`. To use `home` with such an app, add the Open Artifacts folder to the folders it may
write:

| App | Setting | Measured |
| --- | --- | --- |
| Claude Code | `claude --add-dir ~/OpenArtifacts`, or `"permissions": {"additionalDirectories": ["/Users/you/OpenArtifacts"]}` in its settings | 2.1.318: with it, `acceptEdits` writes there without asking. `auto` needs nothing. |
| Codex | `codex --add-dir ~/OpenArtifacts`, or `sandbox_workspace_write.writable_roots = ["/Users/you/OpenArtifacts"]` in `config.toml` | 0.171.0-alpha: without it, `workspace-write` refuses the write. |
| GitHub Copilot CLI | `copilot --add-dir ~/OpenArtifacts` | 1.0.114: without it, the write waits for your approval. |
| Cursor CLI | None found: `--add-dir` does not lift it. `--force` allows every write. | 2026.11.13 |
| Pi | Nothing to set. | 1.6.1 |

These were measured on macOS, in each app's headless mode. Not measured: Antigravity, Grok Build, ZCode, Devin, DeepSeek Harness, OMP, the
apps' interactive prompts, the Cursor editor, the Claude desktop app, Windows and Linux. Open Artifacts never changes
another app's permission settings for you.

When an artifact's folder is outside the agent's working folder, the create result says so. An agent that cannot
write there can still fill the artifact: `Artifact {action: "publish", url, files: {...}}` has the daemon write the
files.

## The settings files

### Your file

`~/.agents/open-artifacts/settings.json` (`$OPEN_ARTIFACTS_HOME/settings.json` when that is set) holds your settings for
every app and project on this computer. Only what you changed is in it. The keys about where artifacts go:

| Key | Default | Means |
| --- | --- | --- |
| `artifactsLocation` | unset | `home` or `workspace`. Unset: the app's default, as in the table above. |
| `artifactsDir` | `artifacts` | The folder's name under a workspace, and for home-page artifacts under the Open Artifacts folder. |
| `homeWorkspace` | `~/OpenArtifacts` | Your Open Artifacts folder. `OPEN_ARTIFACTS_HOME_WORKSPACE` sets it when the file does not; a development or test run of Desktop sets it to `<home>-workspace`. Unset, with no `~/OpenArtifacts` but a `~/OpenArtifact` (its name before 0.23): that one. |
| `projects` | unset | Your own settings for single projects, by the project's folder: `{"~/code/shop": {"artifactsLocation": "home"}}`. Written by `config set --local`. An `artifactsDir` here is relative to the project's folder. |

Its other keys (types, trusted projects, sites, the port, the runtime) have commands of their own: see
[Making your own artifact types](custom-types.md), [Connecting your computers and agents](connecting-agents.md) and
[Runtime and updates](integrating/runtime.md); `share` (the share service and whether sharing to the web is on) is in
[Sharing an artifact to the web](https://github.com/openartifactsai/open-artifacts/blob/main/docs/sharing.md#settings). An install preset (`preset.json`) is a different thing: it gives a
computer its site at install time and sets nothing on this page.

### The project's file

`<project>/.agents/open-artifacts/settings.json`, beside the project's types (`.agents/artifact-types/`). Commit it, and
everyone who works in the repository gets the same answer. It may set two keys:

| Key | Means |
| --- | --- |
| `artifactsLocation` | `home` or `workspace`, for sessions in this project. |
| `artifactsDir` | Where the project keeps its artifacts: a path relative to the folder the file is in, and inside it (`docs/artifacts`). |

```json
{ "artifactsLocation": "workspace", "artifactsDir": "docs/artifacts" }
```

Every other key in that file is ignored. A repository is something anyone may have written: it does not get to trust
itself, move your Open Artifacts folder, add a site or turn publishing on. `open-artifacts config list` names the keys it
ignored.

A repository set up before 0.23 has the file at `.agents/open-artifact/settings.json`: it is read when there is no
`.agents/open-artifacts/settings.json` beside it, and `config set --project` writes to it, so nothing in your repository
is moved (see [Names from before 0.23](#names-from-before-023)).

Open Artifacts looks for the file from the session's folder upward to the top of the Git checkout, and uses the nearest
one. It does not look above the checkout, nor in a folder with no checkout around it other than the session's own, and
it never takes your own settings file for a project's. (A project's **types** are still looked for in the session's
folder only: see [custom types](custom-types.md).)

### Which wins

Highest first:

1. The call: `folder` (an exact path), then `location`.
2. A confined daemon (`OPEN_ARTIFACTS_WORKSPACE_FOLDERS_ONLY=1`): the workspace.
3. Your entry for the project (`projects`, `config set --local`).
4. The project's file.
5. Your `artifactsLocation`.
6. The app's default (its harness profile's `policy.artifacts`).
7. `home`.

## `open-artifacts config`

```bash
open-artifacts config                          # what is in effect here, as JSON: each value and who set it
open-artifacts config get artifactsLocation    # one value
open-artifacts config set artifactsLocation home             # in your settings.json
open-artifacts config set artifactsLocation home --local     # yours, for this project only
open-artifacts config set artifactsDir docs/artifacts --project   # in this project's settings file
open-artifacts config unset artifactsLocation [--local | --project]
```

- **Keys:** `artifactsLocation`, `artifactsDir`, `homeWorkspace`, `serverPort`, `share.endpoint`, `share.enabled`.
  `--project` and `--local` take the first two. The `share.*` keys are about
  [sharing an artifact to the web](https://github.com/openartifactsai/open-artifacts/blob/main/docs/sharing.md#settings).
- **Which project:** the one the current folder is in; `--workspace <dir>` names another. `--harness <name>` makes
  `list` and `get` answer for that app's sessions (`--harness claude-code`).
- `list` gives each value a `source`: `local` (you, for this project), `project` (its file), `user` (you),
  `environment`, `harness` (the app's default) or `default`. `project.ignored` lists the keys of the project's file
  that are not used.
- `set` and `unset` go through the daemon, so it uses the change at once. After editing a file by hand, restart it:
  `open-artifacts daemon restart`.
- **Only you change settings.** Inside an agent's session `config set` and `config unset` are refused, as trusting a
  project or publishing is; `list` and `get` work anywhere. `--project` removes the file when nothing is left in it.

## Names from before 0.23

Before 0.23, Open Artifacts was called Open Artifact, and its folders and variables had that name. They still work, so
an install, an older app or plugin and your own files carry on as they were. New things get the new names only.

| Before 0.23 | Now | What happens |
| --- | --- | --- |
| The home `~/.agents/open-artifact` | `~/.agents/open-artifacts` | The first program of 0.23 or later that starts (the daemon, the command line, Desktop, an app's adapter) moves it to the new place and leaves a link at the old one (a junction on Windows), so an older version still finds your library. When the move fails (on Windows, while a program of the old version keeps a file in it open), the old folder is used and the next start tries again. When both folders are there, the old one is used and nothing is moved: `open-artifacts doctor` warns and says how to keep one. A home named with `OPEN_ARTIFACTS_HOME` or `--home` is used as it is, unless it names one of these two places. |
| Your Open Artifacts folder `~/OpenArtifact` | `~/OpenArtifacts` | Used while your settings name no `homeWorkspace`, `~/OpenArtifacts` is not there and `~/OpenArtifact` is. Nothing is moved. |
| A project's `.agents/open-artifact/settings.json` | `.agents/open-artifacts/settings.json` | Read when the new file is not there; `config set --project` writes to it. Rename the folder yourself once everyone who works in the repository has 0.23 or later. |
| `.open-artifact-project.json` in a project's folder under the Open Artifacts folder | `.open-artifacts-project.json` | Still says which project the folder holds. A new folder gets the new name. |
| Variables `OPEN_ARTIFACT_*` (`OPEN_ARTIFACT_HOME`, `OPEN_ARTIFACT_PORT`, …) | `OPEN_ARTIFACTS_*` | Each counts under the new name when that one is not set. The programs Open Artifacts starts (the daemon, type servers, the runtime's command line) get both names. |
| The machine policy file `/Library/Application Support/Open Artifact/policy.json`, `/etc/open-artifact/policy.json`, `%ProgramData%\Open Artifact\policy.json` | `Open Artifacts`, `open-artifacts` | Read when the new file is not there ([Runtime and updates](integrating/runtime.md)). |
| A self-hosted site's data `~/.open-artifact-host` | `~/.open-artifacts-host` | Used while `OA_DATA_DIR` is not set and only the old folder is there ([Self-hosting](hosting.md)). |
| The Motion voice-over package in `~/.cache/open-artifact/tts` | `~/.cache/open-artifacts/tts` | Used where it is; a new install goes into the new folder. |

## Models, permissions and connectors

A page can ask a model to write (`use("sample")`), and so can a built-in editor (Sheets). You choose which **model
source** answers: one of your own API keys (OpenAI-, Anthropic- or Gemini-compatible endpoints, a proxy, or a model on
your network), or an **agent app** on this computer that can answer for pages (see
[plugins](https://github.com/openartifactsai/open-artifacts/blob/main/plugins/README.md)). A page can also call tools of your connectors (`use("mcp")`). Nothing here is ever
in an artifact's folder, so an export or a copy carries none of it.

| File (in `~/.agents/open-artifacts/`, or `$OPEN_ARTIFACTS_HOME`) | Holds | Changed in |
| --- | --- | --- |
| `models.json` (`$OPEN_ARTIFACTS_MODELS` names another path) | Your key sources (with each one's effort), the default one, the limits, and the model and effort you chose for each agent app's command line (`harness`). Written with mode `0600`; a key may be written `${ENV_VAR}` to read it from the environment. No route ever answers a key: lists show its last four characters. | The home page's **Settings → Models**; the consent dialog's **Add a model source…** |
| `grants.json` | What you allowed: one artifact, every artifact of a type, or every artifact (**Always allow**); a page refused with **Not this page**; and each artifact's connector permissions. A deleted artifact's entries go with it. | The dialog a page's first call opens; the page's **AI models** panel; **Settings → Models → Permissions** |
| `usage/models.jsonl` | One line per model call: when, which artifact, source, model, tokens (exact, estimated or not reported), duration, result. Never the prompt or the answer, and never a key. A call you refused is kept too, as "not allowed", and counts toward no total; refusals of one artifact with the same code in the same minute are one line with a count (×N in the panel). Lines older than 400 days are folded into one total per artifact, and past 50,000 lines the oldest days are folded into one total per day, so the file stays small and the totals stay right. | Nothing: a record |
| `connectors.json` (`$OPEN_ARTIFACTS_CONNECTORS` names another path) | Your connectors: the MCP servers pages and Data dashboards may call. | By hand ([Data](types/data.md)) |
| `connector-usage.json` | Each artifact's calls per connector and tool: counts, failures, the last call. Never arguments or results. | Nothing: a record |

The limits in `models.json`, both in **Settings → Models → Limits**:

| Key | Default | Means |
| --- | --- | --- |
| `limits.perArtifactPerHour` | `60` | Calls that reach a model, per artifact, per hour; `0` for no hourly limit. One more is refused `rate_limited`. |
| `limits.maxOutputTokens` | `16000` | The output cap of each answer. |

Choosing a source's model and effort, in **Settings → Models**:

- A key source: its **Default**, **Quick** and **Complex** models (once **Fetch models** has listed them, a searchable
  list; else typed), and its **Effort** (`low`, `medium` or `high`, kept as the source's `effort`).
- An agent app: **Change** beside it opens the same pickers for its command line, filled from the models the app
  itself lists (Cursor, GitHub Copilot, Codex; read once, kept a day, **Refresh the list** reads it again) or the names
  it suggests (Claude Code), and its **Effort** of the levels it takes (up to `xhigh` and `max`). A model the list does
  not have yet can be typed. Each field left at **The app’s default** passes nothing, so the app's own default answers.
  Kept as `harness.<app>`: `{"models": {"default": "claude-sonnet-5.5"}, "effort": "xhigh"}`; **Use the app’s
  defaults** forgets it. It applies while the app answers by its command line; an app that answers through its adapter
  or MCP connection uses the model of its own session, and the editor says so.
- Your effort answers when a page names none; a page's own `effort` wins. A level the source does not take is not
  passed. The page's **AI models** panel shows the app's current choice.
- The consent dialog offers the same choice for the source it has selected: its **Default model** (searchable) and its
  **Effort**, under the list of sources. A change is kept on that source when you allow the page (so the source's
  other pages use it too); **Don’t allow** keeps nothing. An app answering through its adapter or MCP connection has
  nothing to choose there.

Allowing and taking back:

- A page's first call opens a dialog in the Open Artifacts window: pick a source, then **Allow this page**, **Allow all
  <type> artifacts** or **Always allow, don’t ask again**. **Don’t allow** refuses it. A page allowed by its type or by
  **Always allow** runs without a dialog, and the window says so under its bar, with **Manage** and **Not this page**.
- The window's **AI** mark opens the page's **AI models** panel (**AI models and connectors** once the page has
  connectors): the source, today's, this month's and all calls and tokens, the calls this hour against the limit, the
  recent calls, **Change source** (for this page only), **Model and effort** of the source in use (its default model,
  searchable, and its effort: each change is kept on the source at once, so its other pages use it from their next
  call), **Stop allowing this page** (or its type, or **Always allow**), and, for connectors, **Stop allowing** each
  one.
- A connector is allowed per artifact only, never per type or for every artifact. A tool the connector marks
  read-only then runs; any other call asks you each time with its arguments (**Allow once**, **Always allow this
  tool**, **Allow all declared tools**).
- A source an agent app answers by its command line run read-only (Codex, Cursor: the program can still read files
  while it writes) can be allowed for one artifact at a time only, and is never picked first while another source can
  answer. One answered by MCP sampling is allowed for the client that answered; another client answering for the same
  app asks you again.
- Editing a key source keeps its saved key only while its kind and its endpoint's origin stay the same; changing
  either asks for the key again. A source never follows a redirect (the message asks for the final address), and a
  key the endpoint refuses is said in fixed words: no message carries the key or a piece of it.
- An agent cannot allow anything for you: the routes that change sources, limits and permissions refuse a request
  from inside an agent's session, and an agent does not edit these files for you.

`open-artifacts doctor --harness <name>` has a `harness-generate` check (**Model source**): whether that app can answer
pages' model calls now, and by which way (its adapter, its MCP client, or its command line). It never runs a model.

**On a site** (a self-hosted Open Artifacts), a page's model calls use your own key too, but it is kept in your browser,
for your account on that site, and your browser calls the endpoint directly: it never reaches the site's server (the
endpoint must allow calls from the site, CORS). **This tab only, don’t save** keeps it in the tab's memory instead.
Your permissions and usage are kept in the browser too, and signing out forgets that account's keys first. Allowing
a page for its type or every artifact is offered only on artifacts you own on that site. The site's
operator can turn this off or limit the endpoints ([hosting](hosting.md)). Connectors are not available to pages on a site.

## Check it: `open-artifacts doctor`

```bash
open-artifacts doctor --harness claude-code      # in the project; --workspace <dir> names another folder
```

Among its checks, four are about this page:

| Check | Says |
| --- | --- |
| `home-workspace` | Your Open Artifacts folder, and whether it can be written (not made yet is fine). Fails when it cannot. |
| `artifacts-location` | Where a session of that app in this folder keeps new artifacts, and who chose it. When that is your Open Artifacts folder and the app keeps its agent to the working folder (Claude Code, Codex, Copilot CLI, Cursor), a warning with the setting to add. For Claude Code and Codex doctor reads the app's own settings (`~/.claude/settings.json` and the project's `.claude/settings*.json`; `~/.codex/config.toml`) and says ok when they already allow the folder; it cannot see a `--add-dir` given on the command line. |
| `project-settings` | The project's settings file and what it sets; a warning naming the keys that are not used, or a file that is not a JSON object; and your own entry for the project. |
| `settings-projects` | A warning for entries of `projects` in your settings whose folder is gone, or that are not named by an absolute path. |

Its `home` check says when the home from before 0.23 was moved, and warns when it is still in use (both folders are
there, or it could not be moved), with what to do.

doctor only reads: it changes neither your settings nor another app's.

## For agents

- Do not make up a folder. Leave `folder` out: the daemon chooses it and names it from the title.
- The person asks for the project ("in the repo", "commit it with the code"): `location: "workspace"`. For their Open
  Artifact folder: `location: "home"`. For an exact path: `folder`. A workspace-confined app refuses `location: "home"`
  (`not_granted`).
- The create result's `root` is where the files go. When it is outside your working folder the result's `notes` say
  so: tell the person where the folder is, and if your app does not let you write there, send the files with
  `Artifact {action: "publish", url, files}`.
- Never run `open-artifacts config set` yourself, and do not edit either settings file to change where artifacts go.
  Tell the person the command.
- Never edit `models.json`, `grants.json` or `connectors.json`, and never allow a page's model or connector use for
  the person. A page you write that uses a model or a connector must work when the answer is `not_granted`: tell the
  person where to allow it (the dialog, or the page's **AI models** panel).
