vibespace
CLAUDE.md1 starsChanged 2 months agoMITView on GitHub
Guidance for Claude Code (and any agent) working on VibeSpace — a per-repo workspace app: file tree + Monaco preview + named Claude Code agent terminals, one Windows app identity per repository. Read this before changing things; it encodes decisions that were learned the hard way on build day (full history in CHANGELOG.md). Knowledge is tracked as we go, never batched for later: - Decision made → append one line to DECISIONS.md immediately. - User-visible change → CHANGELOG.md section before…
- Reads credentials
In this repositoryOne other file it gives its agents.
- sync-docsSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
25 rules. About 0 are common, 6 are distinctive, and 19 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
19
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 42
If you give both panes grow/shrink, the divider stops tracking the pointer 1:1.
- Very specific: line 122
Primary source since 0.6.20: the claude data feed: Every statusLine/hook body carries session_id and arrives tagged with our term id, so …
- Very specific: line 183
NO terminals (0.6.59: a patch script inserted a block between export and function compactSoon).
- Distinctive: line 197
If you must land a watched-dir change while old watchers still run: batch ALL writes into one <400 ms burst (devwatch debounce), warn the …
- Very specific: line 244
BEFORE show() (no button flash) and on every state:save.
- Very specific: line 407
Use the long flag. --rc is documented but missing from claude --help.
- Very specific: line 408
Never use server mode (claude remote-control): it refuses --settings, which would drop our hooks.
- Distinctive: line 414
After Win+L the idle time reads only a few seconds.
- Very specific: line 432
Don't switch to CLAUDE_CONFIG_DIR per account: it splits transcripts, skills, memory and settings.
- Very specific: line 461
After a switch both accounts share ONE transcript and one feed state.
- Very specific: line 510
Before typing /exit, moveOne asks pty:claudeRunning.
- Very specific: line 529
BEFORE metas is cleared), pty exit and main start.
- Very specific: line 538
Every move/resume compares with it, and restore/unpark with no account of that family left opens a plain tab (or keeps it parked), never …
- Very specific: line 723
AFTER a CDP screenshot; and a CDP char event has no keydown, so the custom key handler never sees it (use keyDown with text).
- Very specific: line 731
When a background task finishes, claude wakes ITSELF: a UserPromptSubmit whose prompt starts with <task-notification>, then a normal turn …
- Distinctive: line 740
No new status word, so the status files / toasts / badge rule is untouched.
- Very specific: line 743
Test without spending tokens: capture hook bodies once (replace claudefeed.onHook through the main inspector), then POST them to the …
- Very specific: line 776
Every read-only git spawn needs GIT_OPTIONAL_LOCKS=0, or our polling makes agents' commits fail on index.lock.
- Very specific: line 792
Search, logoscan and gitdiff keep the full IGNORED_NAMES.
- Very specific: line 806
Terminal widths must match Claude's: Every xterm loads @xterm/addon-unicode11 and sets unicode.activeVersion = '11'.
- Very specific: line 952
Dock: every workspace process is its own Dock tile.
- Distinctive: line 1021
Releases: only when the owner says "release".
- Very specific: line 1057
The guard stays out: if a Claude tab switched at the same moment, and on machines with no Claude account (a z.ai-only PC keeps its pick as …
- Distinctive: line 1120
Update CHANGELOG.md (new version section) and TODO.md for anything user-visible.
- Very specific: line 1121
Keep the launcher renderer dumb — workspace-window features belong in renderer/workspace/.
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 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
Guidance for Claude Code (and any agent) working on VibeSpace — a per-repo workspace app: file tree + Monaco preview + named Claude Code agent terminals, one Windows app identity per repository. Read this before changing things; it encodes decisions that were learned the hard way on build day (full history in CHANGELOG.md).
How we work (standing rules for every agent in this repo)
Knowledge is tracked as we go, never batched for later:
- Decision made → append one line to
DECISIONS.mdimmediately. - User-visible change →
CHANGELOG.mdsection before reporting the work done. - Hard-won lesson/gotcha → the matching bullet in this file, same day.
- New task/idea →
TODO.md. Done task → checked off. - User preference or project fact → your agent memory (with Why + How-to-apply).
- The owner says "update all docs" → run the
/sync-docsskill (the full sweep). It's a rule, not a UI feature — there is deliberately no button for it. - A task is not done until the docs above are current. "I'll document it later" is how knowledge dies.
- Commit + push a fix as soon as it's verified working (live check or smoke),
with its docs, in one commit. Never leave verified work sitting uncommitted.
Several agents share this working tree, and a restart, crash or lost
conversation strands it: the
claudewrapper sat uncommitted for hours while it was the only thing tracking resumed conversations (2026-09-30). Stage only your own hunks, nevergit add -A. If you find verified work that is orphaned, commit it and say so in the message.
Ground rules
- Never reintroduce caching in the
app://protocol (main/index.cjs). It must read from disk and serveCache-Control: no-store.net.fetch(file://…)caches and once shipped stale mixed bundles through the hot-reload path — that bug presented as "the UI randomly doesn't have the new code" and cost hours. - The splitter drag pattern (
renderer/workspace/app.js): capture the pane size once onpointerdown, apply cumulativeclientX/clientYdeltas to that frozen value, listen onwindow(capture) during the drag. Do NOT usemovementX/movementY(spikes under capture), do NOT usesetPointerCapture(breaks with remote-control software like UltraViewer), and do NOT derive steps from the rendered size (flexbox shrink feeds back and spirals — this was the original "glitchy resize"). - The terminal pane owns its size (
flex: 0 1 auto, the viewer absorbs the rest). If you give both panes grow/shrink, the divider stops tracking the pointer 1:1. - xterm refit is throttled (
terms.js: 120 ms during drags, once on release). Per-pixelfit()→ pty resize → ConPTY reflow is a visible storm. - Env copies on Windows:
Path, notPATH.process.envis case-insensitive, but{ ...process.env }is a plain object — writingenv.PATHon the copy adds a SECOND key and the child may see the wrong one. Always go through ptyhost'swithSinglePath/readPath. This one bug caused a day of "node/python/MCP not found in VibeSpace terminals" (2026-09-29). Also: never write Windows paths as JS string literals ('C:\Windows'→C:Windows); build them withpath.join. - Right-click belongs to the app when it tracks the mouse. Claude Code turns on
mouse tracking after its trust screen and pastes on right-click itself; our
contextmenu paste must skip when
term.modes.mouseTrackingMode !== 'none'or every paste doubles. Test mouse behavior AFTER the trust prompt — before it, Claude hasn't enabled tracking yet (an early probe gave a false all-clear). - Copying from a claude tab is CLAUDE's copy, not ours (investigated
2026-10-12, claude 2.1.296). With mouse tracking on, a left-drag never makes
an xterm selection: Claude selects and copies on release by itself
(
copyOnSelect, PowerShellSet-Clipboard, ~0.5-1 s later), joining its wrapped lines. Right-click then finds no xterm selection and does nothing. Claude's bug: while its view is scrolled up, theJump to bottom (ctrl+End) ↓button covers ~29 cells of the last visible message row, and its copy DROPS those cells ("I checked with a test account today" → "I chec"). Workaround: Ctrl+End / scroll to the bottom before selecting, or/copy. Shift+drag (xterm's selection) keeps every wrap as a line break, so it is no better. - Per-workspace identity is load-bearing: each workspace process sets its own
userDatadir ANDapp.setAppUserModelId('vibespace.workspace.<id>')before app ready; shortcuts carry the same AUMID (assets/ps/set-shortcut.ps1writes it through the shell property store —Get-StartAppsverifies). Change the scheme and every existing pin breaks. Pinning a running window whose AppID has no Start Menu .lnk makes Windows create a junkElectron.lnk(Electron logo, no args) — that's why every window callsclaimTaskbarIdentity(setAppDetails + ensure shortcut + purge junk).Get-StartAppsshowing a workspace named "Electron" = this bug. A pin still showing a stale icon after the .lnk + .ico are verified correct = Windows icon cache: stop explorer, delete%LOCALAPPDATA%\Microsoft\Windows\Explorer\iconcache_*.db, start explorer (ie4uinit -showalone is not always enough — confirmed 2026-09-28). - A logo change needs a new icon PATH and a new taskbar button (0.6.41).
Windows caches a taskbar button's icon by file path and reads it only when
it creates the button, so rebuilding
<id>.icoin place left the old icon on the taskbar even after reopening the window.workspaces.updateLogowrites<id>.v<stamp>.ico(ids never contain a dot) and prunes older versions;rebuildTaskbarButtonmoves the window to<aumid>.refreshand back after 300 ms. What did NOT refresh it (all tested with taskbar screenshots):setAppDetailswith the new path alone,setSkipTaskbaroff/on,SHCNE_UPDATEITEMon the .lnk,SHCNE_ASSOCCHANGED.hide()/show()also works but blinks. Explorer's FOLDER view refreshes on its own, so a correct icon there proves nothing about the taskbar. To see a button that sits in the taskbar overflow, toggleOverflowButtonthrough UI Automation and screenshot above it. Never readws.iconPathonce and keep it: it changes with every logo. - Closing a pty must kill its process TREE first (
ptyhost.kill, 0.6.52). ClosePseudoConsole only ends processes attached to the console; claude's MCP servers run in their own hidden console and survived as orphans (124 mcp-postgres, 2026-09-29).taskkill /Twalks from the shell pid, so it must FINISH befores.kill(): once the pty is closed the shell is gone and the tree can't be found (fire-and-forget lost that race 3/3). Hence the delayed close, and theonData/onExitowner checks for the dying pty. - GPU acceleration is deliberately off (
app.disableHardwareAcceleration()) — windows went blank over remote-display software. Renderers self-heal viarender-process-gone→ reload WITHOUT killing ptys — the renderer re-attaches.
Session tracking (the resume magic)
Claude Code stores conversations in
~/.claude/projects/<munged-repo>/<uuid>.jsonl where munging replaces every
non-alphanumeric char with - (D:\Repositories\Foo → D--Repositories-Foo).
Key facts encoded in main/sessions.cjs:
- The
.jsonlis created when the first message is sent, not atclaudelaunch — discovery windows must not have short upper bounds. Exception (seen live, 2.1.287): a claude started with--remote-controlwrites its.jsonl(~3.8 KB) BEFORE the first message. - The transcript lives under munged(<the claude's cwd>), not the repo's dir,
when the tab's cwd isn't the repo root (worktree tabs).
pinFromFeedaccepts the feed'stranscript_path(basename must equal the session id, file must exist),sessions:checkgets the tab's cwd, andoffRepoterms are skipped by the timing heuristic (it only scans the repo's dir). - An unresolved terminal owns the earliest session file born after its claude launched and before the next terminal's claude launch; tabs resumed with a known id are pinned and never rediscovered.
- Primary source since 0.6.20: the claude data feed. Every statusLine/hook body
carries
session_idand arrives tagged with our term id, so main callssessions.pinFromFeed()on each feed emit. That follows/clear(verified: the new transcript exists at once and it re-pinned in ~1.7 s),/resumeand the picker. It pins only once the.jsonlexists, so a restore never resumes a conversation that was never saved. Feed-pinned terms are flaggedfeedand the timing heuristic never touches them. - Verified live (2.1.284, no message sent): picking a conversation in the
claude --resumepicker, or typing/resume <id>in a running session, sends a statusLine tick with the newsession_idwithin ~1–1.5 s.pinFromFeedpins it at once, so "pick, then restart before typing" keeps the pick for feed agents.pickResumed(mtime revival, which only fires after the old .jsonl gets a new write) is now just the pre-feed fallback. If a future claude stopped ticking there, a SessionStart COMMAND hook that curls the id to the feed server would close the gap (SessionStart never fires as an HTTP hook).- ▾ → "All conversations…" (was the ↺ Resume button, 0.6.20–0.6.37) =
pickSession.
- ▾ → "All conversations…" (was the ↺ Resume button, 0.6.20–0.6.37) =
- The heuristic above is now only the fallback for agents without a feed
(started before 0.6.16). Since 0.6.55 it is enforced: main records per
pty whether its settings carried the feed (
feedPtys) and passesfeedLaunchwithpty:claudeStarted;scan()never guesses for those (two launches seconds apart used to hand tab 2 tab 1's conversation, because a transcript is born at the first message, inside the LAST launch's window). A feed id seen before its.jsonlexists is kept aspendingand pinned byscan()when the file appears. Guesses skip ids another tab owns. Its known holes (manual/resume, near-simultaneous launches) remain for those only; see TODO.md. - Without
--settingsthere is no feed, so no tracking. A claude started without it was lost on restart (2026-09-29: a hand-/resumed conversation on a pre-feed build). So every pty's PowerShell starts with aclaudefunction (ptyhostCLAUDE_WRAPPER, sent via-EncodedCommand). It adds--settings $env:VIBESPACE_CLAUDE_SETTINGSand--remote-control $env:VIBESPACE_RC_LABELunless they're already given, and never touches subcommands or-p/--version/--help(a-prun would pin its session onto the tab).VIBESPACE_CLAUDE_DRYRUN=1prints the final args (smoke uses this). - Claude's
/resumepicker is case-sensitive about the drive letter (anthropics/claude-code#90588, open). A session first recorded asd:\…(VS Code, cmd) is hidden from the list and refuses to open ("from a different directory").claude --resume <id>works, so restore (by id) is unaffected (unpark too). Only + ▾ → All conversations… and a dead-session restore go through the picker. Repair (the issue's own workaround, done for 41 conversations on 2026-10-01): rewrite only the"cwd":"x:\\drive letter to uppercase in the.jsonl. Skip sessions listed in~/.claude/sessions/*.json(live) and files written in the last 2 min, back up first, and re-parse every line afterwards. New sessions started from the VS Code extension will keep producingd:\.
Developing VibeSpace
npm run smoke— 181 self-tests on Windows, 192 on macOS (2026-11-28; the session-store checks now use a fixture, so they run on macOS too) incl. pty echo and live session discovery. Run it after touching main-process code, from a normal shell: inside a Claude pty the stripped PATH and nested ConPTY break the pty test (powershell.exe"File not found" / AttachConsole) — prepend System32 to PATH and give it its own console, or just use a real terminal. A syntax error in smoke.cjs hangs the run SILENTLY (the require throws inside whenReady) —node --check main/*.cjsbefore every smoke run. The PACKAGED binary must also pass it:dist\win-unpacked\VibeSpace.exe --smoke— catches asar/path bugs (e.g. pty cwd error 267).npm run rebuildonly needed after reinstalling node-pty.node --checkdoes not catch a broken renderer import. A named import of something a module no longer exports passes every syntax check, then the browser refuses to link the module graph and the workspace window opens with NO terminals (0.6.59: a patch script inserted a block betweenexportandfunction compactSoon). Smoke's "every named import is exported" check covers it; when patching renderer files by script, anchor on the fullexport function name(line, never onfunction name(.- Hot reload is opt-in (
main/devwatch.cjs, since 0.3.0): it only runs in a process started with--watch/VIBESPACE_WATCH=1(unpackaged builds only;VIBESPACE_NO_WATCH=1still force-disables; a watched launcher propagates the env to workspaces it spawns;npm run dev= launcher with watch). Savingrenderer/+preload/reloads windows — live ptys survive and the renderer re-attaches (same termIds, scrollback restored; 0.4.0). Savingmain/relaunches the process, deferred while any terminal is busy (busyNow, 5 s idle window). Default-off is deliberate: every unpackaged process used to watch, so one save bounced every open instance's agents. If you are an agent editing this repo from inside a VibeSpace window, work in a normal (non-watch) window. If you must land a watched-dir change while old watchers still run: batch ALL writes into one <400 ms burst (devwatch debounce), warn the user first, and expect one bounce — resume is verified working. Root-level files (CHANGELOG.md, TODO.md, RESEARCH-HOTRELOAD.md) are not watched. - "Typing is laggy" → grep the log for
lag:(main/lagmon.cjs, 0.6.35).key→screen≈claude/pty echo+ highcpu= the machine (agents' test runs/builds) or claude itself; a big gap between the two,renderer blockedormain loop stalled= VibeSpace. Only single typed keys are timed (pastes and escape sequences don't echo 1:1). The renderer stall watch skips hidden/unfocused windows (Chromium throttles their timers) and main skips its first 30 s (boot blocks by design). Seen 2026-11-04: 0.5-66 s echo delays at cpu 93-100 %. Agents' whole-project tsc, guard runs, commit hooks and renders were running at claude's own Normal priority, and memory was overcommitted (an idle tab is paged out). The fix lives outside VibeSpace: a separate process-priority tool on the dev PC (claude + our electron AboveNormal, agent jobs BelowNormal). Check that it runs before blaming the app. - Logs:
~/.vibespace/logs/<instance>.log(dev-watch lines, pty spawns, session captures, renderer errors, term-status transitions). Rendererconsole.warn/errorreach the log viaconsole-message. Electron 35+ passes that event'slevelas a string ('warning'/'error'), so a numeric>= 2check alone silently drops every line. That happened from about 2026-09-26 until 2026-09-29.VIBESPACE_DEBUG=1for session-scan traces. Ctrl+Shift+D in a window copies a diagnostics bundle. - Agent status hooks (0.5.0): claude tabs launch with
--settings <instance>/claude-hook-settings.jsoninjecting Notification/Stop/UserPromptSubmit/PreToolUse hooks that append working/waiting/done to$VIBESPACE_TERM_STATUS(set per pty by ptyhost). Since 0.6.22 those Git Bash hooks are only the fallback: when the claude data feed is listening, main appends the words itself from the feed's HTTP hooks (status.wordForHook). Command hooks BLOCK claude, and a cold bash start under load took >10 s ("UserPromptSubmit hook timed out"). Never put a spawn on the prompt path again.main/status.cjswatches and pushesterm:status→ tab lights, toasts, taskbar badge. Change the word set and all three of those together. The Windows taskbar badge is the window's most urgent tab (2026-11-28,main/taskbadge.cjs+ index.cjsrefreshBadge): it was "last event wins" with only red/green, so another agent finishing painted over a question, focusing the window wiped it, and working agents showed nothing. Now every status change, feed tick and tab list save recomputes it from all tabs with the tab lights' rules (tabKind, mirrors feeduilightDetail), priority perm > question > waiting > failed > working > net > bg > done;done(green) only for a turn finished while you weren't looking, cleared on window focus. Icons<dataRoot>/icons/badge-<kind>.pngdrawn by sharp. macOS keeps its Dock dot + bounce. ⚙ Hide from taskbar (2026-11-28,main/traymode.cjs, index.cjsapplyTrayMode, state.jsonhideTaskbar):setSkipTaskbar(true)+ a Tray whose image is the logo with the badge composited in (nativeImage reads the .ico, sharp composites;refreshBadgefeeds it). Applied in ready-to-show BEFOREshow()(no button flash) and on everystate:save. Minimize →hide()(no button = a stray title bar otherwise). A logo change in tray mode repaints the tray and skipsrebuildTaskbarButton(a new AppID could bring a button back). Windows 11 puts every new tray icon in the ^ overflow: the per-icon switch isHKCUControl PanelNotifyIconSettings<n>IsPromoted(DWORD), the key found by ourIconGuid; explorer applies a change at once (verified with screenshots). Explorer itself writesIsPromoted=0when it re-registers an icon, so "absent" can't mean "never set": we promote once per GUID, recorded in<dataRoot>/tray-promoted.json. The Tray GUID hashes wsId + exe path (Electron ties an unsigned exe's GUID to its path: dev and installed must differ). Test the taskbar side through UI Automation (Shell_TrayWnddescendants named "<ws>- 1 running window"). - Claude data feed (0.6.16):
main/claudefeed.cjsruns a127.0.0.1:<random port>server; the same settings file adds a statusLine (curlPOST to/sl) andtype: 'http'hooks (/hook/<Event>), tab id in thex-vs-termheader ($VIBESPACE_TERM_ID, set per pty by ptyhost). It must listen BEFORE any pty spawns: a dead port makes claude print red "hook error / ECONNREFUSED" lines in the TUI every turn. Soindex.cjsawaitsclaudefeed.start()first, and no port means no feed entries. SessionStart never fires as an HTTP hook, so don't rely on it. Hand-off rule: if~/.claude/settings.jsonhas a statusLine command, ours pipes the same stdin into it and prints ITS output. Otherwise we print nothing, which leaves one blank row above claude's mode line. The command hooks stay as they are, so lights/toasts/badge survive a feed failure. Layers (0.6.17): the status files are the BASE state (working/waiting/done). The feed is the DETAIL layer on top of it: the lock/?/✕ light, the reason tooltip, the3/7pill, the activity strip and the peek card (renderer/workspace/ui/feedui.js). Since 0.6.42 the strip is a status bar BELOW the terminal (#term-stripcomes after#term-hosts), so anything anchored to it (the task checklist) must flip upward when there's no room below. A tab with no feed must look exactly as it did before 0.6.16. The lights/toasts/badge rule now covers feed reasons too:claudefeed.attentionText()builds the text for the light tooltip, the strip and the toast body. A failed turn (StopFailure) fires no Stop hook, so main toasts and badges it from the feed. Account limits are shared across processes via<dataRoot>/limits.json(adopted when newer and < 6 h old). Screenshot testing: delete the throwaway home's log first, or a script grepping it for the feed port picks up a stale port from an earlier run. Effort (0.6.56): the statusLine body haseffort: { level }and hook bodies a plaineffort: "high"(2.1.294);claudefeed.readEfforttakes both, and hooks withagent_idare skipped (a subagent's own effort). The body also carriesfast_modeandthinking.enabledif ever needed. Compaction (0.6.59, verified on a real transcript): the.jsonlgets acompact_boundarysystem line withtrigger(auto/manual) andpreTokens. The feed keepslastCompact { trigger, at, before, after }:before= the last context size before PreCompact,after= the first statusLine reading with a % afterwards (PostCompact may not come). A context meter that drops sharply is a compaction, never a restart: a resume reloads the full history under the same id. 0.6.20:- Instant attention. PermissionRequest or the AskUserQuestion PreToolUse
flips the base status to
waitingthroughmain/attention.cjs: an in-memory override applied via the sameapplyStatuspath as the file listener. It never writes the hook-owned files. - While that dialog is open, a late PreToolUse
workingline is ignored. The tool running hands backworkingunless the turn ended (Stop'sdonewins). - Only the thread that opened a dialog closes it (
feed.askAgent, 2026-10-31). Background subagents keep calling tools while the main agent asks; each of their Pre/PostToolUse clearedattention, so the light left "needs you" seconds after the ask. A dialog'saskAgentis the asker'sagent_id(null = main); tool events of other threads leave it open. - Toasts fire once per waiting episode: they only fire when the status actually changes.
prompt_cache.expires_atis an ABSOLUTE epoch-seconds deadline (the last API request + ttl, 1 h here), so the cache countdown is client-side math.- PreCompact/PostCompact payloads are still unverified live and are read defensively.
- Background agents:
claude agents --json --cwd <repo>(about 0.8 s), filtered tokind: 'background'.claude attachignores--settings, so an attach tab is a plain tab. - Screenshot mode's hard 10 s exit is too short on a loaded machine. The
phase-5 script (
scratchpad/shot5.cjs) drives a NORMAL window instead, with auto-resume off andAPPDATApointed at the throwaway home so the real Start Menu is never touched.
- Instant attention. PermissionRequest or the AskUserQuestion PreToolUse
flips the base status to
- Internet outages (0.6.54,
main/netwatch.cjs+index.cjsnetFailure+terms.jsnetResume+ui/netchip.js): an outage StopFailure carries onlyerror: "server_error"; the reason is the transcript's last API error text (claude 2.1.295: "Can't reach the API server … (ENOTFOUND)", "Connection refused … (ECONNREFUSED)", "Request timed out").isNetworkFailureis pure; ambiguous texts need the probe (DNS + TCP connect to the tab's API host, never an HTTP request) to fail too. A network failure skips the toast, the badge AND the account limit-switch, setsfeed.net(derived light/board state, the status words are unchanged), and main probes every 15 s; online = 2 successes in a row → the renderer pastescontinue(same evidence rules as an account move), max 3 per tab per outage. Live-testable with a local relay asANTHROPIC_BASE_URLplusVIBESPACE_NET_PROBE=127.0.0.1:<port>. Subagent failures (0.6.57): a StopFailure withagent_idis a SUBAGENT's (twice per agent, one withagent_type). It never setsfeed.failure(no ✕, no toast, the main turn stays open); index.cjshandleSubagentFailurereads the error from<transcript dir>/<session>/subagents/agent-<agent_id>.jsonl(sessions.subagentTranscriptPath; it can be missing, then the probe alone decides). A network one setsfeed.netwithkind: 'subagent'; a<task-notification>wake keeps it; when the API is back the renderer sends ONE nudge to the idle main agent, or skips if it is working / in a dialog. - Inbox (0.7.4,
main/inbox.cjs+ui/inbox.js+ui/minimd.js, 📥 or Ctrl/Cmd+Shift+M): the final reply of every turn (Stoplast_assistant_message, full text), failed turns, and open questions / permission prompts, of the window's OWN workspace only. Why: with 10-20 agents the final reply drowns under tool lines, background wake-ups and peer-started turns (2026-10-20). It first listed every workspace in every window; same list + same count everywhere was noise, so since 2026-10-21 main answersinbox:*for the sender's workspace only (from its in-process store, never a ws id from the renderer).- Each process writes
<dataRoot>/inbox/<wsId>.jsonfor its own workspaces (≤1 write/s, 300 entries / 30 days). These files PERSIST after the window closes, unlike board files. Read marks are machine-wide in<dataRoot>/inbox-read.json, re-read and merged before every write. - Subagent events (
agent_id) never make entries. The turn's prompt decidesorigin:<task-notification>= background,<cross-session-message= peer (withfrom-name), else you. A prompt YOU typed into a tab marks that tab's earlier entries read and closes its open dialogs. Open entries also close on the next tool call, the end of the turn, a window close and a restart (a denied permission fires no PostToolUse). - Focus view (
viewMode: "focus") hides text written before a tool call in the same turn: claude shows only each turn's final message, and a turn that ends in AskUserQuestion has none (claude 2.1.308's own description: "the user sees only its final message per turn"). So a question entry keepstoolUseId+transcript, and the firstinbox:getreads that step's text blocks from the .jsonl tail (textBeforeTool: back to the previous user line / tool_result, sidechains skipped; 1 MB then 8 MB) and stores it asbefore. inbox:listsends 300-char previews;inbox:getgives one full text.inbox:changedpushes updates; the poll (5 s open, 10 s badge) is a safety net and refreshes the "ago" times.- minimd escapes ALL text before adding its own tags, and links show as text
- URL with no href. Keep it that way: replies are untrusted text going into innerHTML.
- Each process writes
- Launch queue (2026-11-27,
main/launchqueue.cjs+scripts/queue-agent.cjs): other agents or a scheduled task open new agents with a first prompt, e.g.node scripts/queue-agent.cjs --repo <repo> --name "PF · 05 brief" --prompt "Read docs/x.md and do it." --in 3m(--at <date>,--list). One file per request in<dataRoot>/launch-queue/(written tmp + rename); the window of that repo checks every 10 s, CLAIMS a due request by renaming it (atomic, so two windows can't both open it), opens at most one per 20 s, and sendsagents:launch→terms.newAgentWithTask(name, prompt, { activate: false, exact: true }): a normal interactive tab with the exact name that doesn't take the screen. Requests wait while the window is closed and are dropped a day after they were due (log:launch queue: opening|dropped). The prompt is claude's first argument, so",$, backticks and line breaks are stripped. Skipped in smoke runs. - Agent board (0.6.19,
renderer/workspace/ui/board.js, ▦ or Ctrl+Shift+B):- It is an overlay inside
#term-hosts, so xterms are never disposed or refit when it opens or closes. - Columns: Needs you / Working / Done / Other. Cards are updated in place so a half-typed quick reply survives feed ticks.
- It is READ-ONLY: it reads
terms.agents()/feedFor(), and the status files and the feed stay the truth. - Quick reply exists only on Done and failed cards. In a permission or question dialog, "text + Enter" would pick the highlighted option.
- Other workspaces:
main/board.cjswrites<dataRoot>/board/<wsId>.jsonon change (at most one write per 2 s, a 60 s heartbeat, deleted on close). Readers hide files older than 2 min. - "Focus that workspace" spawns
--workspace=<id>, which loses the single-instance lock.whenReadymustreturnwhen!gotLock: without that guard the duplicate opened a window, spawned ptys and deleted the running window's board file (fixed 0.6.19; the launcher's Open button had the same bug).--smokeskips the lock entirely: it shares the launcher's default userData, and a running launcher would otherwise make smoke bail out silently.
- It is an overlay inside
- Phone control + away mode (0.6.21, RESEARCH-REMOTE.md):
- It is Claude Code's own Remote Control.
terms.jsclaudeCommand()is the ONE builder for a new interactive claude and adds--remote-control "<ws> · <tab>"unless the workspace opted out. - Use the long flag.
--rcis documented but missing fromclaude --help. - Never use server mode (
claude remote-control): it refuses--settings, which would drop our hooks. main/presence.cjsowns<dataRoot>/presence/at-pc, passed to every pty asCLAUDE_CLIENT_PRESENCE_FILE. File exists = at the PC = phone pushes muted.- Presence state is machine-wide in
presence.json, and every workspace process runs the same idempotent ticker. - After Win+L the idle time reads only a few seconds. A locked screen must count as infinite idle, or the "back at PC" rule flips straight back.
- The
--remote-controlname is fixed at launch. A tab rename is forwarded as a pasted/rename <ws · name>(terms.jssyncClaudeName), only when status isdoneand no keystroke has arrived since. Mouse and focus reports don't count as keystrokes. - Verified live 2026-10-01: question → phone push → answered on the phone → PC agent continued. Claude ALSO skips the push while that agent's VibeSpace window is the active window (xterm focus reports; another VibeSpace window counts as away). Presence and focus are checked once, at the moment the agent starts waiting. A second push ~30 s after another agent's push was dropped (once, not yet reproduced). A test must make the agent ask AFTER you leave (a delay), not before.
- It is Claude Code's own Remote Control.
- Accounts / multi-subscription (0.6.29, RESEARCH-MULTISUB.md,
main/accounts.cjs):- Extra Claude accounts are
claude setup-tokentokens handed to claude asCLAUDE_CODE_OAUTH_TOKEN, ONLY for that call. The pty wrapper reads the tab's$VIBESPACE_ACCOUNT_FILEand decrypts<dataRoot>/accounts/<id>.dpapiitself. Everything shares one~/.claude, so session tracking is untouched. Don't switch toCLAUDE_CONFIG_DIRper account: it splits transcripts, skills, memory and settings. - DPAPI goes through .NET
ProtectedData, neverConvertTo-SecureString. Under a PSModulePath inherited from PowerShell 7, Windows PowerShell 5.1 can't load that cmdlet's module. The wrapper and smoke run the sameaccounts.DECRYPT_PSsnippet. - Token accounts get no
--remote-controlin either the wrapper orclaudeCommand. Remote Control refuses setup-tokens. - Seen live 2026-10-07: a conversation that ran with Remote Control on the
login account, resumed on a token account WITHOUT
--remote-control, still shows "Remote Control disconnected — Claude.ai login expired — run /login". Claude seems to restore the session's RC and fail on the token. The message is harmless (the agent works, there's just no phone control) and is not a VibeSpace bug: don't chase it. RC and usage always come from the SAME credential in one claude process, so phone control lives on whichever account is the/login. To move phone control to another account, make THAT account the/loginand re-add the other one as a token. - Token accounts also lose the claude.ai connectors (Google Sheets, Claude
Docs, Claude in Chrome): a setup-token can only make model requests. Seen
live 2026-10-07: every agent moved to a token account had them drop
mid-session. So put the account whose connectors and phone you need on
/login. Claude also hidesCLAUDE_CODE_OAUTH_TOKENfrom its tool shells, so an agent asked "which account am I on" reads~/.claude.jsonoauthAccountand wrongly reports the/loginemail. The truth is the tab's$VIBESPACE_ACCOUNT_FILE; per-account statusLine limits prove it. - Usage-limit evidence: the transcript's last
isApiErrorMessageline carrieserror: "rate_limit", the "You've hit your weekly limit · resets …" text andquotaLimits { status: "rejected", resetsAt }. That is the exact reset; verified on real transcripts. - After a switch both accounts share ONE transcript and one feed state. So
evidence older than the tab's current account (
accountSince) is ignored, andclearRateLimitsdrops the old windows. Otherwise the old account's limit blames the new one (found in review). - The limit-switch resume says why (0.6.61,
terms.jsonAccountSwitch): the prompt typed after the relaunch names the new account and asks the agent to restart subagents that died on the limit. It is typed inside"…"in PowerShell, so",$, backticks and line breaks are stripped from the account label/reason. Subagents can't be resumed by VibeSpace; only the main agent can relaunch them. setTermAccounthappens only AFTER the old claude exited.- The relaunch types into the shell only when
waitClaudeExitsaysprompt,goneorkilled. Custom prompts (oh-my-posh) never match the prompt regex, so it also polls the process tree. - A bare "Rate limit reached" (short 429) is not a usage limit.
- Verified live (2026-10-02 to 10-06, 2.1.289): a usage limit DOES fire
StopFailure. Its body has
error: "rate_limit"andlast_assistant_message, and noerror_type/error_details; the reset only comes from the transcript'squotaLimits. - A limit can end before its reset (the "reset limits" offer on claude.ai,
2026-10-06). So an exhaustion mark carries
at, andclearIfProvendrops it when a main-thread turn that STARTED afteratends with Stop (noteTurnForAccount). A turn already streaming when another tab hit the limit proves nothing. - The claude.ai login session expires ("Login reached its time limit ·
Please run /login", StopFailure
error=authentication_failed, seen live 2026-11-05 on MAIN 2 after it sat unused for hours — the OAuth refresh in.credentials.jsoncannot beat it; only a browser /login does).index.cjshandleFailuremarks the account out for 24 h ("login expired") so ranking and auto-move stop sending tabs onto a dead login, andclaudefeed.attentionTextnames the fix; the first successful turn after the re-login clears the mark viaclearIfProven. Setup-token accounts never see this — and never get Remote Control either, which is why the phone account must be the/login. - "Move all here" (0.6.47,
accounts.switchAll+terms.jsdrainMoves): a machine-wide request{ to, at }in its OWN file,<dataRoot>/accounts-switch.json. A window on older main code rewrites accounts.json without keys it doesn't know and would erase it. Each tab hasaccountAt(when its account was chosen, saved in state.json); a request newer than that moves the tab. It is retired after 12 h, when its account runs out, and on a manual reorder. - A tab moves only on evidence seen by this window: a live
doneevent ANDtab.draft === false(nothing typed since the last Enter). Both are unknown after a reload, so a re-attached tab waits for its next turn. Do not infer "idle" from the feed or fromlastInputAt > doneAt: a prompt drafted WHILE the turn ran is older thandoneAt, and/exitpasted onto it gets submitted as "draft/exit". term.pastefiresonData, so our own pastes (sendToAgent: /exit, /rename, board replies) set theappWritingflag and don't count as typing.- Before typing
/exit,moveOneaskspty:claudeRunning. No claude under the shell = the user left it, so the shell may run anything: only the account file is written. The bulk path waits withnoKilland never kills a claude that didn't leave; the kill-on-timeout is for the limit switch only. - API endpoint accounts (0.6.49, z.ai GLM…): kind
endpoint, stored in their OWN<dataRoot>/accounts-endpoints.json, blobaccounts/<id>.endpoint.dpapi= the whole env asKEY=VALUElines. Windows on older main code then never see them: they rewrite accounts.json turning every non-login account into a token, which would have fed the env text in asCLAUDE_CODE_OAUTH_TOKEN. - Never decrypt or set endpoint env inside the pty wrapper. Microsoft
Defender flagged that
-EncodedCommandasExploit:Win32/Tikupomand blocked EVERY terminal from starting (2026-10-07; only the command lines were blocked, nothing was quarantined). Instead main decrypts (accounts.endpointEnv, one PowerShell spawn per account, cached) andaccounts:setTermwrites<instance>/accounts/<termId>.settings.json= hook settings +env. The wrapper only swaps--settingsfor that file (string logic). That file holds the key in plain text, like claude's own settings.json: it is deleted on account change,kill()(capture wsId BEFOREmetasis cleared), pty exit and main start. After any wrapper change, checkGet-MpThreatDetectiondoesn't grow during smoke. - A conversation never crosses families (
anthropic|endpoint:<host>).<dataRoot>/session-families.jsonkeeps each conversation's family; the first one wins. A new entry is judged by the transcript's first real assistantmodel(claude…= anthropic;<synthetic>error lines skipped) and, only with no replies yet, by the family the tab had when its account was SET (termFamily, never recomputed: a removed account would read as anthropic). Renderer:tab.family= the conversation's family. Every move/resume compares with it, and restore/unpark with no account of that family left opens a plain tab (or keeps it parked), never another family.setTermAccountthrows instead of falling back to login, and then nothing is typed. - Verified live 2026-10-07 against z.ai (claude 2.1.29x, throwaway
VIBESPACE_HOME,
claude -p … --settings <tab settings file>): theenvblock in a--settingsfile authenticates and routes claude to the endpoint. Modelglm-5.3[1m]answered, the transcript's assistantmodelisglm-5.3[1m](sotranscriptModelsees it), and--resumeon the same endpoint keeps the conversation.familyForNewSessionmatches that model against endpoint accounts' models (the[1m]suffix is ignored) when the tab's family can't tell. - Adding accounts is preset-first (0.6.50):
accounts.PRESETS(today:zai, base URL + timeout + GLM model names + 1M auto-compact window, from the owner's working config) +addPreset(id, label, key, { models })share the endpoint store path withaddEndpoint. Users never see env variables unless they pick "Other compatible API". When z.ai renames its models, update the preset (existing accounts keep theirs; Advanced overrides them). - The login counts as available when
.credentials.jsonexists (also underCLAUDE_CONFIG_DIR), or withANTHROPIC_API_KEY, or with anoauthAccountin~/.claude.json. Only with none of them is it skipped (the z.ai-only PC). - The top-bar limit chip is per account (0.6.52,
limits.js): it renders fromaccounts.state()rows (limits+limitsAt, refreshed byaccounts:changed), login + token kinds only, plus the liveaccount:limitspush for the login account. One Claude account = the old unlabelled chip. The red border means NO Claude account has room left. A "—" = no agent ran on that account lately: its usage only arrives in claude's status line, for the account that process uses. Somain/usageprobe.cjs(2026-10-22, Windows) fills a "—" by running the REAL claude'sclaude -p /usage --no-session-persistence(token env cleared,CLAUDE_CONFIG_DIR= the cloud dir for token accounts; local command, no model call, ~3-17 s) and parsing its text (fromUsageText: "Current session: N% used · resets …", "Current week (all models): N% used · resets …", reset viaaccounts.parseResetin the machine's zone; no session line = 5h 0%). At most every 30 min per account machine-wide (<dataRoot>/usage-probe.json). VibeSpace never uses a login's token itself (2026-11-06): Anthropic's terms allow a subscription OAuth token only in Claude Code, and the first version sent the.credentials.jsonaccess token straight to/api/oauth/usage. Only the file's EXISTENCE is checked. Facts: a setup-token can't read usage (403 "scope requirement user:profile"), so a token account needs its cloud sign-in (cloud.configOf); claude renews its own expired access token during/usage. Results go to limits.json (/login, which accounts watches) oraccounts.setLimits. From Git Bash,claude -p "/usage"needsMSYS_NO_PATHCONV=1or the slash becomes a path and it becomes a real (billed) prompt. macOS: not yet. - Automatic order (0.6.53,
accounts.rankRowspure +ui/automove.jspure): Claude accounts ranked by has-room, then soonest WEEKLY reset (a passed reset is projected forward by 7 d and its % reads 0), unknown resets after known ones, manual order as tie-break; endpoints keep their slot. Room = usable, not exhausted, 5h and 7d < 95 %. The switch is its OWN file<dataRoot>/accounts-auto.json(default on; older main code would drop a key in accounts.json).state()returnsauto,ranked, per-rowroom/weeklyResetAt/blockedBy/roomAtandnextChangeAt; main re-pushesaccounts:changedwhen a reset passes (no file changes then). An auto move = the "Move all" evidence rules PLUS a cold prompt cache (expiresAt, or 1 h afterdoneAtwithout feed info), then a 30-min hold. While auto is on,switchAllis refused andstate().switchAllis null. Log:account auto:. - Claude's background agents keep the tab's
$VIBESPACE_TERM_ID(claude --bg-pty-host, owned by claude's daemon, parentless, can run for days on the account it started on). They post to the feed as the tab, soclaudefeed.fromBackgrounddrops events whosesession_idiskind: "bg"in~/.claude/sessions/<pid>.json(looked up only when the id differs from the tab's last accepted one). Symptoms before: the tab's session flipping between two ids intabs:lines, and a false "out" on the tab's account. Claude's daemon (claude daemon run) RESTARTS a killed background job within minutes: stop one withclaude stop <job id>(run in its repo), never taskkill. A background job is a--fork-sessioncopy, so the tab's own conversation is the older id; resuming the bg id is refused ("That session is running in the background"). - Restore/unpark onto a running background job (0.6.55):
sessions:background(claudefeedbackgroundSession, registry + live pid) is asked before a resume is typed; a bg conversation opens a plain tab that keeps the id, with an Attach note. A refusal that still gets printed is caught from the pty output (shellcmd.bgRefusal) for 60 s after a typed resume. - Text typed into PowerShell lives in
ui/shellcmd.js(pure): the worktree setup goes in as a single-quoted string dot-sourced through[scriptblock]::Create(never inline, never-EncodedCommand), so#, quotes and parse errors stay inside it. /exitcan take longer than 15 s. A gentle move waits up to 75 s, andtab.exitSentAtmarks our own/exit: an empty shell found later with nothing typed since is relaunched (launchOnAccount), never treated as "the user left claude". That shell line may not be empty: on 2026-11-23 a relaunch 30 min after the /exit typedbclaude --resume …(a stray "b" of unknown origin; it never counted as typing) and the agent stayed a dead shell for 3 days.launchOnAccountnow writesshellcmd.clearLineKeysfirst (Esc = PSReadLine RevertLine; Ctrl+E Ctrl+U on zsh/bash), waits 250 ms so ConPTY delivers a lone Esc and not Alt+c, then types. Tested on a real PowerShell pty with a stray "b": without the Esc the command never ran, with it it did./exiton a session with scheduled tasks or background work opens a confirm ("Background work is running / The following will stop when you exit: … 1. Exit and stop tasks 2. Move to background and exit 3. Stay"; seen 2026-10-29). A gentle move used to leave it on screen and retry every 30 min ("something constantly wants to close my agents"). NowwatchExit(shellcmd.exitBlocked) spots it in the pty output for 20 s, sends Esc (= Stay), andtab.exitBlocked.launch === tab.launchedAtkeeps that tab out of every move until its claude is started again (the tasks die with it anyway). The limit switch (non-gentle, kills after 15 s) is unchanged.- Claude repeats its last
rate_limitsreading on every statusLine tick until its next API response. Only a reading that just became full marks an account (becameFull), or an idle tab's stale 100 % re-marks it after a reset. - Cloud sessions use a cloud-only config dir per account (0.6.58,
main/cloud.cjs+ui/cloud.js+shellcmd.jsrealClaudeLine).claude --cloud/--teleportneed a real claude.ai login: a setup-token can't, andCLAUDE_CODE_OAUTH_TOKENoverrides a login. So a token account signs in once (claude's own login, browser OAuth) withCLAUDE_CONFIG_DIR=<dataRoot>/cloud/<accountId>, and ONLY cloud tabs ever set that variable. Normal agent tabs keep the one shared~/.claude(see theCLAUDE_CONFIG_DIRrule above). The /login account has no cloud dir: it reuses its normal config, so no second sign-in. Ready = that dir's.credentials.json, or anoauthAccountin its.claude.json(anANTHROPIC_API_KEYis not a claude.ai login). - Cloud tabs type the REAL claude (
Get-Command claude.exe, never the tab'sclaudefunction: it would add--settings,--remote-controland the tab's token) and start it with[Diagnostics.Process]::Starton a command line built bycrtQuote. Windows PowerShell 5.1's& exe 'arg'does not escape embedded", so a task with quotes would arrive split. For the call,CLAUDE_CODE_OAUTH_TOKEN,ANTHROPIC_API_KEY,ANTHROPIC_AUTH_TOKENandANTHROPIC_BASE_URLare cleared (a global z.ai env would otherwise send the login elsewhere) and restored in afinally, so the tab is a normal shell afterwards. - Cloud tabs are plain tabs (no
--settings, no feed, no tracking). A teleported conversation of a token account lives in its cloud dir'sprojects/, so normal tabs can't resume it; the /login account's lands in~/.claudelike any other. The session id/URL comes from the send tab's output (shellcmd.cloudSession, ids inside the echoed task are ignored) and goes to state.jsoncloud, kept by main's merge exactly likeparked. tablog logscloud +/-lines. Teleport needs a clean tree, the same repo and the same account:cloud:gitInfocounts changed TRACKED files (untracked ones don't block) and Bring back refuses first. - Verified live 2026-10-12 (claude 2.1.296, MAIN token account): the
cloud sign-in writes
.credentials.json+.claude.jsoninto<dataRoot>/cloud/<id>;claude --cloud "<task>"printsCreated cloud session: <title>/View: https://claude.ai/code/session_<id>?from=cli&m=0/Resume with: claude --teleport session_<id>and EXITS (~5 s), andcloudSessionparses that output as-is. Cloud work bills the account's cloud credit while it lasts, not its 5h/7d limits. claude --cloudneeds an interactive terminal ("--cloud requires an interactive terminal"): an agent's own tool shell can't run it. Agents start cloud sessions throughassets/ps/cloud-send.ps1(task in a file, repo path, account id), opened in a NEW console window (Start-Process pwsh -NoExit -File …), which is a real TTY. pwsh 7 passes the task as one argument (quotes intact). A HIDDEN window works too (-WindowStyle Hidden, no-NoExit: it closes itself); each run appendsexit=<code>to~/.vibespace/cloud/sent.log, exit 0 = created. Verified 2026-10-12 from inside an agent. The link itself isn't recorded locally; claude.ai/code lists it. A hidden launch can't answer claude's folder-trust prompt: in a repo the cloud config never trusted it hung forever, with no log line (found by the agent of another repo, 2026-10-12). So the script setsprojects["<repo with />"].hasTrustDialogAccepted = truein the cloud dir's.claude.jsonfirst, stops claude after 120 s (exit=timeout), and keeps claude's stderr of any non-0 run in~/.vibespace/cloud/logs/. It usesProcessStartInfo.ArgumentList(pwsh 7), so a long task with quotes is one argument.- An agent that needs a headless
claude -pon a TOKEN account WITH the claude.ai connectors (Google Sheets…) can borrow that account's cloud dir:CLAUDE_CONFIG_DIR=<dataRoot>/cloud/<accountId>withCLAUDE_CODE_OAUTH_TOKEN,ANTHROPIC_API_KEY,ANTHROPIC_AUTH_TOKENandANTHROPIC_BASE_URLunset for that call (answered for the agent of another repo, 2026-10-20). Decrypting the.dpapitoken instead gives a child with no connectors. That dir has its own settings/MCPs/transcripts.
- Extra Claude accounts are
- Keyboard selection in claude's prompt (0.6.39,
renderer/workspace/ui/inputsel.js, RESEARCH-INPUT-SELECTION.md). Claude has no keyboard-started selection, so Shift(+Ctrl)+←/→ and Shift+Home/End are turned into: a synthetic two-cell SGR mouse drag at the caret, written to the pty in ONE write, trimmed to one cell with Shift+←, then Claude's own Shift+←/→ extension, N presses for a word. Facts it stands on, all verified live on 2.1.289 and none documented: the terminal cursor sits on the caret; the prompt is the rows between two─border rows with text from col 2; a drag doesn't move the caret; press+release on one cell is a click (clears the selection, moves the caret), which is why a one-cell selection needs the trim; Esc does NOT clear a selection; Backspace and Delete remove it. Typing over a selection sends\x7ffirst, only when the selected cells really have a background colour. If selection breaks after a Claude update, re-check those facts first. Re-checked on 2.1.296 (2026-10-13): all facts hold, and Claude still has NO keyboard selection of its own (#80734): Shift+←/→/Home/End only move the caret, Shift+↑/↓ only extend an existing selection. Claude doesn't draw trailing spaces, so a caret past the drawn text counts those cells as typed spaces (else "word "- Shift+← fell through). Each selection start makes Claude copy that 1 char
to the clipboard (copyOnSelect on the synthetic drag, ~0.7-1 s later):
guardClipboardsaves the clipboard text and restores it only when the clipboard turns into exactly the dragged cells (trimmed), within 3 s; any other change is the user's own copy and is left alone (verified live). Testing gotchas: xterm's DOM renderer only updates on a frame, so in an occluded test window read the DOM AFTER a CDP screenshot; and a CDPcharevent has no keydown, so the custom key handler never sees it (usekeyDownwithtext).
- Shift+← fell through). Each selection start makes Claude copy that 1 char
to the clipboard (copyOnSelect on the synthetic drag, ~0.7-1 s later):
- Background state (0.6.45): a turn can END while work it started still
runs. Facts captured from claude 2.1.289:
Stop(andSubagentStop) carrybackground_tasks: [{ id, type: 'subagent' | 'shell', status: 'running', description, agent_type?, command? }].SubagentStop's list still includes the agent that is stopping.claudefeedkeeps the running ones infeed.background.- When a background task finishes, claude wakes ITSELF: a
UserPromptSubmitwhose prompt starts with<task-notification>, then a normal turn and Stop. - A subagent's tool events carry
agent_id; the main thread's don't.status.wordForHookignoresPreToolUsewithagent_id, or a background subagent turns a finished tab amber until the next Stop. After the turn ended those events go tofeed.bgNow, nevernowDoing. "Turn ended" is theturnOpenflag, not a timestamp comparison. - The state is DERIVED in the renderer: base
done+feed.backgroundnon-empty (feedui.bgTasks) → light classbg, stripst-bg, board percolumnOf. No new status word, so the status files / toasts / badge rule is untouched. attention.cjshands back the status from BEFORE the ask (before), so a background subagent's answered permission returns todone.- Test without spending tokens: capture hook bodies once (replace
claudefeed.onHookthrough the main inspector), then POST them to the running instance's feed port withx-vs-term: <a live termId>(scratchpad/replayhttp.mjs);reduceis pure, so a plain node replay works too.
- Tab auto-name (0.6.43,
terms.jsautoName+sessions.tabNameFor): a claude tab still matching/^agent-\d+$/withnamedunset takes the session's name. Claude writes{"type":"ai-title","aiTitle":…}to the transcript a few lines after the first message (never changed later, and re-appended as the file grows) and{"type":"custom-title"}on/rename; ours arrive as<workspace> · <tab>.tabNameFromprefers the custom name minus that prefix, unless it is itself a default name. Triggers: every status change, 4 s after the session id is found, 6 s after a tab opens with a session.namedis saved in state.json and restored by termId (restoredNamed); a manual rename sets'user'and locks the tab. Nothing renames while a rename input is open. Testing: a VibeSpace started from inside a Claude session inheritsCLAUDE_CODE_CHILD_SESSION, and claude then saves NO transcript ("Transcript saving is off"), so no title ever appears. Clear theCLAUDE*variables before launching the test instance. The throwaway home hasautoResume: false, which restores agent tabs as plain terminals: turn it on to test anything about restored conversations. - Keys: Ctrl+P file finder · Ctrl+F terminal search (active tab) · Ctrl+Shift+U
jump-to-attention · Ctrl+Shift+B agent board · Ctrl+Shift+D diagnostics.
Match letter shortcuts with
common.jskeyLetter(e), nevere.key.toLowerCase(): on a Bulgarian/Russian/Greek layoute.keyis the layout's own letter (the V key gives "м"), so Ctrl+V/C and every shortcut silently fell through to the pty (2026-10-26: "Ctrl+V doesn't work on BG").keyLetterkeeps a Latine.key, else usese.code. - Git (0.6.14, sidebar since 0.6.15):
main/githistory.cjs(log/commit/fileAt/branch, read-only) +renderer/workspace/ui/history.js. The lists live in the LEFT pane (#side-tabsFiles|Git →#git-side);diff.jsdrives both modes and owns the one DiffEditor in the preview's pinned Diff tab (#diff-host). Tree listeners hang on#tree, not#tree-pane(the pane also holds the Git view). Gotchas:- Every read-only git spawn needs
GIT_OPTIONAL_LOCKS=0, or our polling makes agents' commits fail on index.lock. U.jailed(root, p)is strictly-INSIDE: it rejectsrootitself. An IPC that takes the repo root must compare for equality instead. This kept the Changes tab dead from 0.6.0 until 0.6.14.- Absolute-positioned placeholders must live inside the box they cover
(
#git-main). A host-wide overlay silently ate the list's clicks, and CDPel.click()tests never notice. Verify with realInput.dispatchMouseEvent. document.hiddenis true for OCCLUDED windows too, not just minimized ones. Pollers that skip when hidden must still run once on start and onvisibilitychange.
- Every read-only git spawn needs
- What the file tree hides (2026-11-28,
util.cjs):fs:listand the tree watcher useTREE_HIDDEN_NAMES/isWatchIgnored(caches only); output names (OUTPUT_NAMES: out, dist, build, coverage, target, test-results, playwright-report) are listed dimmed (entry.output) and watched. Ctrl+P, Search, logoscan and gitdiff keep the fullIGNORED_NAMES. A repo'sout/of agent deliverables was invisible before ("I see it in Explorer"). A watcher event with no filename (Windows buffer overflow) refreshes instead of being dropped. The window's focus event also rebuilds the tree. - The file tree rebuilds off-screen (0.6.44,
tree.jsbuildDom).addDirNodeis async (onefsListper open folder), so "clear#tree, fill it, restorescrollTop" restored the scroll on an EMPTY box and the view jumped to the top on everytree:changed. Build into a detached element,awaitit, thenreplaceChildrenand setscrollTop(read at the swap). One build at a time (building); a change or a folder click during it setsstaleand triggers one more. General rule: never restore a scroll position before the content that makes it scrollable exists. Rows built off-document are invisible todocument.querySelector, so the git colours and the active row are applied after the swap. - Terminal widths must match Claude's. Every xterm loads
@xterm/addon-unicode11and setsunicode.activeVersion = '11'. The default Unicode 6 table counts emoji as 1 cell; Claude and ConPTY count 2, and the mismatch shows up as "mixed-up characters" after any emoji (0.6.34). Test emoji output with node, notWrite-Host: Windows PowerShell 5.1 drops emoji from its own output. More suspects (in-box ConPTY strips DEC 2026 sync output;useConptyDllpasses it through) are in RESEARCH-TERMINAL-GARBLE.md. - Never
git worktree remove --forcea worktree that has anode_modulesjunction (2026-10-08). Git follows the junction and deletes the MAIN repo'snode_modulesfile by file until it hits a DLL a running window holds (sharp's), then fails with "Invalid argument". Every new VibeSpace launch then died with "Could not load the sharp module". Unlink every reparse point first ([IO.Directory]::Delete(path), non-recursive), then remove the folder. To repair a half-deletednode_moduleswhile windows run, don't usenpm install: it tries to replace electron and fails EBUSY. Diffpackage-lock.jsonagainst the disk,npm packeach missing name@version and extract it in place (Git Bashtarneeds--force-localforC:paths). - Search tab (0.6.52,
main/textsearch.cjs+ui/search.js):git grepin the SENDER window's repo,GIT_OPTIONAL_LOCKS=0,:!.claude/worktrees, results capped and sorted by path (git grep's file order varies). - Background fetch (0.6.52,
main/gitfetch.cjs):--no-tags --prune --no-write-fetch-head, no prompts (GIT_TERMINAL_PROMPT=0, empty askpass,ssh -o BatchMode=yesonly when the user set no ssh command), skips onindex.lock/ merge / rebase. On timeout it kills the whole TREE: killing only thegitwrapper left the real fetch running. - ⬇ Update pill (0.7.3,
main/gitpull.cjs+ui/gitupdate.js): the ONE git write VibeSpace does itself, and onlymerge --ff-only @{upstream}after a fresh fetch. The preflight comparesdiff --name-only HEAD @{upstream}withstatus --untracked-files=alland refuses with the file list (nothing changed) on any overlap, on ahead>0, on index.lock or an open merge/rebase. Don't parse git's refusal text: it is translated on some machines. Refusals go to a NEW agent (terms.newAgentWithTask, the task is claude's first argument; on Windows it sits inside"…", so",$, backticks and line breaks are stripped).b.fetch.auth(gitpull.isAuthError) turns the pill into "Can't check for updates": GitHub Desktop keeps its sign-in to itself, so command-line git in a repo it cloned often can't fetch a private repo. - Worktree tabs (0.6.36,
main/worktrees.cjs): ▾ → New agent in a worktree makes<repo>\.claude\worktrees\<name>onvs/<name>with a plaingit worktree add. Never useclaude -w: it moves the transcript between project dirs on/exit(a hard kill strands it) and its cleanup half-fails on Windows. The base branch is kept in git configbranch.vs/<name>.vibespacebase(deleted with the branch)..claude/worktrees/goes into<git-common-dir>/info/exclude, never.gitignore, or the main tree's status shows every worktree as untracked. Removal retries because the closed tab's shell can still hold the folder for a moment; a half-removed one is pruned and its empty folder deleted.branch -djudges "merged" against the main tree's CURRENT branch, so after our own ahead=0 check we fall back to-D. The wt:* IPC takes the repo from the sender's window, never from the renderer. The loss check fails CLOSED (0.6.37): agit statusorrev-listthat fails, or a base branch that's gone, givesnull, andlossTextreports it as a loss. So "can't tell" keeps the worktree. Before the fix, a failed count read as 0 = "nothing unmerged", and closing the tab would have deleted unmerged commits..claude/worktreesis hidden from the tree, Ctrl+P and the tree watcher (U.isAgentWorktrees); each worktree is a full checkout. - Parked agents + the one "+ ▾" menu (0.6.38,
renderer/workspace/ui/parked.js):- Tab right-click → Park STOPS the agent (pty killed like tab-close) and keeps
{ name, cwd, claudeSessionId, worktree, account, parkedAt, lastMessage, model }in state.jsonparked. Disabled until the transcript exists (sessions:checkwith the tab's cwd). Confirm only while working/waiting. - The entry is persisted FIRST (
persistNow, awaited), then the pty dies. Restore skips any saved tab whose session is also parked, so a crash in between can't bring it back twice. - Parked entries are NEVER auto-resumed; an all-parked workspace opens with
no fresh agent-1. Unpark =
createTab({ resumeId })with the restore's dead-session and worktree-gone fallbacks; name clash →-2. - A parked worktree agent keeps its worktree: no auto-remove on park, and
afterWorktreeTabClosedskips worktrees a parked entry owns. Kept worktrees lists it as "🅿 parked as<name>" (click = unpark), not as an orphan. Forget (✕, no confirm) drops only the shelf entry. - Main keeps
parkedthrough its merge (sessions.enrichState); a snapshot without the key keeps the previous list. tablog logsparked/unparked/forgotlines and lists parked in the open snapshot. - Toolbar:
[+ Claude][▾]+▦ Boardonly. The caret and right-click on- Claude open the same menu.
showMenuitems takesection,meta,card()(hover card,common.js showCard) andaction(row ✕).
- Claude open the same menu.
- Tab right-click → Park STOPS the agent (pty killed like tab-close) and keeps
- Logo picker (0.6.40,
main/logoscan.cjs+renderer/workspace/ui/logopick.js): clicking the top-left logo lists the repo's images, best guess first, with Browse… (dialog:pickLogo,defaultPath= the sender's repo). The scan is breadth-first and bounded (depth 7, 4000 folders, 1.5 s, files ≤ 2 MB), so a budget that runs out only misses deep folders. It skipsU.IGNORED_NAMES, every dot-folder except.github, and agent worktrees. Thumbnails are 96 px PNG data URLs made by sharp, 6 at a time (one by one took 3.4 s on a real project repo);.icogoes through as-is because sharp can't read it. An image sharp can't read is dropped: it couldn't become the icon either. To check a native file dialog's folder in a test, read theAddress: …pane of the#32770child window through UI Automation, then close it with WindowPattern. - Never use
window.confirm/alert/promptin a workspace window. On Windows Electron the window gets no real focus back after the native box closes. Keydown still fires, but keypress/beforeinput don't until the window is re-focused, so Space dies in xterm while letters keep working. UseconfirmBox()fromcommon.js(found via keydiag, 2026-09-29). The launcher imports it from there too (0.6.52), socommon.jsmust stay free of workspace-only imports. Testing an isolated launcher while the real one runs needs--user-data-dir=<throwaway>: redirectingAPPDATAdoesn't move Electron's userData, and the single-instance lock makes it quit at once. - Notification prefs (0.6.25):
main/notifyprefs.cjs, machine-wide<dataRoot>/notify.json, re-read on mtime change because every workspace is its own process.notifyAttentionasksshouldToast(st)for the TOAST only. The taskbar badge and tab lights never depend on it. A new attention kind needs a default there plus a switch row in the prefs modal. - Tab/session audit trail: grep the instance log for
tabs:. It logs the open snapshot, per-change lines and "untracked … would NOT resume" warnings (main/tablog.cjs, fed frompersistState). Check it first when a restart "lost" a conversation. It is also the REPAIR source. If a state.json is damaged and has no.bak(all-NUL after the 2026-10-01 reboot: four workspaces), take the lasttabs:open/+ lines for that workspace (read the log withgrep -a, since the log tail can hold NULs too). Then, WHILE ITS WINDOW IS CLOSED (an open window overwrites the file), write{terminals:[{termId,name,cwd,isClaude,claudeSessionId}],autoResume:true}withU.writeJsonAtomic, keeping the broken file as.corrupt-<ts>. The layout isn't logged, so it falls back to the default. - macOS (0.7.0, RESEARCH-MAC.md has the audit + sources). Facts the port
stands on, verified on GitHub's macOS runners (macos-15 arm64 + macos-15-intel):
- PATH: a Dock/Finder-launched app gets
/usr/bin:/binonly.util.rebuildPathasks$SHELL -ilconce (3 s timeout) between markers and merges fallbacks (~/.local/bin,/opt/homebrew/bin, …); it is never empty. Env keys are case-sensitive: writePATH, neverPath. - The shell: the user's zsh or bash as a login shell. zsh gets
ZDOTDIR=<dataRoot>/shell/<content hash>/whose rc files source the user's own and then defineclaude(); bash gets--rcfile. Theclaude()text is ONE POSIX body for both, and prints the sameVSACCT[…]/VSCLAUDE[…]dry-run lines as the PowerShell wrapper (smoke checks them on both platforms).BASH_SILENCE_DEPRECATION_WARNING=1and a UTF-8LANGare set. - Prompt detection: precmd prints
ESC ] 7777 ; vibespace-prompt BEL. xterm.js ignores unknown OSC numbers (checked in 6.0.0), so it isn't stripped.ptyhost.atPrompt, with the process-tree poll as the fallback. - Process tree: one
ps -A -ww -o pid= -o ppid= -o pgid= -o args=snapshot (separate-os,argsbecause the native claude's exec name can be its version number), SIGTERM descendants + their process groups (never ours or a shell's), SIGKILL survivors after 1.5 s, THEN close the pty. gitfetch spawns git detached and kills the group. - Secrets: Keychain generic-password items through
/usr/bin/security(main/keychain.cjs):VibeSpace-account-<id>(raw token; theclaude()function reads exactly this name) andVibeSpace-endpoint-<id>(base64 env, read by main only), accountvibespace. Writes go throughsecurity -ion stdin, so a secret is never in any argv; a line max is 4095 bytes, so endpoint env must stay under ~2.9 KB. NotsafeStorage: its Keychain ACL is per code signature and would prompt for every future per-workspace.appclone. - Claude's login on a Mac is a Keychain item,
Claude Code-credentials(accountclaude-code-user), not.credentials.json. WithCLAUDE_CONFIG_DIRit is…-credentials-<first 8 hex of sha256(the exact dir string, NFC)>(read from claude 2.1.302's code). Existence checks are attribute-only (find-generic-passwordwithout-w) and cached. - Dock: every workspace process is its own Dock tile;
app.dock.setIcontakes a 1024 px PNG (<id>.v<stamp>.png; nativeImage can't read.ico). That icon can't be PINNED: a pin always points at VibeSpace.app. Per-repo pins need one generated.appclone per workspace (phase 2, the Chrome PWA pattern). Badge =app.dock.setBadge('•')+ one bounce. - Lifecycle: a workspace process quits when its window closes on every
platform (a windowless darwin process kept the single-instance lock and
the workspace could not be reopened); the Mac launcher stays in the Dock.
No
session-endon macOS: the final save happens onbefore-quitandpowerMonitorshutdown. - FSEvents can miss or delay a write right after
fs.watchstarts (the Intel runner missed a status file for >900 ms).status.cjsadds a 1.5 s mtime sweep on darwin; other watchers that drive state need the same idea. - node-pty 1.1.0 ships darwin prebuilds with
spawn-helperas mode 0644 ("posix_spawnp failed" on every terminal):scripts/postinstall.cjs,build/afterPack.cjsand a runtimeensureSpawnHelperchmod it. - Packaging: electron-builder 26.15.3 no longer ad-hoc signs by itself:
mac.identity: "-"plus an explicitcodesign --force --deep -s -in afterPack; CI fails unlesscodesign -dvsaysSignature=adhoc,Identifier=app.vibespaceand sealed resources. One arch per runner (sharp installs only the host's native package). Electron 44 needs macOS 13+. - Smoke on the runner is the real thing: a headed window
(
VIBESPACE_SMOKE_SHOTsaves acapturePagescreenshot), login zsh, Keychain round trips. Windows-only tests are gated per area, and the tally reports how many passes were darwin skips. - Keys: app shortcuts are Cmd-only on a Mac (
modKey): Ctrl+P/F/B/U/D are readline and claude keys there. Ctrl+V must reach claude (its image paste on Mac).macOptionIsMetais on (watch for non-US layouts that type@/{with Option).
- PATH: a Dock/Finder-launched app gets
- Image/video/audio preview (0.7.0,
main/mediaserve.cjs+ui/mediaurl.js+viewer.jsmedia tabs):vsfile://ws/<wsId>/<encoded abs path>?v=<mtime>.protocol.handlegets no sender, so the URL names the workspace and main serves it only if that workspace's window lives in this process, with the repo from the registry. Jailed via realpath, media extensions only,no-store, streamed Range (206/416). CSP:img-src/media-srcallowvsfile:only; there is noconnect-src, so pagefetch()of it is blocked (the viewer doesn't fetch). An SVG opens as an image with a Source/Image toggle to Monaco. - Self-update of the installed app (0.7.1,
main/appupdate.cjs+ui/appupdate.js):- Packaged builds only.
VIBESPACE_UPDATE_FEED+VIBESPACE_UPDATE_FORCE=1let an unpackaged run test it, with the install as a dry run. - Check: reads the WHOLE releases list (v0.7.0 was published
latest=falseso the Windows guide's "latest" still finds an .exe). Picks the highest semver with an asset for this platform/arch: Mac zip first, then dmg, then the NSIS exe. - Once per machine: a lock file, 30 s after start, then every 6 h, with
ETag. The result goes to
<dataRoot>/app-update.json, which every window reads. - Verify: against the API's
digest(sha256:…); size only, logged, when there is none. - Mac install: a detached
/bin/shscript waits for the bundle's processes (exact path match, neverpgrep -f: it reads paths as patterns), moves the old bundle aside,dittos the new one in, removes quarantine, restores the old one on failure, relaunches. - Windows install: a
-FilePowerShell script (never-EncodedCommand: Defender) runs the installer/S /currentuser /D=<dir>, falling back to a normal run. - Quit and reopen: the clicking window records the open workspaces; the other processes see the request within 3 s and quit normally; the new launcher reopens them.
- CI: smoke runs an END-TO-END swap of a fake signed
.app(feed → zip → verify → script → new version, no.old-*left) on the Mac runners. Its dmg step can flake on the Intel runner ("hdiutil: attach failed - Resource temporarily unavailable", 2026-10-22):gh run rerun <id> --failedpassed; a real dmg bug fails on both arches. - Not verified on a real install yet: the 160 MB swap in /Applications; whether TCC re-asks for Documents/Desktop access after each ad-hoc update (likely); the Windows per-machine/UAC case.
- Releases: only when the owner says "release"; upload the CI zips as well as the dmgs (the updater prefers zips).
- Running smoke from an agent's Bash: there is no
node_modules\.bin\electron.cmdhere; startnode_modules\electron\dist\electron.exe . --smokethroughStart-Process cmd /cwith System32 first on PATH and output redirected to a file. The Mac workflow only runs on pushes tomain/mac-port; for a branch,gh workflow run mac.yml --ref <branch>. Patch scripts: don't put backslash escapes (NUL, CR, LF) inside a Python heredoc: they landed as real NUL bytes and CRLFs in smoke.cjs (and once in this file), turning the diff into a whole-file rewrite; write such scripts with the Write tool, and diff--statbefore committing. - Testing tip (2026-10-19):
--remote-debugging-portopened no port under Electron 44.4.5; drive test windows through each process's main-process inspector (--inspect=<port>,webContents.debugger), which still sends real CDP input events. Pick inspector ports outside Windows' reserved range (9281–9380 here: 9341 failed; 12341 works). A test that writes the clipboard must restore it (it emptied the owner's once; a native Menu.popup can't be screenshotted, so wrapMenu.prototype.popupto record it). Better: don't touch the real clipboard at all. Stub the IPC for the test (ipcMain.removeHandler('util:readClipboard')+ a handler returning the marker, original back infinally). A save/restore throughreadTextfailed on 2026-10-26 ("conversion failure"; history off) and lost the owner's clipboard again. Pasted text lands in the ACTIVE tab: checkptyhost.list()buffers, not the first.xterm-rows.
- Packaged builds only.
- z.ai tabs and claude's
/model(0.7.1, verified on claude 2.1.303 with a throwawayCLAUDE_CONFIG_DIR):- Every
/modelpick savesmodelto the GLOBAL~/.claude/settings.json. "Your pick becomes the default for new sessions"; only pressingsin the picker means this session only. - Nothing in claude prevents it:
--model,ANTHROPIC_MODELand amodelkey in the--settingsfile don't. Themodelkey is worse: picking "Default" then DELETES the global value. - So
main/modelguard.cjsundoes a global change caused by an endpoint tab: that tab's switch (a PostModelSwitch hook, endpoint tabs only, or its feed model), or a saved value equal to that tab's exact GLM id (picker rows use exact ids, which no Claude tab ever saves). - The guard stays out if a Claude tab switched at the same moment, and on
machines with no Claude account (a z.ai-only PC keeps its pick as the
default). It rewrites only the
modelmember and logsmodel guard:. Known gap: "Default" picked while already on that model deletes the key with no switch signal. - Clean picker: claude's
modelPickersetting (replaceBuiltInOptions) works from a--settingsfile, plusANTHROPIC_DEFAULT_*_MODEL_NAME/_DESCRIPTION, built at tab-settings-write time, so existing accounts get it.availableModelswasn't needed.ANTHROPIC_DEFAULT_FABLE_MODEL= the endpoint's opus model. - Effort: GLM-5.3 and Flash always think and know only low/high/max.
z.ai maps whatever claude sends (thinking off → low, medium → high, xhigh
→ max, unknown → max; docs.z.ai). claude's
_SUPPORTED_CAPABILITIESis read only for Bedrock/Vertex/Foundry/Mantle, so the /effort slider keeps all five levels. Harmless.
- Every
/sync-docsskill (.claude/skills/sync-docs): the "update all docs" ritual — CHANGELOG/DECISIONS/CLAUDE/TODO/README + agent memory, docs only. Copy the skill folder into any repo that should join the ritual. (A 📨 broadcast button existed briefly in 0.6.0 and was removed in 0.6.6 — the owner wanted a rule, not a button.)- New Claude Code version → the same ↻ Restart (0.6.32; the separate ⟳
"Update & Restart All" button, its modal and the
claude updaterun were removed). Claude auto-updates on disk by itself. When the disk version ≠ the window's baseline (main/index.cjsclaudeBaselines),updater:statelights ↻ with "Restart · Claude<v>", and the app restart starts every agent on the new binary. Restart (both entry points,restartWorkspacein app.js) skips the confirm whenpty:busynames nobody. Claude redraws when the mouse merely moves over it (fullscreen TUI, any-motion tracking?1003, ~1 ms after the move; measured 2026-10-22). A resumed idle claude has no status until its first hook, so the old "output in the last 5 s" rule named it busy on the way to the button. Status-less tabs now useptyhost.ownOutputAge(output within 1.5 s of an input is a reaction, not work); 'working' tabs still use any output, so a real turn always counts. - ↻ Restart VibeSpace button is conditional too (0.5.2): main/srcstate.cjs fingerprints main/preload/renderer at window OPEN (the code that window runs) and re-probes every 30 s; a mismatch shows the button. Baseline must be captured at window open — capturing at first interval instead would swallow changes made during boot (found the hard way in testing). Dev runs only.
- Packaging (0.5.0):
npm run dist(NSIS) /dist:dir(unpacked). KeepnpmRebuild: false— winpty's gyp fails without a full VS toolchain; the installed node-pty prebuilds are copied instead. Always packaged-smoke before shipping. Note: packaged reads come from app.asar (fine), but child processes need real dirs — useU.BIN_ROOT, neverU.ROOT, as a cwd. - JSON files are crash-safe (0.6.30,
util.cjswriteJsonAtomic/readJson): fsync the tmp file before the rename, keep the last GOOD copy as.bak, and restore an unreadable file from it (the damaged one is kept as.corrupt-<ts>, reported viaU.onCorruptJson→json:log line). Never write JSON with plainwriteFileSync, and never let a parse failure fall back to defaults silently. A reboot did exactly that to state.json. On Windowssession-endand onbefore-quit, main saves one last time and then setsstateFrozen, so pty exits during shutdown can't save as "tabs closed". Test it via the main inspector (--inspect=9230,app.emit('session-end')). - State:
~/.vibespace/instances/<id>/state.json— renderer pushes debounced snapshots; main enriches terminal entries with tracked session ids every flush and on close. Renderer state and main-side enrichment are deliberately merged main-side — keep that.
Conventions
- Main/preload: CommonJS (
.cjs). Renderer: dependency-free ES modules, no bundler, served viaapp://local/…(vendor/maps tonode_modules/,icons/to~/.vibespace/icons/). Monaco loads through its AMD loader; TS/JSON validation is disabled so it needs no workers. - UI text and comments in English; UI is dark-theme by default (
style.cssvars). - Update CHANGELOG.md (new version section) and TODO.md for anything user-visible.
- Keep the launcher renderer dumb — workspace-window features belong in
renderer/workspace/. - Windows and macOS (since 0.7.0; Linux is not a target). Mac code sits behind
process.platform === 'darwin'(main) /vs.platform(renderer, from the preloads;common.jsisMac/modKey/osText). Windows branches stay as they were: never "simplify" a Windows path while adding a Mac one.
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.

