Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

fix(canvas-control): install skill into each managed account's config dir

enesc4d54b3f3740
diff --git a/src/main/canvas-control.ts b/src/main/canvas-control.ts
index d814b07d2..804773962 100644
--- a/src/main/canvas-control.ts
+++ b/src/main/canvas-control.ts
@@ -17,8 +17,8 @@ function cliScriptPath(): string {
function shimPath(): string {
return path.join(dir(), 'nodeterm.sh')
}
-function skillPath(): string {
- return path.join(os.homedir(), '.claude', 'skills', 'manage-nodeterm-canvas', 'SKILL.md')
+function skillPathIn(configDir: string): string {
+ return path.join(configDir, 'skills', 'manage-nodeterm-canvas', 'SKILL.md')
}
function writeCliFiles(): void {
@@ -37,8 +37,8 @@ ELECTRON_RUN_AS_NODE=1 exec "${process.execPath}" "${cliScriptPath()}" "$@"
}
}
-function installSkill(): void {
- const body = `---
+function skillBody(): string {
+ return `---
name: manage-nodeterm-canvas
description: Create, organize and control nodes on the nodeterm canvas — open Claude Code / Codex / Gemini / terminal nodes, spawn a team of agents that divide up a task, wrap nodes in labeled groups, arrange/align/rename them, show an image/video/web page, write to or close a terminal. Use whenever the user asks to create or open nodes/sessions, build something using multiple Claude (or other agent) sessions, split work across agents, organize the canvas into groups by topic, or visualize code/output you produced. Only works inside a nodeterm Claude session.
---
@@ -89,18 +89,28 @@ Typical requests this skill covers:
- "Tidy up / group my terminals" → \`list\`, then \`group\` + \`arrange\` + \`align\`.
- "Rename this node/group" → \`rename\`.
`
+}
+
+/**
+ * Install (or refresh) the canvas-control skill into a Claude config dir's `skills/`.
+ * Claude Code resolves user skills relative to CLAUDE_CONFIG_DIR, so managed accounts
+ * (config dir = {userData}/claude-accounts/<id>) need their own copy — mirroring how the
+ * managed status hook is merged into each account dir's settings.json. Best-effort.
+ */
+export function installCanvasSkillInto(configDir: string): void {
+ const p = skillPathIn(configDir)
try {
- fs.mkdirSync(path.dirname(skillPath()), { recursive: true })
- fs.writeFileSync(skillPath(), body, 'utf8')
+ fs.mkdirSync(path.dirname(p), { recursive: true })
+ fs.writeFileSync(p, skillBody(), 'utf8')
} catch (e) {
- console.warn('[canvas-control] skill install failed', e)
+ console.warn('[canvas-control] skill install failed', p, e)
}
}
export function initCanvasControl(): void {
try {
writeCliFiles()
- installSkill()
+ installCanvasSkillInto(path.join(os.homedir(), '.claude'))
} catch (e) {
console.error('[canvas-control] setup failed', e)
}
diff --git a/src/main/claude-accounts.ts b/src/main/claude-accounts.ts
index bce4bfed9..8f35dac38 100644
--- a/src/main/claude-accounts.ts
+++ b/src/main/claude-accounts.ts
@@ -10,6 +10,7 @@ import { app, ipcMain } from 'electron'
import { IPC } from '../shared/ipc'
import { accountConfigDir, isSupportedClaudeVersion, parseLoginCapture } from './claude-accounts-core'
import { installClaudeHooksInto } from './agents/hooks/claude'
+import { installCanvasSkillInto } from './canvas-control'
import { findInLoginPath } from './pty-manager'
import type { SshProjectManager } from './remote-ssh/ssh-project'
@@ -69,9 +70,11 @@ export function initClaudeAccounts(getSshManager?: () => SshProjectManager | und
}
const configDir = claudeConfigDirFor(id)
await fs.mkdir(configDir, { recursive: true })
- // Install the managed hook up front so the very first session in this account
- // already reports status (badges/notifications/subagent viz).
+ // Install the managed hook + canvas skill up front so the very first session in this
+ // account already reports status (badges/notifications/subagent viz) and can control
+ // the canvas (Claude resolves skills relative to CLAUDE_CONFIG_DIR, not ~/.claude).
installClaudeHooksInto(configDir)
+ installCanvasSkillInto(configDir)
const versionSupported = await checkClaudeVersion()
return { id, configDir, versionSupported }
})
diff --git a/src/main/index.ts b/src/main/index.ts
index 82cfd8558..bb8b981d0 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -38,7 +38,7 @@ import { posixQuote } from '../shared/ssh'
import { buildHandoff } from './handoff'
import { ChatDriver } from './chat-driver'
import { initContextLink, setNodeTranscript } from './context-link'
-import { initCanvasControl } from './canvas-control'
+import { initCanvasControl, installCanvasSkillInto } from './canvas-control'
import { initTranscriptIndex, searchTranscripts } from './transcript-index'
import { initTelemetry } from './telemetry'
import { initClaudeUsage } from './claude-usage'
@@ -601,13 +601,15 @@ app.whenReady().then(async () => {
ipcMain.on(IPC.chatDispose, (_e, nodeId: string) => chatDriver.dispose(nodeId))
installManagedAgentHooks()
- // Managed accounts each carry their own settings.json — re-install the hook there too
- // (idempotent), so an app update's new hook script reaches every account dir. Best-effort:
- // one failing account must never block launch (match installManagedAgentHooks' fail-open).
+ // Managed accounts each carry their own settings.json AND skills/ (Claude Code resolves both
+ // relative to CLAUDE_CONFIG_DIR) — re-install the hook + canvas skill there too (idempotent),
+ // so an app update's new versions reach every account dir. Best-effort: one failing account
+ // must never block launch (match installManagedAgentHooks' fail-open).
for (const acct of settingsStore.get().claudeAccounts ?? []) {
if (acct.host) continue // remote accounts live on another host; nothing to install locally
try {
installClaudeHooksInto(claudeConfigDirFor(acct.id))
+ installCanvasSkillInto(claudeConfigDirFor(acct.id))
} catch (e) {
console.warn(`[agent-hooks] account ${acct.id} hook install failed`, e)
}