agentrium
CLAUDE.md42 starsChanged 3 months agoMITView on GitHub
Agentrium (Agent Desktop Environment) is a cross-platform desktop application (Windows and macOS) for managing multiple Claude Code CLI terminal instances from a unified interface. Built with Tauri 2.x (Rust backend) and React 18 (TypeScript frontend), it provides tabbed and grid views of parallel Claude Code sessions with PTY-based terminal emulation. The release workflow produces NSIS/MSI installers for Windows and .dmg/.app bundles for both Apple Silicon and Intel Macs. Current version: 1.37.1
- Installs packages
- Commits and pushes
In this repository9 other files it gives its agents.
- .codex/AGENTS.mdAGENTS.md
- agentrium-conventionsSkill
- agentrium-conventionsSkill
- frontend-patternsSkill
- local-qaSkill
- rust-patternsSkill
- security-reviewSkill
- tdd-workflowSkill
- verification-loopSkill
The file
We split this CLAUDE.md into the rules it gives an agent
7 rules. About 0 are common, 0 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 76
When the PTY reader loop ends (process exit), a terminal-finished event is emitted
- Very specific: line 77
All Tauri commands are async and defined in commands.rs
- Very specific: line 123
Use the /publish command (e.g., /publish 1.6.0) to run the full release workflow.
- Very specific: line 133
Push: commit + tag to origin master
- Very specific: line 139
If not using /publish, the same steps can be done manually:
- Very specific: line 141
Run cargo check in src-tauri/ to update Cargo.lock
- Very specific: line 142
Commit, tag with v{VERSION}, push commit + tag
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
Project Overview
Agentrium (Agent Desktop Environment) is a cross-platform desktop application (Windows and macOS) for managing multiple Claude Code CLI terminal instances from a unified interface. Built with Tauri 2.x (Rust backend) and React 18 (TypeScript frontend), it provides tabbed and grid views of parallel Claude Code sessions with PTY-based terminal emulation. The release workflow produces NSIS/MSI installers for Windows and .dmg/.app bundles for both Apple Silicon and Intel Macs.
Current version: 1.37.1
Tech Stack
- Desktop framework: Tauri 2.x
- Backend: Rust (edition 2021)
- Frontend: React 18 + TypeScript + Vite
- Terminal emulation: xterm.js (
@xterm/xterm) with fit, search, and web-links addons - Styling: Tailwind CSS + Framer Motion. Flat IntelliJ IDEA 2026.1 "New UI"–style design: a 5-step elevation ramp (
--elevation-0..4CSS vars),#3574F0accent, Inter (UI) + JetBrains Mono (code). Supports dark/light/auto theme, user-set accent color, compact/comfortable/spacious density, UI font scale, and a "reduce motion" toggle that follows the OSprefers-reduced-motionsetting until explicitly overridden. Text tokens target WCAG AA contrast. (Not glassmorphic - translucency is limited to overlay scrims.) - State management: Zustand (persisted via
zustand/middleware/persist) - Database: SQLite via
rusqlite(bundled) - stores profiles, workspaces, session history - PTY:
portable-ptycrate for spawning Claude Code processes - Notifications:
notify-rustcrate for native desktop notifications (Windows Toast and macOS NSUserNotification) - Auto-updates:
tauri-plugin-updaterwith signed releases from GitHub
Project Structure
src/ # React frontend
App.tsx # Root component - layout, event listeners, setup wizard gate
main.tsx # React entry point
index.css # Tailwind base styles
components/
TitleBar.tsx # Custom frameless window titlebar
Sidebar.tsx # Terminal list sidebar with search
TerminalTabs.tsx # Tab bar for switching terminals
TerminalView.tsx # xterm.js terminal renderer
TerminalGrid.tsx # Multi-terminal grid view (up to 8)
TerminalSearch.tsx # Search within terminal output
NewTerminalModal.tsx # Create terminal dialog
ProfileModal.tsx # Create/edit configuration profiles
SettingsModal.tsx # App settings (args, updates, shortcuts)
HintsPanel.tsx # Claude Code command hints reference
SetupWizard.tsx # First-run setup (Node.js/Claude Code detection)
AutoUpdater.tsx # In-app update UI
WhatsNewModal.tsx # Post-update release notes popup
changelog.json # Structured release notes data for What's New modal
store/
terminalStore.ts # Terminal instances state (Map<id, {config, xterm}>)
appStore.ts # UI state (sidebar, grid, modals, settings)
updaterStore.ts # Auto-updater state
hooks/
useKeyboardShortcuts.ts # Global keyboard shortcut handler
useNotification.ts # Desktop notification hook
src-tauri/ # Rust backend
src/
main.rs # Tauri app setup, plugin registration, state init
terminal.rs # TerminalManager - PTY lifecycle (create, write, resize, close)
commands.rs # Tauri IPC commands (all #[command] handlers)
config.rs # ConfigProfile struct, HintCategory/Hint structs, default hints
database.rs # SQLite database (profiles, workspaces, session_history tables)
tauri.conf.json # Tauri config (window, bundling, updater, plugins)
Cargo.toml # Rust dependencies
capabilities/default.json # Tauri security capabilities
.claude/commands/
publish.md # /publish slash command - full release workflow
.github/workflows/release.yml # CI: build + publish GitHub releases (tag-triggered)Architecture
Backend (Rust)
AppStateholdsArc<Mutex<TerminalManager>>andArc<Mutex<Database>>, managed by TauriTerminalManagerusesportable-ptyto spawncmd /C claude [args]on Windows (or shell on other platforms)- Each terminal gets a reader thread that forwards PTY output via
mpsc::channelto a Tokio task, which emitsterminal-outputevents to the frontend - When the PTY reader loop ends (process exit), a
terminal-finishedevent is emitted - All Tauri commands are async and defined in
commands.rs - Shell commands (
node,npm,claude) are wrapped viacmd /Con Windows withCREATE_NO_WINDOWflag
Frontend (React)
App.tsxlistens forterminal-outputandterminal-finishedTauri events- Terminal state uses a
Map<string, TerminalInstance>in Zustand (not persisted - terminals are ephemeral) - App state (sidebar, grid, settings) is persisted to localStorage via Zustand persist middleware
- Each
TerminalViewcreates an xterm.js instance and wires keyboard input towrite_to_terminalIPC - Grid mode supports up to 8 terminals with auto-layout calculation in
getOptimalLayout()
IPC Commands
Key Tauri commands exposed to the frontend:
create_terminal/close_terminal/write_to_terminal/resize_terminalupdate_terminal_label/update_terminal_nicknamesave_profile/get_profiles/delete_profilesave_workspace/load_workspacecheck_system_requirements/install_claude_codeget_claude_version/check_claude_update/update_claude_codeget_hints/send_notification/open_external_urlstart_task/get_task_status/commit_task_changes/finish_task/list_task_worktrees/prune_task_worktrees(New Task flow,tasks.rs: one worktree per task onagentrium/<slug>under<repo-parent>/.agentrium-worktrees/<repo>/; every command afterstart_taskonly acts on worktrees recorded in thetaskstable)start_race/get_race/list_races/decide_race/abandon_race/delete_race/update_race_contender/set_race_status/set_race_check_command/get_race_diffstat/get_race_file/run_race_check/cancel_race_check(Race mode,races.rs: 2-4 contenders, each a task worktree created from ONE base SHA resolved at start, branchesagentrium/race-<slug>-<model-or-agent>; a failed contender rolls back the ones already created. Rows live inraces/race_contendersandtasks.race_id; local only, never synced.decide_racemerges the winner throughfinish_task_impland refuses before touching any loser if the merge is refused.run_race_checkruns only thecheck_commandstored on the race row, in a contender worktree, in a Windows Job Object / Unix process group so timeout and cancel kill the whole tree; a non-zero exit is data, not an error.)get_remote_info/get_default_branch/get_pr_context/create_pull_request/get_pull_request_status/get_failing_check_logs/build_pr_compare_url(Create Pull Request flow,pull_requests.rs: drives the user's owngh/glabCLI, spawned from its resolved.exeon Windows and never throughcmd /C, else builds a browser compare URL. No tokens are stored and no broker endpoint is involved. Remote URLs are parsed without credentials and all CLI output passes throughstrip_credentials.)probe_binary/list_custom_agents/save_custom_agent/delete_custom_agent/list_credentials/save_credential/delete_credential/test_credential/get_agent_bindings/set_agent_bindings/strip_profile_env_var/plaintext_key_profiles_to_prompt
Development
Prerequisites
- Node.js v22+ (LTS; v18/v20 are EOL - CI builds on 22)
- Rust (latest stable via rustup)
- Visual Studio Build Tools (Windows)
Commands
npm install # Install frontend dependencies
npm run tauri dev # Run in development mode (hot-reload)
npm run tauri build # Build production installers (NSIS + MSI)Build output: src-tauri/target/release/bundle/nsis/ and src-tauri/target/release/bundle/msi/
Publishing a Release
Use the /publish command (e.g., /publish 1.6.0) to run the full release workflow. This is defined in .claude/commands/publish.md and automates:
- Version bump in all four files that contain the version:
package.json→"version"src-tauri/Cargo.toml→[package] versionsrc-tauri/tauri.conf.json→"version"README.md→ version badge + download link filenames
- Cargo.lock update via
cargo checkinsrc-tauri/ - Commit with message
Release v{VERSION} - Tag with
v{VERSION} - Push commit + tag to
origin master - GitHub Actions (
release.yml) then builds installers, signs them, and publishes the release - Existing users receive the update via the in-app auto-updater
Manual Release Process
If not using /publish, the same steps can be done manually:
- Bump version in all four files listed above
- Run
cargo checkinsrc-tauri/to updateCargo.lock - Commit, tag with
v{VERSION}, push commit + tag - The
Releaseworkflow triggers onv*tags - Signing uses
TAURI_SIGNING_PRIVATE_KEY/TAURI_SIGNING_PRIVATE_KEY_PASSWORDsecrets - The updater endpoint:
https://github.com/talayash/agentrium/releases/latest/download/latest.json
Key Patterns
- Error handling in Rust: Commands return
Result<T, String>- errors are string-mapped via.map_err(|e| e.to_string()). Every#[command]body is wrapped inwrap_cmd("name", ...), which reportsErrresults to telemetry. Errors caused by user input or environment (validation, git push/pull rejections, file-too-large) must be returned viaerror_reporter::user_err(...)- the UI still sees the plain message, but telemetry is skipped. Background threads/tasks outsidewrap_cmdreport real failures viaerror_reporter::report_bg(kind, message); usereport_blockingonly when the process is about to exit (panic hook, shutdown path). - Error handling in the frontend (pick by call-site type, never
console.error-only - that silently deletes telemetry the globalunhandledrejectionhandler would have produced):- User-initiated action →
.catch(err => { toast.error(...); reportInvokeFailure('<command_name>', err); })fromsrc/lib/errorReporter.ts. A silent failure here is a user-facing bug. - Background poller / best-effort cleanup →
.catch(() => {})with a one-line comment saying why it's safe to swallow. - Clipboard → always
copyText()/readClipboardText()fromsrc/lib/clipboard.ts, never barenavigator.clipboard(WebView2 focus gating).
- User-initiated action →
- Tauri events: Backend emits
terminal-output(with{id, data}) andterminal-finished(with{id}) - Frontend invoke pattern:
invoke<ReturnType>('command_name', { param })from@tauri-apps/api/core - Window: Frameless (
decorations: false,transparent: true) with customTitleBarcomponent - Grid layouts:
GridLayouttype is a union of strings like'2x2','2x3', etc. - Unread indicator: Terminals receiving output while not active are tracked in
unreadTerminalIdsSet - Database location:
ProjectDirs::from("com", "claudeterminal", "ClaudeTerminal")→ data dir →claudeterminal.db - Multi-agent session restore: session id capture / listing / resume-flag injection is routed through
session_provider::provider_for(agent)(Rust) andlistAgentSessions(agent, cwd)(TypeScript). Each agent's on-disk convention lives in its own module (claude_session.rs,codex_session.rs,cursor_session.rs; Antigravity is cloud-backed with no local index). To add a new agent, implementSessionProviderfor its storage layout and extendresume_flags_forinterminal.rswith its CLI form (flag vs subcommand). - Desktop ↔ auth broker contract: sign-in and sync talk to the sibling repo
../agentrium-api(deployed on push to itsmaster). The callback shapeagentrium://auth-return?code=…&state=…, the PKCE token exchange (POST /api/auth/desktop/token), refresh,/api/me, and the sync push/pull bodies are a two-sided contract documented inagentrium-api/README.md. Never change one side alone: installed desktop builds cannot be hot-fixed, and the last unilateral broker change left the LoginModal spinning forever. Desktop-side pins:parse_auth_return/exchange_codetests insrc-tauri/src/auth.rs; broker-side pins:finish/route.test.ts. Any failure in the deep-link path must emitauth-error(Rust) sosubscribeToAuthEventscan stop the modal spinner, neverreturnsilently. Token-issuing requests carry an optionalclientobject (auth::ClientInfo: app_version, os, installation_id); the broker stores it asrefresh_tokens.client_infofor the /admin dashboard. Keep it optional on both sides. - Initial prompt (Race mode):
agents::AgentSpec::initial_prompt(Positional/Flag/FlagEquals) is set only for CLIs whose--helpdocuments it (Claude and Codex positional, Antigravity--prompt-interactive; Cursor unverified, so none). Custom agents carry a device-localinitial_prompt_template({prompt},--flag {prompt},--flag={prompt}), never part of the sync row.create_terminal'sinitial_promptis appended to argv after arg validation and never persisted;terminal::render_initial_promptinlines it only when it passes through byte for byte (Unix single quotes; on Windows only if free ofCMD_UNSAFE, since portable-pty's\"quoting is not cmd-aware), otherwise it writes a private file under the app data dir (never the shared temp dir) and passes "Read the task description in<file>". Agents without the capability get the prompt staged withsetPromptDraft; never type a prompt into a PTY. - Custom agents and credentials:
AgentKind::Custom(id)(wire formcustom:<id>) resolves throughcustom_agents.rs+ thecustom_agentstable into an ownedagents::AgentSpec;resume_flags_forrenders the agent'sresume_flagtemplate. API keys live only in the OS credential store behindcredentials::SecretStore(keyringcrate); SQLite keepsCredentialMeta(label, env var, masked tail).create_terminalresolvescredential_bindingsinto asecret_env_varsmap applied to the PTY but never written toTerminalConfig. Frontend:AgentKindisBuiltinAgentKind | \custom:${string}`, custom specs are registered viasetCustomAgentSpecsfromagentRegistryStore, and anyRecord<AgentKind, T>must beRecord<BuiltinAgentKind, T>` plus a fallback for custom kinds.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

