Create or attach an organization
Status: ShippedAn organization is a context repository containing team definitions and shared context. A team is a named group inside that repository. No provider account is needed for local setup.
Create a local organization
Choose Create local organization in Welcome or Workspaces. Enter its display name, choose an existing parent folder, and review the exact new child path before selecting Create organization. You can edit that destination path. Every existing destination is refused, including empty folders; choose a new folder or use Attach.
CodeSense initializes local Git on unborn main, writes the canonical registry and starter files, and registers the folder under your selected local profile. The stable identity is local/<sanitized-name> and is independent of the folder’s basename. Duplicate identities are refused without changing existing data.
The new organization starts with no teams or people. After creation, the existing team-creation view opens. Create your first team, then attach source repositories. Restarting CodeSense discovers the same registered organization.
If creation succeeds but registration fails, the error names the preserved repository. Use Attach context repository with that folder to retry.
Attach an existing context
For an existing team, have your agent or Git CLI clone its context repository, then choose Attach context repository and select the checkout root. CodeSense validates its registry and records its location; it does not move the files. Detach removes the registration and keeps every repository file, including repositories created through CodeSense.
Your agent and Git tools own commits, remotes, credentials, fetch, push and sharing. Creating an organization does not stage files, make a commit, configure an author or create a remote repository.
Set up through local MCP
Local agents use the same services as the desktop:
| Operation | Tool and arguments |
|---|---|
| Create organization | create_local_organization({displayName, destinationPath}) |
| Attach / list / detach context | attach_context_repository({clonePath}), list_context_attachments({}), detach_context_repository({orgSlug}) |
| Create team | commit_registry_edit_local({orgSlug, edit: {type: "CreateTeam", team_name: "engineering"}}) |
| Manage registry | The same registry tool supports rename, archive, delete, team parents and source repository entries using existing RegistryEdit variants. |
| Register source identity | commit_registry_edit_local({orgSlug, edit: {type: "AddSourceRepoToTeam", team_name, owner, repo}}) |
| Attach source checkout | save_source_repo_attachment({repoPath}) reads the existing checkout’s origin locally. |
| Discover and activate | describe_setup(), list_orgs_teams(), set_active_team({org, team}) |
Creation, registry edits and checkout attachment require no active team. These local mutation tools use the selected local profile and reject remote callers; callers cannot select another principal. Registry edits notify the UI, and team activation uses the normal watcher and workspace activation path.
Profiles and local state
Settings → Account selects the local profile. Switching first saves pending notes and workspace selection, then reloads the app with the selected profile’s attachments and tabs. If saving fails, resolve the error and retry; CodeSense stays in the current profile. Global agent and appearance settings remain available.
How we know this is accurate 3 sources
Checked against the app at 1b3d5a69d73473db077dfb44f4390b42cded6bd4.
Code
-
src/features/org/components/org-picker.tsx -
src-tauri/src/commands/local_organization.rs -
src-tauri/src/mcp/handler.rs