Skip to content

Choose the folder a crew works in - #19

Merged
httpsphl merged 7 commits into
mainfrom
feat/crew-folder
Sep 29, 2026
Merged

httpsphl merged 7 commits into
mainfrom
feat/crew-folder

Conversation

@httpsphl

Copy link
Copy Markdown
Owner

The owner chooses the folder a crew works in, such as a project folder they already use. Stacked on #18.

What changes

  • Every bot gets the crew's work folder with --add-dir, plus CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 so that folder's CLAUDE.md loads with the bot's memory. By default it is the crew's shared folder, as before. This also fixes an old snag: shared sat outside each bot's workspace, so Claude Code asked before every edit there, even in Accept edits.
  • Choose it when creating a crew, with Windows' folder picker ("Choose folder…"), or leave "A new folder inside Botloft". The crew page shows "Works in …" (a click opens it in Explorer), and the crew menu has "Open work folder" and "Change work folder…", which confirms before moving: each bot restarts there once nothing is in progress.
  • Safe by construction. Each bot's own workspace (memory, rules, attachments) stays where it is, and the daemon never writes into a chosen folder. It refuses a whole drive, Botloft's own data folder (or one containing it) and a folder containing every bot's workspace, and creates a missing folder. Archiving a crew deletes nothing.
  • The folder picker is the official tauri-plugin-dialog (dialog:allow-open) behind a new Host.pickFolder.
  • Storage: migration 0006 (crews.work_dir); protocol: crews.create {workFolder?}, crews.setWorkFolder, Crew.workFolder, Crew.workFolderChosen.

Spec: 2, 5, 5.1, 7.4, 11.2, 12, 13, 15.1, 15.2 and a section 19 row.

Tested

  • cargo fmt, clippy -D warnings, cargo test (folder rules, including case and \\?\ prefixes; new crew_folders tests: the default folder and flag, a chosen folder, moving a crew restarts its bots, refused folders) and pnpm check (choosing, clearing, opening and moving a folder; cancelling the picker).
  • With Claude Code 2.1.284 (--setting-sources project,local, Accept edits): with --add-dir and the variable, the bot quoted the folder's CLAUDE.md without opening a file and wrote there without asking; without the flag, the same write was denied.

To check in the installed app

  • "Choose folder…" opens Windows' folder picker, and the chosen folder shows on the crew page.

A bot's avatar is now just the mascot in its color, with a thin edge
(dark on the light theme, light on the dark one) so light colors such as
the palette's beige keep their shape. Botloft's own white mascot, in the
title bar and on the daemon's messages, keeps the black square of the
app icon: without it, it would vanish on the light theme.
The whole window is now drawn at 125% (the webview's zoom), so text,
spacing, icons and avatars grow together; at 100% the app looked tiny on
a monitor without Windows scaling. A Size menu in the title bar picks
100%, 110%, 125% or 150%, Ctrl+= and Ctrl+- step through them and Ctrl+0
goes back to the default. The choice is remembered and applied before
the first paint, so the window never flashes small.
Like the account corner of a chat app: the owner's name (the Windows
account's display name), their Claude plan and a menu with Usage,
Settings, Language, What's new and Help. Usage shows each window of the
plan the bots have used and when it resets; Settings holds the theme,
size and language, and the versions. Theme, size and language leave the
title bar, which keeps only the language on the setup screens that have
no sidebar. The sidebar now shows from the welcome screen on.

The daemon reads the owner's display name once (GetUserNameExW) and the
email, plan and organization from `claude auth status`, and sends them
in `system.status.account`.
Buttons, fields and menu rows get 8 px corners, cards and menus 12 px,
the chat's bubbles, cards and dialogs 16 px. Menus and dialogs float on
a light themed shadow. The chat is a centered column with the day as a
pill, and the open conversation in the sidebar is an inset rounded
block instead of a full-width bar. Menus share one popover look and one
hook that closes them.
Like Claude Code's mode picker, below the chat: Auto, Manual, Accept
edits and Plan, each described by what the bot does ("Scout decides
what needs your OK"), and Bypass permissions behind a confirmation that
says the bot is then not held to its folder. A bot that asks nothing is
marked in red in the picker and its header.

The daemon stores the mode (migration 0004) and starts the bot with it.
Claude Code reads --permission-mode only at start, so a new mode
restarts the process with --resume once nothing is in progress, and
never cuts a turn short. When an approved plan moves the bot out of plan
mode, the system/init of the next turn says so and the stored mode
follows.

A bot in plan mode asks to go ahead with ExitPlanMode: the chat shows
the whole plan (kept up to 32 KB) with Approve plan and Keep planning,
which sends back what should change.

Spec: 7.4, 10.1, 11.2, 12, 13 (what bypassing means on Windows), 15.1,
15.3 and two rows in section 19 to check with the real Claude Code.
Bots ran on whatever the account's default is. The owner now picks
Fable, Opus, Sonnet, Haiku or the plan's default per bot, in the chat
and when creating or editing a bot. Claude Code only reads --model at
start, so a new model restarts the bot with --resume once nothing is in
progress, like a new permission mode (the relaunch code now serves both).

system/init names the model in use; the daemon keeps it so the app can
say which model the plan's default is. A model the account cannot use
fails the turn with model_not_found, now told as its own notice.

Plan exit now follows the mode the process started with, so a pending
model change no longer hides an approved plan.
A crew worked only in its shared folder, which sat outside each bot's
workspace: Claude Code asked before every edit there, even in accept
edits mode. Every bot now gets the crew's work folder with --add-dir,
and loads its CLAUDE.md with the bot's memory.

The owner can pick that folder when creating a crew, or move the crew
later, with Windows' folder picker (tauri-plugin-dialog). The daemon
never writes into a chosen folder, refuses drives, Botloft's own data
and the folder of every bot, and restarts each bot once it is idle.
@httpsphl
httpsphl changed the base branch from feat/bot-models to main September 29, 2026 04:25
@httpsphl
httpsphl enabled auto-merge September 29, 2026 04:25
@httpsphl
httpsphl merged commit be5f01c into main Sep 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant