# builder.planWorkspace

- **Module:** builder
- **Package:** @libtmux/libtmux
- **Language:** TypeScript
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ts/blob/2cb93308200da38a26b59876618116850f110607/packages/workspace/src/builder.ts#L199
- **Page:** https://libtmux.org/reference/ts/builder-planworkspace/

```
builder.planWorkspace(server: : Server, workspaceInput: : WorkspaceInput, options: : PlanWorkspaceOptions = {}) -> Promise<WorkspacePlan>
```

Plan session, window, and pane membership without changing tmux.

Reads the server once and answers from that capture, so it costs one snapshot
and changes nothing. It reports structural creation, removal, retention, and
window renames. It does not predict options, layouts, focus, or pane command
effects.

## Raises

- `ZodError` — when the workspace does not satisfy the strict config schema.
- `TypeError` — when planning options are invalid.

## Example

```ts
const plan = await planWorkspace(server, workspace);
if (plan.removesWindows.length > 0) console.log("would remove", plan.removesWindows);
```
