agentleFS
elirantutiaelirantutia/vibeyard/CLAUDE.md

vibeyard

CLAUDE.md1.4k starsChanged 6 months agoMITView on GitHub

A terminal-centric IDE desktop app built on Electron that wraps CLI tool sessions. Users manage projects and sessions, each backed by a PTY running a CLI tool (currently Claude Code, with an abstraction layer for future providers like Copilot CLI and Gemini CLI), rendered via xterm.js. No hot reload — changes require rebuild + app restart. Requires Node v24 (see .nvmrc). No lint tooling is configured. Cross-platform: builds and runs on macOS, Linux, and Windows. Release artifacts (via electron-builder) include…

  • Reads credentials

Trending

Quiet since September.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 6 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 2 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the elirantutia/vibeyard repository that our weekly crawl found: only 8 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about elirantutia/vibeyard

The biggest 5 of 8 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 8

Talked about on GitHub, Hacker News and Bluesky (8 times).

On GitHub · 6

1 more on GitHub

The file

We split this CLAUDE.md into the rules it gives an agent

10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No hot reload — changes require rebuild + app restart.

    line 16
  2. Very specific:

    Test files are excluded from production builds via exclude in tsconfig.main.json and tsconfig.renderer.json.

    line 32
  3. Very specific:

    When asserting on a path that the implementation produced via path.join, path.resolve, or path.normalize, never hardcode forward-slash …

    line 101
  4. Very specific:

    When working on renderer/UI code, the /ui-dev skill is automatically invoked.

    line 132
  5. Distinctive:

    After completing an implementation task, always:

    line 140
  6. Very specific:

    Run /code-review to review changed code for correctness bugs and reuse/quality/efficiency cleanups.

    line 142
  7. Very specific:

    Run /simplify to apply reuse, simplification, efficiency, and altitude cleanups to the changed code.

    line 143
  8. Distinctive:

    Add or update tests as needed to cover the changes.

    line 144
  9. Very specific:

    Always use the /commit command when committing changes to this project.

    line 148
  10. Distinctive:

    Never commit, push, or create pull requests unless the user explicitly asks for it.

    line 150

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What This Is

A terminal-centric IDE desktop app built on Electron that wraps CLI tool sessions. Users manage projects and sessions, each backed by a PTY running a CLI tool (currently Claude Code, with an abstraction layer for future providers like Copilot CLI and Gemini CLI), rendered via xterm.js.

Build & Run

npm run build    # Compile all three targets (main, preload, renderer) + copy assets
npm start        # Build then launch Electron app (alias: npm run dev)

No hot reload — changes require rebuild + app restart.

Requires Node v24 (see .nvmrc). No lint tooling is configured.

Cross-platform: builds and runs on macOS, Linux, and Windows. Release artifacts (via electron-builder) include .dmg/.zip (mac), .deb/.AppImage (linux), and NSIS installer + portable .exe (win). CI covers all three platforms.

Testing

npm test             # Run all tests once
npm run test:watch   # Watch mode (re-runs on file changes)
npm run test:coverage # Run with coverage report (terminal + HTML)

Uses Vitest with v8 coverage. Tests are co-located with source files as *.test.ts. Coverage HTML report outputs to coverage/index.html.

Test files are excluded from production builds via exclude in tsconfig.main.json and tsconfig.renderer.json.

Three renderer modules (session-cost.ts, session-activity.ts, session-context.ts) expose _resetForTesting() to clear module-level state between tests. Main process tests mock fs, child_process, node-pty, and os via vi.mock().

Architecture

Three-process Electron architecture with strict context isolation:

  • Main process (src/main/) — Node.js side: window creation, PTY lifecycle via node-pty, filesystem access, persistent state (~/.vibeyard/state.json). IPC handlers in ipc-handlers.ts dispatch to pty-manager.ts and store.ts. CLI tool behavior is abstracted via the provider system (src/main/providers/).
  • Preload (src/preload/preload.ts) — Secure bridge exposing window.vibeyard API via contextBridge with namespaces: pty, session, store, profiles, fs, provider, menu.
  • Renderer (src/renderer/) — Vanilla TypeScript DOM UI (no framework). AppState singleton in state.ts uses an event emitter pattern; components in components/ subscribe to state changes.

Data Flow

