Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

feat(rc): name each agent's Remote Control session after the agent

Vyapak Goyal0720a64aa14d
diff --git a/src/main/index.ts b/src/main/index.ts
index 1f194784..3faa9818 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -1431,6 +1431,17 @@ ipcMain.handle('pty:spawn', async (evt, opts: SpawnOptions & { hive?: AgentMeta;
const m = cfg.defaultModel ?? modelForRole(opts.hive);
if (m) args.push('--model', m);
}
+ // Name the Remote Control session after the agent (Michael, Jim, Dev1…) so it
+ // is identifiable in claude.ai / the mobile app. Otherwise Claude defaults the
+ // prefix to the machine hostname (e.g. "vyapaks-macbook-pro-…"), which is
+ // opaque when several agents run at once — especially with remoteControlAtStartup
+ // on, where RC auto-enables for every session. Slugify the friendly name into a
+ // single safe token; Claude still appends its own random suffix for uniqueness.
+ if (!args.includes('--remote-control-session-name-prefix')) {
+ const label = (opts.hive.name || opts.hive.id || '')
+ .trim().replace(/[^A-Za-z0-9._-]+/g, '-').replace(/^-+|-+$/g, '');
+ if (label) args.push('--remote-control-session-name-prefix', label);
+ }
// Coarse runaway cap.
if (typeof cfg.maxTurns === 'number' && cfg.maxTurns > 0 && !args.includes('--max-turns')) {
args.push('--max-turns', String(cfg.maxTurns));
diff --git a/src/renderer/src/hooks/useHive.ts b/src/renderer/src/hooks/useHive.ts
index 325bb057..37752133 100644
--- a/src/renderer/src/hooks/useHive.ts
+++ b/src/renderer/src/hooks/useHive.ts
@@ -259,8 +259,11 @@ export function useHive(config: HarnessConfig | null): void {
timers.push(setTimeout(() => {
if (cancelled) return;
// settleMs pauses the chain ~1.5s after /remote-control before the
- // orientation prompt (fresh spawns only) is submitted next.
- submitToPty(GOD_PTY, '/remote-control', REMOTE_CONTROL_SETTLE_MS).catch(() => { /* best-effort */ });
+ // orientation prompt (fresh spawns only) is submitted next. Name the RC
+ // session "Michael" so it's identifiable in claude.ai / the mobile app
+ // rather than the opaque hostname default (matches the per-agent
+ // --remote-control-session-name-prefix set at spawn in the main process).
+ submitToPty(GOD_PTY, '/remote-control Michael', REMOTE_CONTROL_SETTLE_MS).catch(() => { /* best-effort */ });
if (!resumedGod) {
submitToPty(GOD_PTY, INITIAL_GOD_PROMPT).catch(() => { /* pty may have died */ });
}