Skip to content

Commit 5093952

Browse files
garthvhclaude
andcommitted
vscode-extension: only show in FauxClaude-routed windows (v0.1.1)
The extension lives in the shared ~/.vscode/extensions dir, so it loads in every window; the old 'dim llama when the shim is up' path made it appear in unrelated projects (e.g. Meshtastic-Apple). Now it early-returns when the window's ANTHROPIC_BASE_URL isn't the shim: no status item, no polling, nothing. Only windows opened via the app's 'Open Project in VS Code' (which sets the env) show the llama. Dropped the palette command contribution (registered at runtime only in routed windows, so it no longer shows in the palette everywhere). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 6169cd3 commit 5093952

2 files changed

Lines changed: 28 additions & 30 deletions

File tree

vscode-extension/extension.js

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ const DEFAULT_SHIM = "http://127.0.0.1:11435";
1313
function activate(context) {
1414
const baseUrl = (process.env.ANTHROPIC_BASE_URL || "").replace(/\/+$/, "");
1515
const routed = /(^|\/\/)(127\.0\.0\.1|localhost):11435/.test(baseUrl);
16-
const shimUrl = routed && baseUrl ? baseUrl : DEFAULT_SHIM;
16+
// Only act in a window actually routed to FauxClaude (the app's "Open Project in
17+
// VS Code" sets ANTHROPIC_BASE_URL in the process). In every other window — your
18+
// normal projects like Meshtastic-Apple — do nothing at all: no status item, no
19+
// polling. The extension lives in the shared extensions dir so it loads
20+
// everywhere; this keeps it invisible outside FauxClaude windows.
21+
if (!routed) return;
22+
const shimUrl = baseUrl || DEFAULT_SHIM;
1723

1824
const item = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 100);
1925
item.command = "fauxclaude.openDashboard";
@@ -26,24 +32,12 @@ function activate(context) {
2632
);
2733

2834
function render(up, mode, model) {
29-
const warnFg = new vscode.ThemeColor("statusBarItem.warningForeground");
30-
const warnBg = new vscode.ThemeColor("statusBarItem.warningBackground");
31-
if (routed) {
32-
item.text = up ? "🦙 FauxClaude" : "🦙 FauxClaude — offline";
33-
item.tooltip = up
34-
? `This window is running on FauxClaude (${mode || "local"}${model ? " · " + model : ""}) at ${shimUrl}.\nClick to open the dashboard.`
35-
: `This window is set to use FauxClaude, but the shim isn't responding at ${shimUrl}.\nStart it from the FauxClaude menu-bar app.`;
36-
item.color = up ? undefined : warnFg;
37-
item.backgroundColor = up ? undefined : warnBg;
38-
} else {
39-
// Normal window (real Claude). Don't clutter unrelated windows: only show a
40-
// dim, informative llama when the shim is actually running elsewhere.
41-
if (!up) { item.hide(); return; }
42-
item.text = "$(circle-slash) 🦙";
43-
item.tooltip = `FauxClaude is running at ${shimUrl}, but THIS window is NOT routed to it (using the real API).\nUse the FauxClaude app's "Open Project in VS Code" to get a local window.`;
44-
item.color = new vscode.ThemeColor("disabledForeground");
45-
item.backgroundColor = undefined;
46-
}
35+
item.text = up ? "🦙 FauxClaude" : "🦙 FauxClaude — offline";
36+
item.tooltip = up
37+
? `This window is running on FauxClaude (${mode || "local"}${model ? " · " + model : ""}) at ${shimUrl}.\nClick to open the dashboard.`
38+
: `This window is set to use FauxClaude, but the shim isn't responding at ${shimUrl}.\nStart it from the FauxClaude menu-bar app.`;
39+
item.color = up ? undefined : new vscode.ThemeColor("statusBarItem.warningForeground");
40+
item.backgroundColor = up ? undefined : new vscode.ThemeColor("statusBarItem.warningBackground");
4741
item.show();
4842
}
4943

vscode-extension/package.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22
"name": "fauxclaude-status",
33
"displayName": "FauxClaude Status",
44
"description": "A llama in the status bar that lights up when this VS Code window is routed to your local FauxClaude shim.",
5-
"version": "0.1.0",
5+
"version": "0.1.1",
66
"publisher": "garthvh",
77
"license": "GPL-3.0-or-later",
8-
"repository": { "type": "git", "url": "https://github.com/garthvh/fauxclaude" },
9-
"engines": { "vscode": "^1.80.0" },
10-
"categories": ["Other"],
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/garthvh/fauxclaude"
11+
},
12+
"engines": {
13+
"vscode": "^1.80.0"
14+
},
15+
"categories": [
16+
"Other"
17+
],
1118
"icon": "icon.png",
12-
"activationEvents": ["onStartupFinished"],
13-
"main": "./extension.js",
14-
"contributes": {
15-
"commands": [
16-
{ "command": "fauxclaude.openDashboard", "title": "FauxClaude: Open Dashboard" }
17-
]
18-
}
19+
"activationEvents": [
20+
"onStartupFinished"
21+
],
22+
"main": "./extension.js"
1923
}

0 commit comments

Comments
 (0)