Al Hakeem Assistant - VS Code ExtensionAn agentic coding assistant extension for VS Code, powered by a C# backend. Supported engines:
ArchitectureThe extension uses stdio JSON-RPC for communication with the C# backend:
Quick Start1. Install Extension from VS Code
2. Download and Install Extension from Visual Studio MarketplaceOpen the Al Hakeem extension page on Visual Studio Marketplace and select Install to open the extension in VS Code. To install it manually, select Download Extension on the Marketplace page to download the 3. Dependencies.Net 8.0 Runtime: https://dotnet.microsoft.com/en-us/download/dotnet/8.0 You only need the .NET Runtime (No SDKs, No Desktop, No ASP.NET Core, just Runtime) 4. Run the ExtensionIn VS Code (Extension Development Host):
The extension will launch in a new VS Code window. The chat panel should appear on the right side. Both user and assistant bubbles render Markdown, including code blocks, lists, tables, and Mermaid diagrams. Select bubble text and press Ctrl+C (Cmd+C on macOS) to copy the selection, or use the bubble's clipboard (📋) button to copy its original Markdown. The button appears on bubble hover or keyboard focus. While the LLM is generating a reply or summary, Refresh Models, Select Model, View Chat History, Clear Chat, Settings, Summary, Shrink, and Attach are disabled. They become available again when generation finishes, fails, is cancelled, or immediately when you click STOP. Loading a saved chat restores the bottom token and timing statistics from its last assistant message. Chats without saved statistics show zero values. The usage bar is blue below 50%, amber at 50-89%, and red at 90% or higher, based on the displayed percentage, for both live replies and saved chats. Image AttachmentsFor llama.cpp image input, load a vision-capable model with its matching Plain-text ( Run the attachment regression tests with
The backend sends images as Project Structure
JSON-RPC ProtocolThe extension and backend communicate via line-delimited JSON-RPC 2.0: Request (Extension → Backend)
Response (Backend → Extension)
Notification (one-way, no id field)
Supported Methods
|
| Setting | Type | Default | Description |
|---|---|---|---|
alhakeem.useStdio |
boolean | true |
Use stdio JSON-RPC (stdio mode) or HTTP |
alhakeem.backendPath |
string | "" |
Path to C# host .exe (required for stdio mode) |
alhakeem.backend.host |
string | 127.0.0.1 |
Backend hostname (HTTP mode) |
alhakeem.backend.port |
number | 5000 |
Backend port (HTTP mode) |
Extending the Extension
Browser mode (Settings > Tools)
Choose Built-in VS Code browser or External Chromium (separate window) in the
chat Settings menu's Tools tab, then save and reload. The same choice is available
as alhakeem.browser.mode in VS Code Settings. Built-in is the default; the extension
never silently falls back to an external window.
Built-in VS Code browser: requires a VS Code build that exposes the proposed
browser API and permission for NaserHAlharbi.alhakeem. No separate browser
installation is required. Close all VS Code windows, then launch:
code --enable-proposed-api=NaserHAlharbi.alhakeem
For Insiders, launch with:
code-insiders --enable-proposed-api=NaserHAlharbi.alhakeem
Enable the built-in browser API permanently
Press Ctrl+Shift+P (macOS: Cmd+Shift+P) in the VS Code installation you use.
Run Preferences: Configure Runtime Arguments.
Inside the existing configuration's
{ }, add:"enable-proposed-api": ["NaserHAlharbi.alhakeem"]Separate existing properties with a comma. If
enable-proposed-apialready exists, add"NaserHAlharbi.alhakeem"to its array rather than adding a duplicate property.Save the configuration, fully quit VS Code and close every window, then reopen it. Developer: Reload Window alone is not enough to apply changed runtime arguments. On macOS, use Code > Quit Visual Studio Code (or Cmd+Q).
In Al Hakeem, open Settings > Tools > Browser, select Built-in VS Code browser, and save. Reload the window if you changed browser mode.
Keep Al Hakeem: Use Stdio enabled and run Al Hakeem: Run Browser Smoke Test.
Insiders uses its own runtime configuration; perform these steps inside Insiders if that is the installation you use. No separate Chromium download is needed for built-in mode.
Permission cannot add an API that the build lacks. The settings selector cannot grant API permission itself. Copilot's first-party access does not automatically authorize other Marketplace extensions.
External Chromium: works in local desktop VS Code 1.90+ without proposed API permission. It opens a separate visible window only when this mode is selected. The browser uses an isolated, temporary profile; it never connects to users' personal Chrome/Edge sessions. Cookies and logins last only for the current extension session.
- Keep Al Hakeem: Use Stdio enabled (reload after changing transport).
- For external mode only, run Al Hakeem: Install Browser and approve the first-time Chromium download. Alternatively, the first browser request prompts for installation when Chromium is missing.
- Enable the desired browser tools in the chat Settings panel.
- Run Al Hakeem: Run Browser Smoke Test to check the local browser.
Chromium is downloaded from Playwright's distribution servers into its per-user browser cache, not bundled into the VSIX. Downloads can be several hundred MB; updates may require a new browser revision. Download output and launch errors appear in Output > Al Hakeem Browser. External mode on Linux requires Chromium system libraries and a graphical desktop. External tools are unavailable in web/remote windows. Both modes require stdio.
Sharing an existing browser tab requires consent. Use Al Hakeem: Revoke Browser Sharing
to detach without closing the tab. New popups are not automatically shared. File uploads
and each new restricted snippet require separate approval. Alert, confirm and prompt dialogs
are handled through handleDialog. Native prompts are supported in external Chromium;
an integrated Electron host that does not support them reports an explicit error.
Downloads are not exposed as an agent tool.
Closing/reloading the extension closes its external browser and clears its temporary session;
built-in tabs remain open when control is detached.
Screenshots are session-only, expire after 15 minutes, and reach the model only when it supports vision.
runPlaywrightCode uses an AST-validated, page-only interpreter in a separate process and
requires approval for every new snippet. It is not a security sandbox or unrestricted
Playwright. Supported host statements are const, sequential page calls with optional await,
and explicit JSON-valued return. The only methods are page.evaluate(callback, optionalJsonArgument),
page.title(), page.url(), page.waitForTimeout(ms), page.click(selector), and page.hover(selector).
Browser JavaScript, including document and window, belongs inside the evaluation callback.
Outer variables are not captured; pass JSON explicitly as the optional argument.
Example: return page.evaluate(() => document.title);
Supply exactly one of code or deferredResultId. The default wait budget is 5000 ms
(positive finite values up to 30000 ms). Pending jobs return an ID; resume on the same page
without rerunning code. Resolve dialogs with handleDialog. Limits: 32 KiB source,
64 KiB JSON result, eight retained jobs, one running job per page, 60 seconds execution,
and five minutes completed/error retrieval. Revocation, closure, disconnect, shutdown,
and cancellation invalidate jobs. Cancellation/crash/execution expiry revokes control;
already-started renderer JavaScript may still continue, so cancellation is not rollback.
Run Al Hakeem: Run Browser Smoke Test for the real-browser fixture checks. Snippet and upload checks require their own approvals.
Add New RPC Methods
- In C# Host (
csharp-host/Program.cs):
case "your_method":
result = await HandleYourMethod(request);
break;
- In TypeScript (src/extension.ts or panels/chatPanel.ts):
const response = await backendConnection.request('your_method', { param1: 'value' });
Add UI Features
Edit media/chat.js and media/chat.css to add new UI elements. Messages are sent to the extension via:
vscode.postMessage({
type: 'your_event_type',
payload: { /* data */ }
});
Troubleshooting
Blank chat panel after installing from Marketplace
Version 0.1.11 could fail during activation when VS Code exposed the proposed browser API but denied the extension permission to read it. Development launches enabled the proposal, so they did not reproduce this failure. Version 0.1.12 handles that denial and keeps chat available without browser tools.
Update the extension, then run Developer: Reload Window. If the panel is still blank, open View: Output, select Log (Extension Host), and look for Al Hakeem activation errors. Use Developer: Toggle Developer Tools to inspect webview resource or script errors. Missing .NET affects backend requests, not whether the chat UI is rendered.
Backend won't start
- Verify the executable path in settings
- Check that the .NET runtime is installed:
dotnet --version - Check stderr output in VS Code debug console
Messages not sent
- Check browser console (F12 in webview) for JS errors
- Verify stdin/stdout connection in backend
Extension not appearing
- Ensure
npm installcompleted successfully - Run
npm run buildto compile TypeScript - Restart the extension host (Ctrl+R)
Package extension
cd .\csharp-host
dotnet publish -c Release -o lib
cd ..
vsce package
License
[Daarulhikmah License]
Change log:
v0.1.24:
- Fixed find_symbol tool call.
- Fixed multiple tool calls processing.
v0.1.23:
- Added missing tool calls.
v0.1.22:
- Fixed some issues run_build and get_errors where they report warnings even if ignore warning is checked.
- Fixed issue where user cannot copy text from chat area.
- Fixed issue where user bubble does not render markdown.
v0.1.21:
- Fixed some issues with run command in terminal tool call
- Improved get file tool call when getting an image file
v0.1.20:
- Added local TTS service
- Fixed some UI bug for chat history where it shows 0 token used.
v0.1.19:
- Added List skills and read skill.
- Improved TTS
v0.1.18:
- Added Settings > General > Notification Sounds: enable response/question sounds, choose from the backend sound catalog (or None), preview unsaved choices, and adjust volume. Pending questions repeat every 2-600 seconds (default 10) until answered, declined, cancelled, or the chat is changed. Playback uses the webview audio output, including with a remote backend.
- Fixed assistant text disappearing when an interactive question card renders, including restored chat history.
- TTS strips Markdown table separators, list and heading markers, strikethrough, links, and HTML formatting before pronunciation. Inline code remains speakable; fenced code and HTML comments are skipped.
- TTS buffers complete lines during streaming and flushes the final line at response completion, avoiding speech of partial Markdown links. Single-line responses start speaking when generation completes.
- Added sounds and chimes for messages and questions.
- Improved replace_string_in_file result message.
v0.1.17:
- Added TTS support.
- Fixed bubble chat grouping issue.
v0.1.16:
- Added Loading chat history.
v0.1.15:
- Restored built-in VS Code browser support as the default.
- Added an explicit built-in/external browser selector in Settings > Tools.
- Kept external Chromium as an optional mode; no automatic fallback.
v0.1.14:
- Added Marketplace-compatible browser tools using a separate visible Chromium window.
- Added first-time browser download approval and the Install Browser command.
- Removed the experimental VS Code browser API dependency.
v0.1.13:
- Omitted
v0.1.12:
- Fixed a blank chat panel on normal installations when VS Code denies the proposed browser API.
- Kept chat available when integrated browser tools are unsupported.
v0.1.11:
- Added browser features for frontend development.
v0.1.10:
- Added vLLM support.
- Fixed some issues with Auto Shrink
v0.1.9:
- Fixed an issue with file_glob_search hanging.
- Fixed an issue enable to resume chat when receive error codes from LLM server.
v0.1.8:
- Fixed an issue with drag and drop files.
- Fixed an issue with processing images with vision enabled models.
v0.1.7:
- Some fixes to replace_string_in_file
- Set default values for tool to checked.
- Fixed file_glob_search not working.
- Fixed an issue when switching pages some UI elements gets reset.
- Added media support (drag and drop)
- Fixed questions not rendering correctly.
- Reworked some of the tools calls.
- Quality of life imporvement for better User Experience.
v0.1.6:
- Fixed an issue with replace_string_in_file where it sometimes replaces a string but reports it has failed.
- Added reporting total number of lines with get_file to save on tokens.
v0.1.5
- Removed max iteration logic.
- Fixed conversation timer.
- Fixed loading chat history (some messages do not appear)
- Hide Thinking drop down selection when selected model is not a reasoning model.
v0.1.4
- Fixed an issue with git_file where it misses alot of files.
v0.1.3
- Fixed linking broken frontend contorls to the backend.
v0.1.2
- Added universal support (Linux, Mac)
v0.1.1
- Fixed backend issues with LLM connection.
v0.1.0
- First release.