Where Is Workspace Data Stored by Default in Maka?
Maka stores workspace data in a platform-specific client-data directory appended with workspaces/default, specifically ~/Library/Application Support/Maka/workspaces/default on macOS, %APPDATA%/Maka/workspaces/default on Windows, and ~/.config/Maka/workspaces/default on Linux.
The Apache Maka repository manages project data through a hierarchical storage system that separates client-level configuration from workspace-specific content. Understanding where workspace data is stored by default in Maka is essential for backup strategies, migration scripts, and debugging file-system issues across different operating systems.
Default Workspace Storage Locations by Operating System
Maka determines the base directory using platform detection logic, then appends workspaces/<workspace-name> to the path. The default workspace name is default.
macOS
On macOS (darwin), Maka stores workspace data in the Application Support directory:
~/Library/Application Support/Maka/workspaces/default
The base client-data root is ~/Library/Application Support/Maka, as resolved by resolveElectronUserDataRoot() in packages/storage/src/workspace-root.ts (lines 82-88).
Windows
On Windows (win32), the storage location utilizes the Roaming AppData folder:
%APPDATA%/Maka/workspaces/default
This typically resolves to C:\Users\<user>\AppData\Roaming\Maka\workspaces\default.
Linux and Other Platforms
On Linux, Maka respects the XDG Base Directory Specification. The path uses $XDG_CONFIG_HOME/Maka when the environment variable is set, falling back to ~/.config/Maka if unset:
$XDG_CONFIG_HOME/Maka/workspaces/default
Or: ~/.config/Maka/workspaces/default
Workspace Path Resolution Logic
The resolution logic lives in @maka/storage within packages/storage/src/workspace-root.ts. The primary entry point is resolveMakaWorkspaceRoot(), which delegates through resolveMakaDataRoots() to deriveMakaDataRoots() for path construction.
The core implementation concatenates the client data root with the workspace sub-directory:
// packages/storage/src/workspace-root.ts
export function deriveMakaDataRoots(clientDataRoot, input = {}): MakaDataRoots {
const platform = input.platform ?? process.platform;
const workspaceName = input.workspaceName ?? 'default';
const pathApi = platform === 'win32' ? win32 : posix;
return {
clientDataRoot,
workspaceRoot: pathApi.join(clientDataRoot, 'workspaces', workspaceName),
};
}
This function (lines 59-65) uses the platform-specific path API (win32 for Windows, posix for Unix-like systems) to ensure correct path separators.
Programmatic Access to Workspace Paths
You can retrieve the current workspace root using the storage package in your applications:
import { resolveMakaWorkspaceRoot } from '@maka/storage';
// Returns the default workspace path
const defaultWorkspace = resolveMakaWorkspaceRoot();
console.log(defaultWorkspace);
// → "/Users/alice/Library/Application Support/Maka/workspaces/default" on macOS
To target a specific workspace by name:
const customWorkspace = resolveMakaWorkspaceRoot({ workspaceName: 'my-project' });
console.log(customWorkspace);
// → ".../Maka/workspaces/my-project"
CLI Verification
The Maka CLI re-exports these storage helpers from packages/cli/src/workspace-root.ts (lines 20-27), exposing the same resolution logic to command-line users. You can verify the exact path for your system using:
$ makita workspace-root
/home/alice/.config/Maka/workspaces/default
Summary
- Default location: Maka stores workspace data under
workspaces/defaultwithin a platform-specific client-data directory. - Platform paths: macOS uses
~/Library/Application Support/Maka, Windows uses%APPDATA%/Maka, and Linux uses$XDG_CONFIG_HOME/Maka(falling back to~/.config/Maka). - Core logic: Path resolution is implemented in
packages/storage/src/workspace-root.tsviaresolveMakaWorkspaceRoot()andderiveMakaDataRoots(). - Accessibility: Both the TypeScript API (
@maka/storage) and the CLI (makita workspace-root) expose methods to retrieve the current workspace path.
Frequently Asked Questions
What is the default workspace name in Maka?
The default workspace name is default. According to the source code in packages/storage/src/workspace-root.ts, the deriveMakaDataRoots function defaults to 'default' when the workspaceName property is omitted from the input configuration (line 62).
How does Maka determine the base directory on Linux?
Maka follows the XDG Base Directory Specification on Linux. It checks for the $XDG_CONFIG_HOME environment variable first; if unset, it falls back to ~/.config. The base path becomes $XDG_CONFIG_HOME/Maka (or ~/.config/Maka), with the workspace subdirectory appended as workspaces/default.
Can I change the workspace name programmatically?
Yes. While you cannot change the base client-data directory without modifying environment variables, you can specify different workspace names by passing a configuration object to resolveMakaWorkspaceRoot(). For example, resolveMakaWorkspaceRoot({ workspaceName: 'production' }) returns the path ending in workspaces/production instead of workspaces/default.
Where can I find the test cases for workspace path resolution?
The test suite confirming these default paths across platforms is located at packages/storage/src/__tests__/workspace-root.test.ts. These tests verify the behavior of deriveMakaDataRoots and resolveMakaClientDataRoot across macOS, Windows, and Linux environments.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →