> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mesa.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# fs.change

> Manage active changes inside a mounted Mesa filesystem.

Mounted filesystems expose change controls under `fs.change`.

## fs.change.new()

Create and switch to a new change from a bookmark or existing change.

```ts theme={null}
const result = await fs.change.new({ repo: 'app', bookmark: 'main', message: 'Try new copy' });
console.log(result.changeOid);
```

**repo** `string` *required*

Repository name.

**bookmark** `string | undefined`

Bookmark to fork from. Mutually exclusive with `changeId`.

**changeId** `string | undefined`

Change ID to fork from. Mutually exclusive with `bookmark`.

**message** `string | undefined`

Description for the new change. Omit to create the change with no description; pass `""` explicitly for an empty description.

## fs.change.edit()

Switch to an existing editable change. This never creates a new change.

```ts theme={null}
await fs.change.edit({ repo: 'app', changeId: 'zyxwvutsrqponmlkzyxwvutsrqponmlk' });
```

**repo** `string` *required*

Repository name.

**bookmark** `string | undefined`

Bookmark whose existing change should be edited. Mutually exclusive with `changeId`.

**changeId** `string | undefined`

Existing change ID to edit. Mutually exclusive with `bookmark`.

## fs.change.list()

List changes reachable from the current checkout's commit.

```ts theme={null}
const changes = await fs.change.list({ repo: 'app', limit: 10 });
```

**repo** `string` *required*

Repository name.

**limit** `number | undefined`

Maximum number of changes to return. Defaults to `50`. Pass `0` for no limit.

## fs.change.current()

Return the currently active change for a repo.

```ts theme={null}
const current = await fs.change.current({ repo: 'app' });
console.log(current.changeId, current.commitOid);
```

**repo** `string` *required*

Repository name.

## Response types

**ChangeResult.changeOid** `string`

Hex-encoded change OID of the now-active change.

**ChangeInfo.changeId** `string`

Hex-encoded change ID.

**ChangeInfo.commitOid** `string`

Hex-encoded commit OID the change currently points to.

## Errors

Change operations reject with `MesaTransientError`, `MesaBadInputError`, or `MesaFatalError`, all extending `MesaFileSystemError`. `fs.change.checkpoint()` rejects with `MesaBadInputError` when the current checkout is not on a bookmark and with `MesaTransientError` when another client moved the bookmark mid-checkpoint. Use `instanceof` to handle the category. See [Error model](https://docs.mesa.dev/content/reference/ts.md#error-model).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.