← Back to the Wiki

Daily use

CLI
>=0.32.0
Skill
>=1.4.2
Executors
claude-code, codex, gemini-antigravity
System
macos
Reviewed on
2026-11-23

Several organizations and workspaces

A CLI workspace is a folder where malha keeps everything that belongs to one organization: a .malha folder with the context, the caches, the session, and the local record of authorized actions. Each workspace's credentials live in the macOS Keychain, apart from the other workspaces' credentials. Each workspace belongs to one organization and one installation.

The default workspace is your home folder. While you use a single organization, you don't need to think about this.

Use another organization

Create a folder for the other organization and run the setup in it:

mkdir -p ~/malha-<org>
malha --workspace ~/malha-<org> setup

The setup opens the sign-in in the browser, you choose the organization, and it creates the installation in that workspace. The default workspace doesn't change.

Choose the workspace of each command

There are two ways, and without either of them the CLI uses the default workspace:

  • --workspace <folder> before the command, as in malha --workspace ~/malha-<org> doctor.
  • MALHA_WORKSPACE in the terminal session. It applies to every command in that session, including the ones the LLM runs, if you open the executor in that terminal:
export MALHA_WORKSPACE=~/malha-<org>

To see how the LLM chooses the workspace, see "With the LLM" below.

Check where you are

To see the workspace, the organization, and the installation of the current command:

malha workspace current --online

Without --online, the answer comes from local files only. With --online, the CLI confirms the account, the organization name, and the session with MalhaOS. For another workspace:

malha --workspace ~/malha-<org> workspace current --online

To see every workspace configured on this computer:

malha workspace list

The list only shows workspaces where malha setup finished. It keeps paths and identifiers, never credentials.

With the LLM

With skill 1.16.1 or later and more than one workspace on the computer, the LLM chooses the workspace before any malha command, in this order:

  1. the one you name in the conversation, by folder or by organization;
  2. MALHA_WORKSPACE, if it is set in the executor's environment;
  3. the only configured workspace.

If none of these settles it, it asks once, listing each folder with its organization. It never chooses by the repository name or by the board.

After choosing, the LLM:

  • says in one line the folder, the organization, and how it chose, and answers when you ask which workspace it is in;
  • uses --workspace on every malha command in that conversation;
  • keeps the folder out of board comments, because it shows your home folder;
  • stops and asks when the issue's board may belong to another organization, and takes no action on the issue until you answer. With skill 1.23.1, this also applies when the issue falls to the default workflow (malhaos_default), when the CLI refuses the default workflow's packet, and when the CLI refuses with provider_board_in_other_workspace. Before asking, it names the current organization and shows the workspace the CLI points to as a hint. It never runs the request again in the other workspace on its own. See case P25 in Troubleshooting.

If you confirm the current workspace, the LLM doesn't ask again for other issues of the same board in that conversation. The refusal provider_board_in_other_workspace always makes the LLM ask again.

With a single workspace, none of this shows up.

To avoid naming the workspace in every conversation, pin it to the project. Open the executor in a terminal with MALHA_WORKSPACE set, or, in Claude Code, put the variable in the env of the project's .claude/settings.json file, with the full path, because ~ is not expanded there:

{
  "env": {
    "MALHA_WORKSPACE": "/Users/<user>/malha-<org>"
  }
}

What the CLI shows

From CLI 0.43.3 on, with more than one workspace on the computer:

  • The organization of each answer. Every answer from malha workflow resolve and from the malha workflow action-grant commands carries active_workspace, with the organization the command ran in and whether the workspace is the default one. The folder doesn't appear.
  • Known boards. The local workspace registry now keeps the boards each workspace has resolved through its organization's connection. It keeps no secret or credential.
  • The refusal provider_board_in_other_workspace. When the current organization doesn't recognize the request's board and another workspace on this computer has already seen it, resolve and the grants refuse the request. The detail carries the active organization and, in candidates, the likely organization, how it was recognized (board_id, board_key, or provider_workspace), and the command with its --workspace. It is a hint: the CLI never switches workspaces on its own. On a grant, from CLI 0.45.2 on, this also applies when MalhaOS refuses with provider_mismatch.
  • The other_workspaces check of malha doctor. It lists the workspaces on this computer with the organization and known boards of each, and marks the current one. The session of the other workspaces isn't checked. With a single workspace, the check doesn't appear.

If a request lands in the wrong organization, see case P25 in Troubleshooting.

What doesn't work

  • Redoing the setup in the same workspace to switch organizations. In a workspace that is already configured, malha setup answers already_bootstrapped and changes nothing.
  • Linking another organization to the same workspace. malha context init with another organization is refused with human_scope_mismatch. See case P9 in Troubleshooting. If a command ends with installation_token_invalid, MalhaOS refused this workspace's installation credential: see case P21. If it ends with context_mismatch, the workspace session changed during the command: see case P22.

Status

  • Available: separate workspaces with --workspace and MALHA_WORKSPACE, and the malha workspace current and malha workspace list commands. With skill 1.16.1, the LLM chooses the workspace, says where it is acting, and asks before acting on a board that may belong to another organization.
  • Available: with CLI 0.43.3, active_workspace in every answer, the refusal provider_board_in_other_workspace, the boards in the registry, and the other_workspaces check. With skill 1.23.1, the LLM also stops and asks when the issue falls to the default workflow, and shows the CLI's hint.
  • Limitation: the setup of each workspace asks for the browser sign-in again. In Codex and Gemini, pin the workspace through the terminal where you open the executor.

View as Markdown