Renderer → IPC invoke/send → Main process → PTY/filesystem → IPC send back → Renderer updates xterm terminal.

Build Targets

Each process has its own tsconfig.*.json. Main and preload compile via tsc (CommonJS). Renderer bundles via esbuild (IIFE format, browser platform, with sourcemaps).

CLI Provider System

CLI-specific behavior is encapsulated behind a CliProvider interface (src/main/providers/provider.ts). Each provider handles binary resolution, env vars, args, hooks, config reading, and cleanup. Providers are registered in a registry (src/main/providers/registry.ts) at app startup.

  • Provider per-session: Each SessionRecord has a providerId (defaults to 'claude'). A project can contain sessions from multiple providers.
  • Capabilities pattern: Providers declare what they support via CliProviderCapabilities. UI can conditionally enable features per-session.
  • Current providers: ClaudeProvider (src/main/providers/claude-provider.ts) — extracts all Claude-specific logic from pty-manager.ts, prerequisites.ts, claude-cli.ts, and hook-status.ts.
  • System prompt: buildArgs accepts systemPrompt?: string and every provider must honor it (used by the Team feature). Claude maps it to --append-system-prompt; Codex to -c developer_instructions=<value>; Copilot/Gemini to --system-prompt. The renderer passes it via the transient pendingSystemPrompt field on SessionRecord, which is consumed once on the first PTY spawn and stripped from state.json so it is never re-injected on resume.
  • Profiles (multi-license): a Profile ({ id, name, providerId, configDir, managed }, top-level state.profiles) backs a CLI session with an isolated config directory so a user can run separate logins/licenses (work vs personal). buildEnv(sessionId, baseEnv, opts?: { configDir? }) injects it — Claude sets CLAUDE_CONFIG_DIR (which relocates everything Claude reads/writes: credentials, settings.json, hooks, status line, transcripts, agents); other providers accept the param but don't use it yet. The effective profile (explicit choice > project defaultProfileId > preferences.defaultProfileId, provider-matched) is resolved once at session creation via resolveProfile (src/renderer/state/specialized-sessions.ts) and pinned onto SessionRecord.profileId — it is NOT re-derived at spawn, so changing a default later never redirects an existing session's resume. At spawn, split-layout.ts looks up the config dir from the sticky session.profileId only (provider-checked) and threads the configDir string through createTerminalPane → pty.create → pty:create → spawnPty → buildEnv. profileId is persisted on SessionRecord/ArchivedSession (and on TranscriptDescriptor/DeepSearchResult so global-search resume reopens under the right dir); removeProfile clears it from sessions, projects, history, and prefs. Because CLAUDE_CONFIG_DIR relocates settings.json, spawnPty installs Vibeyard's hooks + status line into the profile dir on each Claude spawn via the config-dir-parameterized installHooksOnly(configDir) / installStatusLine(configDir) in claude-cli.ts (the status-line script stays global in ~/.vibeyard/run/; only per-dir settings.json differs). getTranscriptPath(cliSessionId, projectPath, configDir?) and discoverTranscripts() are profile-aware — the latter unions ~/.claude/projects with every claude profile's <configDir>/projects (read from loadState()). Managed profile dirs live at ~/.vibeyard/profiles/<id>/ (auto-created), with an optional custom path; provisioning is src/main/profiles.ts exposed via the profiles:provision IPC. Profile management UI is the Preferences "Profiles" section; selection is in the New Session dialog and the sidebar project "Project Settings…" menu. v1 leaves getConfig (Overview agents/skills/MCP) and the config-watcher on the default ~/.claude. macOS keychain caveat + guardrail: on macOS Claude stores credentials in the system Keychain (not <configDir>/.credentials.json) under a per-config-dir service name Claude Code-credentials-<first 8 hex of sha256(configDir)> (verified on 2.1.159), so profiles isolate logins only on Claude builds new enough to namespace that entry. Older builds (≤2.1.19, anthropics/claude-code#20553) reuse one shared Claude Code-credentials entry, bleeding logins across profiles. src/main/claude-keychain.ts (getKeychainIsolationStatus, exposed via IPC profiles:keychainStatus → window.vibeyard.profiles.keychainStatus()) guards this: empirically supported if any known profile already has a namespaced Keychain entry, else version-gated (≤2.1.19 ⇒ unsupported; newer-but-unconfirmed ⇒ unknown, allowed — never false-blocked); non-macOS is always supported (isolation is file-based). On unsupported, spawnPty skips the profile session and writes an in-pane message (it does not throw — the renderer fires pty.create un-awaited), and the Preferences "Profiles" section blocks profile creation and shows a warning banner. The shared semver helpers (parseSemver, semverGte) live in claude-hook-versions.ts.
  • Agent files: providers expose optional agentsDir(), installAgent(slug, content), and removeAgent(slug) methods (default impls delegate to src/main/providers/agent-files.ts, which accepts an optional extension — Copilot passes .agent.md; everyone else uses the default .md). Each provider's user-global agents directory is ~/.<cli>/agents/ (e.g. ~/.claude/agents/). The Team feature uses these via the provider:installAgent / provider:removeAgent IPC channels to mirror a TeamMember (with installAsAgent: true) as a <slug>.md (or <slug>.agent.md for Copilot) file across every installed provider, making it invokable as /<slug> inside CLI sessions. Slug is sticky on the member (agentSlug field) so renames preserve the same file. Filename collisions with non-Vibeyard agents at the same slug will overwrite — the renderer only deduplicates within team members.

Key Components

  • terminal-pane.ts — xterm.js wrapper per session, handles PTY data streaming and WebGL rendering with software fallback
  • state.ts — Reactive AppState singleton; debounced persistence (300ms) to ~/.vibeyard/state.json
  • split-layout.ts — Manages tab mode (single terminal) vs split mode (side-by-side)
  • Renders must not touch pane DOM they don't need to. renderLayout() runs on every session-changed/layout-changed, and appendChild on a node that is already a child is a remove-and-reinsert: it blurs whatever is focused inside (the Cmd+F find bar is appended into .terminal-pane, see search-bar.ts) and collapses an in-progress selection. So every attach*ToContainer no-ops when element.parentElement === container; DOM order among the panes laid out together is corrected separately by ensurePaneOrder (split-layout) via the DOM-free isInRelativeOrder in components/pane-order.ts — relative order, because hidden panes stay in the container interleaved with the visible ones — and renderSwarmMode reuses its .swarm-grid-wrapper instead of rebuilding it. Focus is guarded one level up, not by sniffing the DOM: setFocused cannot tell the find bar from the terminal (it is inside the pane), so focusPane gates the call on the DOM-free shouldFocusPane (components/pane-focus.ts) — a render that does not change the focused pane never calls setFocused at all, unless focus is sitting on nothing. fitTerminal skips pty.resize when the colsxrows memo is unchanged (a redundant resize makes the CLI redraw under a selection, and xterm does clearSelection() on a row-count change); spawnTerminal clears that memo and re-fits after pty.create resolves, because a fit racing the un-awaited spawn is dropped by resizePty for a session it has not registered yet (Copilot awaits a hook install first) and the PTY would stay at the 120×30 spawn default. Feeding this loop, updateSessionCliId (state.ts) early-returns on an unchanged id and the statusLine's write_if_changed writes .sessionid/.name only on change — the statusLine fires on every render, and each write used to cost a persist plus a full re-render.
  • session-activity.ts — Tracks working/waiting/idle status with debounced transitions
  • Hook → session-state contract — see HOOKS.md for the full map; it is verified against a specific Claude Code version and must be re-checked against https://code.claude.com/docs/en/hooks whenever hook handling changes. Three points are load-bearing and easy to get wrong. (1) PostToolUse fires only on success; a tool that ran and failed fires PostToolUseFailure (error, is_interrupt, duration_ms), and a call rejected before execution fires neither. Treating any non-empty tool_response as a failure — which this repo did until the events were re-verified — feeds every successful tool call into missing-tool-detector.ts. (2) A Stop is not always a completion: the main agent fires one every time it pauses on parallel subagents. stop_status_writer.py resolves it from the payload's background_tasks array, holding working only for subagent/teammate/workflow entries; only a non-empty array is authoritative — an empty one is not proof of an idle session, because the CLI filters that array on an isBackgrounded flag freshly-dispatched subagents don't carry yet — so empty and absent both fall through to the legacy <sid>.subagents counter. session_crons is never consulted or a /loop session would never complete. (3) Every field name in INSPECTOR_FIELDS (claude-cli.ts) must exist in a documented per-event schema, and be read by something. A compile-time assertion against keyof InspectorEvent catches the internal half of that drift; the external half — whether Claude Code actually sends the field — no type system can check, and an invented name silently renders a blank timeline row forever (how config_key/question/answer survived for months). Beware nested keys when reading the docs: the Elicitation example's requested_schema.properties.username.type scans like top-level type/username fields, and both were added on a previous pass and were dead on arrival. Generated Python embeds values via pyLiteral (shared/python.ts), never a raw r'…' literal, which breaks on an apostrophe in the path.
  • session-cost.ts — Structured cost tracking via Claude CLI status line (statusLine setting), with regex fallback for older CLI versions. Provides per-session and aggregate cost data (USD, tokens, cache, duration). Both this module and session-context.ts feed the terminal pane's status rail (right cluster = profile · model · $cost | in/out, left cluster = the context meter) off the same session:costData payload — Claude's statusLine writes {cost, context_window, model} into one <sid>.cost file; there is no .context file. Two things make the rail fragile on restore, and both are load-bearing. (1) setCostData/setContextData dedupe on unchanged values (the statusLine rewrites .cost on every render, and each event costs a persist + re-render), and restoreCost/restoreContext seed those maps silently from the persisted SessionRecord.cost/.contextWindow at load. A resumed session reports exactly the context that was persisted at quit, so the first post-resume payload is deduped away and onContextChange never fires — cost only self-heals because its dedupe set includes the ticking totalDurationMs. (2) The rail's left cluster is built lazily inside updateContextDisplay and hidden by CSS .context-indicator:empty, so "no event" renders as "no meter", not as a stale one. createTerminalPane therefore pulls both clusters from getCost/getContext right after instances.set — the general invariant being that a store with a silent restore* seeder must be pulled by any consumer that builds its DOM lazily; a push-only consumer is correct only if its DOM provably predates every event. (Every other consumer of these two stores — board cards, the sessions widget, refreshProfileLabels — already pulls, so the pane rail was the lone exception.) The cost pull is unconditional so that updateCostDisplay stays the single renderer of .cost-display, painting the $0.0000 placeholder itself when cost is null; the pane constructor only toggles .hidden off the provider capabilities. ArchivedSession persists cost but no contextWindow, so resume-from-history still starts both empty
  • Session auto-naming — session-title.ts adopts the CLI's own session title as the tab name, so users don't have to rename manually. The title arrives as the session_name field of Claude's statusLine stdin payload (the custom name from --name / /rename when one exists, otherwise Claude's AI-generated topic title; the key is absent until the session has one). Hook payloads carry no title — verified against the 2.1.237 binary, whose base hook schema is {session_id, transcript_path, cwd, prompt_id, permission_mode, agent_id, agent_type, effort} — so the statusLine is the only live source. buildStatusLinePython in src/main/hook-status.ts builds one body used on every platform; installStatusLineScript writes it to ~/.vibeyard/run/statusline.py and the .sh/.cmd wrapper invokes it by path, never inlined into the shell command (see the hook-commands.ts module docstring for why inlining Python here is fragile). It writes <STATUS_DIR>/<sid>.name as {"name": "…", "session_id": "…"}, keyed on CLAUDE_IDE_SESSION_ID; the watcher forwards it as session:sessionName → applyCliSessionName, which skips sessions with userRenamed (a Vibeyard rename is sticky and always wins), drops a title whose session_id no longer matches session.cliSessionId (a stale .name survives /clear until the next render, and resyncAllSessions replays every file on window activate), and is gated on preferences.autoTitleEnabled. Three script details are load-bearing: it writes only on change (statusLine fires on every render, and each write costs a persist + full tab-bar re-render) — which is why flipping autoTitleEnabled back on sends session:resyncStatus to replay every status file, since an unchanged .name produces no further fs event and app.on('activate') is effectively macOS-only; it uses json.dumps so a CJK/emoji title is ASCII on disk (a raw write hits Windows' locale codepage, raises UnicodeEncodeError, and would take the .cost write down with it); and STATUS_DIR is embedded via JSON.stringify, whose escapes are all valid Python ones — a raw r'…' literal breaks on an apostrophe in the path (a Windows user named O'Brien), and a SyntaxError there silently kills cost, context, sessionid and name at once. .name is a provider-facing channel, not Claude-private — any provider can write that file the way codex-session-watcher.ts already writes .sessionid without hooks; today only Claude does, so non-Claude sessions no longer auto-name (this replaced an approach that scraped Claude's box-drawing chrome out of raw PTY bytes). Default names come from src/renderer/state/session-naming.ts: nextNumberFor(key, project) counts the highest existing number across sessions and history for every locale's template of that i18n key, with nextSessionNumber / defaultSessionName as the Session {num} wrappers and the MCP inspector tabs numbering independently off the same helper. This replaces three separate length + 1 formulas, which reissued a number already on screen after a middle tab was closed.
  • components/active-sessions-panel.ts — Global, cross-project Active Sessions list rendered into #sidebar-active-sessions (a persistent sidebar block above Discussions). selectActiveSessions(projects, statusOf, activeStatuses) is a DOM-free selector that collects open CLI sessions (isCliSession) across appState.projects whose live getStatus() is in the configured set, ordered by STATUS_PRIORITY (from project-status.ts, now exported) then project name. initActiveSessions() subscribes to session-activity.onChange + the relevant appState events and re-renders; rows route clicks through setActiveProject + setActiveSession. Visibility is gated by preferences.sidebarViews.activeSessions and requires more than one project (with a single project the rows just duplicate its own tab bar); the "active" status set comes from preferences.activeSessionStatuses ({ working, waiting, input, completed }, default working/input/completed via resolveActiveStatuses). Both preferences are edited in the Preferences → Appearance section. Styles live in styles/sidebar.css; status dots reuse the existing .project-status.<status> classes.
  • components/git-panel.ts — Git changes for the active project, rendered inside its sidebar card as a git panel-toggle tab (a third ProjectPanel alongside history/files in sidebar.ts), not a standalone bottom panel. The "Git" tab carries a .project-action-badge count of total changes (badge + click-to-open); Cmd/Ctrl+Shift+G (toggleGitPanel, exported from sidebar.ts) toggles it. mountGitPanel(project, container) reparents a single persistent node into .project-panel-git so file rows/scroll survive sidebar re-renders; closeGitPanel() detaches it. The shared loadFiles/worktree-selector logic is unchanged; sidebarViews.gitPanel now gates the tab button. There is no #git-panel node in index.html.
  • browser-tab/ — Browser tab pane split into focused modules: types.ts, instance.ts (registry + preload path), navigation.ts, viewport.ts, selector-ui.ts, inspect-mode.ts, flow-recording.ts, flow-picker.ts, session-integration.ts, and pane.ts (DOM build + event wiring). browser-tab-pane.ts is a re-export shim for backward compatibility.
  • board-state.ts — Kanban board CRUD: tasks, columns, tags, reorder. Mutates appState.activeProject.board in place, calls appState.notifyBoardChanged().
  • board-filter.ts — Module-level search query and tag filter state for the board. Observer pattern via onFilterChange().
  • board-session-sync.ts — Listens to session lifecycle events and auto-moves board tasks (e.g. to Done on session complete).
  • components/board/ — Board UI: board-view.ts (container + header with the search box and "New task" button in a right-aligned actions group, plus a dedicated "Filter" tag row below), board-column.ts (column with header/rename), board-card.ts (card with run/resume/focus), board-task-modal.ts (create/edit dialog with tags), board-dnd.ts (drag-and-drop with injected DOM drop targets), board-context-menu.ts.
  • styles/kanban.css — All kanban board styles including cards, columns, DnD drop targets, tag pills, and filter UI.
  • components/team/ — Team tab: instance.ts + pane.ts (tab plumbing mirroring kanban), team-view.ts (header + card grid + empty state), member-card.ts (Chat/Edit/Sessions/Delete actions), member-modal.ts (create/edit form using the shared showModal), predefined-picker.ts (fetches suggestions from this repo's personas/ folder, marks already-installed members), github-fetcher.ts (Contents API + raw download, 1 hour cache), frontmatter.ts (Markdown → TeamMember parser).
  • styles/team.css — Team grid, cards, predefined-picker dialog. Uses CSS variables only.
  • Team state lives at the top level of ~/.vibeyard/state.json as state.team.members (global, not per-project). Predefined suggestions cache at state.team.predefinedCache. Predefined personas live in the top-level personas/ directory of this repo and are fetched at runtime via the GitHub Contents API; the location is configured by the single constant TEAM_MEMBERS_REPO in src/shared/team-config.ts — flip its owner/repo/path to retarget.
  • components/project-tab/ — Customizable Overview page driven by a gridstack.js drag-and-drop grid. pane.ts builds the toolbar (+ Add Widget, Edit layout toggle) + grid root. grid.ts wraps gridstack and owns tile chrome (header, drag handle, refresh/settings/remove buttons). Per-project layout persists at ProjectRecord.overviewLayout with widget records { id, type, x, y, w, h, config? } — lazy-defaulted on first render to mirror the legacy 2-column layout, no migration code. Each widget is a WidgetFactory registered in widgets/widget-registry.ts; current types: readiness, provider-tools (refactors of the old columns), github-prs, github-issues, team (reuses createMemberCard from components/team/member-card.ts, listens to 'team-changed'), kanban (reuses createCardElement from components/board/board-card.ts, groups by column, listens only to 'board-changed' — live per-session metrics are intentionally omitted to avoid full-rerender storms; the full kanban tab covers that), sessions (active CLI sessions + recent archived split into two sections; filtered through isCliSession; click-to-focus calls setActiveSession, click-to-resume calls resumeFromHistory; subscribes to session-activity/session-cost/session-unread observers with surgical row updates for status/cost ticks; settings modal at widgets/sessions-settings-modal.ts with config in widgets/sessions-types.ts lets users tune recentLimit), usage-stats (Claude-Code-only summary of sessions/messages/model token usage and a 7-day + by-hour activity heatmap; reads ~/.claude/stats-cache.json via window.vibeyard.stats.getCache(); styled with styles/usage.css; refresh wired through the widget chrome's refresh button — no in-content button). GitHub widgets use window.vibeyard.github.* IPC backed by src/main/github-cli.ts which shells out to the user's local gh CLI (auto-detected; PATH is the augmented getFullPath() from pty-manager). Repo defaults to the project's git origin via getGitRemoteUrl; per-widget settings (widgets/github-settings-modal.ts) override repo, state, max items, and refresh interval. Read/unread tracking lives in github-unread.ts (Set + observer mirroring session-unread.ts); per-item lastSeen timestamps persist at ProjectRecord.githubLastSeen. The tab-bar surfaces unread by branching on project-tab to consult hasUnreadInProject. Gridstack CSS is bundled by copying node_modules/gridstack/dist/gridstack.min.css to dist/renderer/vendor/ (esbuild has no CSS loader); <link>ed from index.html. styles/widgets.css holds shared widget chrome.
  • terminal-context-menu.ts — Right-click context menu for terminal panes (Copy, Paste, Select All). DOM-based using shared tab-context-menu CSS classes. showTerminalContextMenu() / hideTerminalContextMenu() exports; integrated via contextmenu listener on xtermWrap in terminal-pane.ts. Every action handler calls terminal.focus() after closing the menu so keyboard input resumes immediately (clicking a menu item otherwise leaves focus on the document, e.g. typing after Paste would be dropped). Note: the flex layout (display:flex; justify-content:space-between; align-items:center) lives on the shared .tab-context-menu-item selector in styles/tabs.css, so it affects every menu reusing that class — existing single-label items are unaffected since space-between has nothing to push.
  • Opening a file in a tab — every "open this path in a file-reader tab" path goes through openFileReaderChecked(projectId, filePath, lineNumber?) in src/renderer/open-file-reader.ts, never appState.addFileReaderSession directly. The order is load-bearing: addFileReaderSession → attachSessionToProject appends the tab and sets project.activeSessionId before anything touches the filesystem, so a stale path (a cmd+clicked path from old terminal output, a deleted file, a dead Markdown link) spawns a tab that loadFile's closeSessionIfFileMissing reaps a moment later — and removeSession then falls back to the left neighbour by index, not to the tab the user came from and not to NavHistory, so the user watches a tab flash and lands somewhere arbitrary. The helper therefore validates first with a parallel fs.exists + fs.isDirectory (a directory passes exists but reads as EISDIR, and that tab is never reaped — it sticks around showing "Failed to load file"), and re-checks that projectId is still the active project after the await so a mid-flight project switch cannot steal the other project's tab selection. It never rejects and returns void, so callers fire it with a bare void rather than each repeating a .catch; every failure is console.warn-only, matching the other silent-open paths. Callers: terminal-link-provider.ts (cmd+click), file-reader.ts (Markdown links), file-tree.ts, quick-open.ts, provider-tools-widget.ts, top-files-widget.ts. Path normalization is the shared resolveProjectFilePath(project, filePath) in state/specialized-sessions.ts, used by both the check and addFileReaderSession, so the two can never disagree about which path they mean. closeSessionIfFileMissing stays as the later, complementary check — it covers a file deleted while its tab is open (including tabs restored from state.json that never went through the helper). Note addDiffViewerSession (components/file-viewer.ts) still has the unguarded shape.
  • Rendered-Markdown links — renderMarkdownContent(content, baseDir?) in components/file-reader.ts attaches one delegated click listener to the markdown wrapper that always preventDefault()s, then routes the href through the pure, DOM-free src/renderer/markdown-link.ts (resolveMarkdownLink(href, baseDir) → anchor | external | file | ignore). external → window.vibeyard.app.openExternal; file → openFileReaderChecked (see the Opening a file in a tab bullet below); anchor → scroll to the heading whose slugifyHeading text matches (marked v17 emits no heading ids). Every failure path console.warns, since a suppressed default is otherwise indistinguishable from a dead click; cross-file fragments (other.md#section) are stripped — the file opens at the top. renderBody passes dirname(resolveFilePath(instance)) as baseDir; components/team/predefined-picker.ts calls it with none, and no baseDir means no file target at all — absolute paths included, because that picker renders Markdown fetched over the network and isAllowedReadPath permits ~/.claude.json, ~/.claude/, etc. Suppressing the default is load-bearing, not cosmetic: the renderer is a file:// document, so an un-intercepted relative .md link resolves against dist/renderer/index.html and navigates the window off the app, destroying every session and PTY. The main-process backstop is will-navigate in main.ts, which now allows only the app document (compared on the decoded pathToFileURL pathname) and blocks everything else including file://. Shared helpers introduced for this: resolveRelativePath in src/shared/platform.ts (root-aware — a POSIX root, Windows drive, or UNC share is split off as an un-poppable prefix, so .. can never turn an absolute path into a relative one that fs:exists would then resolve against the main-process cwd), slugifyHeading in src/shared/slug.ts (distinct from nameToSlug — keeps non-latin chars, one dash per whitespace char), and isHttpUrl in src/shared/url.ts (used by both main.ts and the link router).
  • i18n — lightweight in-house internationalization (no third-party library). src/renderer/i18n.ts exports t(key) (dot-path lookup with English fallback + console.warn for missing keys), getLocale(), setLocale(locale) (unknown locales rejected), and onLocaleChange(cb) returning an unsubscribe handle. Catalogs at src/renderer/locales/{en,zh-CN}.json are statically imported by esbuild (zero runtime fetches). src/renderer/system-locale.ts resolves navigator.language (/^zh/i → zh-CN, else en). The persisted choice lives at Preferences.locale ('en' | 'zh-CN', defined inline in src/shared/types.ts rather than imported from i18n.ts to avoid a main↔renderer import cycle). Persistence flows through the existing setPreference('locale', loc) → 300ms-debounced main-process save. initI18n() in src/renderer/index.ts runs right after appState.load(); on first launch (no saved locale) it persists the OS-resolved choice. The preferences-changed listener in index.ts calls i18n.setLocale(newLocale) and rerenderOpenPreferencesModal() (exported from src/renderer/components/preferences-modal.ts) so the open Preferences modal re-translates in place. The Language switcher itself lives at the top of Preferences → General as a createCustomSelect row backed by appState.setLocale (live, no Confirm required). Translated sections in v1: Preferences sidebar labels + General + Appearance. Out-of-modal strings (sidebar buttons, tab titles) stay English until a follow-up PR.

Platform Checks

Platform detection is centralized in src/main/platform.ts. Import isWin/isMac/isLinux (and derived constants pathSep, whichCmd, pythonBin) from there — do not inline process.platform === 'win32' or redefine isWin/isMac locally in source or test files. The three-way managed-path branch in claude-cli.ts is the one intentional exception.

Cross-platform paths in tests

When asserting on a path that the implementation produced via path.join, path.resolve, or path.normalize, never hardcode forward-slash literals like '/repo/foo.ts' in the assertion — they pass on macOS/Linux but fail on windows-latest because Node yields \repo\foo.ts there. Build the expected value with the same primitive the implementation uses:

import * as path from 'path';
// good — matches whatever path.join produces on the running platform
expect(mockRm).toHaveBeenCalledWith(path.join('/repo', 'foo.ts'), opts);

// bad — hidden Windows-only failure
expect(mockRm).toHaveBeenCalledWith('/repo/foo.ts', opts);

This applies to any assertion on arguments to fs.*, child_process calls, or anything else that flows a joined path through. CI runs on all three platforms, so a forward-slash literal will eventually fail on Windows.

File Watching

Live filesystem updates for the file tree, file reader, and diff viewer are backed by a single chokidar watcher in src/main/file-watcher.ts (chokidar is ESM-only but require-able under Electron's Node ≥22.12). It watches directories non-recursively (depth: 0), ref-counted per dir via watchDir(dir) / unwatchDir(dir) (IPC fs:watchDir / fs:unwatchDir). Watching the parent dir — not the file inode — is deliberate: it survives atomic save/replace (write-temp + rename), which silently kills an inode watch. Changes are coalesced and debounced (150ms) into a single batched fs:changed IPC carrying FsChange[] ({ path, dir, type }, type ∈ add/addDir/change/unlink/unlinkDir; see src/shared/types.ts). The renderer subscribes via window.vibeyard.fs.onFsChange. stopAllFileWatchers() is wired into main.ts teardown (window closed + before-quit).

Scope is lazy: only expanded tree folders and the parent dirs of open reader/viewer files are watched (cheap on huge repos). The file tree (file-tree.ts) reacts by incremental reconciliation (reconcileChildren), not full rebuilds: rows are keyed by data-entry-path, vanished entries are removed (unwatching their subtree via unwatchSubtree), new entries are inserted at the sorted position, and unchanged rows — with their expanded subtrees, scroll, and selection — are left untouched. Change bursts are flushed once per requestAnimationFrame. Cross-platform path helpers (dirname, isPathUnder) live in src/shared/platform.ts. Note: this is separate from git-watcher.ts, which watches the whole working tree and emits git:changed for the git-status UI. To avoid the macOS FSEvents teardown storm on project switch (#142), git-watcher.ts uses a single recursive fs.watch on macOS + Windows (watchRecursiveWorkingTree, one OS handle, events filtered via hasIgnoredSegment) and keeps the capped per-dir BFS (walkAndWatch, MAX_WATCHES) on Linux, where recursive fs.watch is unsupported and previously leaked inotify watches (#139). Fine-grained .git watches and the 60s git-status poll are unchanged.

State Persistence

App state (projects, sessions, layout) persists to ~/.vibeyard/state.json via the main process store. Saves are debounced and flushed on quit. Sessions track cliSessionId for CLI session resume capability.

UI Development

When working on renderer/UI code, the /ui-dev skill is automatically invoked. It documents all custom components (dropdowns, modals, alerts, badges), CSS theming variables, styling conventions, and component architecture patterns. Always follow it — never use native <select>, never hardcode colors, always reuse existing components.

Planning

When entering plan mode for a new feature, consider whether the feature (or aspects of it) should be exposed as a user-configurable option in Preferences. If it's relevant, ask the user whether they'd like it added as a config in the prefs before finalizing the plan.

Post-Implementation

After completing an implementation task, always:

  1. Run /code-review to review changed code for correctness bugs and reuse/quality/efficiency cleanups. Run it automatically — do not ask the user for permission first.
  2. Run /simplify to apply reuse, simplification, efficiency, and altitude cleanups to the changed code. Run it automatically — do not ask the user for permission first.
  3. Add or update tests as needed to cover the changes.

Git Workflow

Always use the /commit command when committing changes to this project. Do not create commits manually.

Never commit, push, or create pull requests unless the user explicitly asks for it.

CHANGELOG.md is auto-generated by the release action (via the /release / release-notes flow). Do not edit it as part of coding tasks — changes there will be overwritten at release time.

Maintaining This File

When your changes affect the architecture, build process, key components, data flow, or any other information documented above, update this CLAUDE.md to reflect the new state. This includes adding/removing/renaming files, changing IPC namespaces, modifying the build pipeline, or introducing new patterns. Keep this file accurate so future sessions start with correct context.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.