Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Free CodeNew to Visual Studio Code? Get it now.
Free Code

Free Code

Sajjad Hossain

| (0) | Free
Provider-independent coding agent for VS Code with local-first inference, explicit permissions, and no artificial token limits.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Free Code (SajjadHossain19397.free-code)

Free Code is a provider-independent coding agent for VS Code with local-first inference, Cline-style BYOK provider profiles, explicit repository context controls, extension-host-enforced tool permissions, and no artificial Free Code token limits, accounts, subscriptions, relays, or telemetry.

  • Repository: github.com/sajjadhossain67/freecode
  • Publisher ID: SajjadHossain19397

Design Principles

You control three things independently:

  1. Which model receives your prompts and code — fully local (Ollama, LM Studio, llama.cpp, vLLM) or bring-your-own-key remote (OpenAI-compatible, Anthropic Messages, Gemini native, or any custom endpoint implementing a supported protocol). Arbitrary, private, fine-tuned, or unfiltered model IDs are accepted manually even when a server exposes no model-list endpoint.
  2. Which repository context the agent may read — explicit attachments (PRD/spec files, code files, editor selection, diagnostics, Git diff), bounded multi-repo read/search tools, and an inspectable Context Inspector showing exact files, ranges, and estimated vs. provider-reported token counts.
  3. Which actions the agent can take on your machine — Ask, Plan, and Agent modes enforced in the extension host, Workspace Trust enforcement, explicit approvals for file mutations and shell commands, stale-edit conflict detection, and Free Code-scoped Undo that never clobbers unrelated dirty Git edits.

Supported Protocols

Protocol Family Native Capabilities
Ollama Native (ollama) Local /api/chat NDJSON streaming, /api/tags discovery, custom ports (e.g. 11435), manual model IDs, native tool calls when supported
OpenAI-Compatible Chat Completions (openai-compatible) Configurable base URL & editable base path (prevents /v1/v1/chat/completions), optional API key, SSE streaming, fragmented tool-call assembly, /models discovery, manual model IDs
Anthropic Messages (anthropic) Native /v1/messages, x-api-key + anthropic-version, SSE content_block_* streaming, tool_use & tool_result blocks
Gemini Native (gemini) Native v1beta/models/{model}:streamGenerateContent?alt=sse, x-goog-api-key header auth, functionCall / functionResponse, explicit finishReason & policy block reporting

See docs/providers.md for concrete setup examples and docs/adding-an-adapter.md for implementing a new protocol family.

Enforced Local-Only Mode

Enable Local-Only in the Free Code sidebar header, via Command Palette (Free Code: Toggle Local-Only Mode), or via freeCode.localOnly.

  • Enforced directly in the extension host transport layer (src/security/transport.ts) across inference, model discovery, connection tests, and redirects.
  • Allows loopback destinations (127.0.0.1, localhost, ::1). Every resolved IP address is checked before connecting, HTTP redirects are intercepted and validated before following, and direct connections bypass system proxy environment variables (HTTP_PROXY/HTTPS_PROXY) so requests cannot be silently forwarded elsewhere.
  • Cloud fallback is never performed. If your local model server stops, Free Code displays the connection error and preserves your conversation and draft.
  • Private LAN inference servers (RFC1918 / RFC4193) require explicit opt-in (freeCode.allowLanServers or per-profile Allow LAN) and always display their destination host in the sidebar.
  • All sidebar webview assets are bundled with the extension (strict CSP, zero remote fonts, scripts, analytics, or external embedding services).
  • Important distinction: Local-only mode governs Free Code's own network requests. An approved terminal command runs in your shell and can make its own network requests; Free Code displays this reminder whenever command approval is requested.

Local Windows, WSL, SSH, and Dev Containers

Free Code runs in the VS Code extension host and resolves endpoint URLs from whichever extension host executes the request:

  • Local desktop window (Windows / macOS / Linux): http://127.0.0.1:11434 connects to the local machine's loopback interface. Paths with spaces, CRLF line endings, non-ASCII filenames, and PowerShell (powershell.exe / pwsh) are supported natively.
  • WSL Remote (Remote - WSL): The extension host runs inside the WSL Linux distro. 127.0.0.1 resolves inside WSL (in WSL2 mirrored networking mode this reaches Windows loopback; in NAT mode point to the Windows host IP with explicit LAN permission enabled or run Ollama inside WSL).
  • Remote - SSH: The extension host runs on the remote SSH server. 127.0.0.1 reaches services running on the remote server (or forwarded via SSH port forwarding ssh -L / -R).
  • Dev Containers: The extension host runs inside the container. 127.0.0.1 resolves to the container itself; to reach an Ollama/LM Studio instance running on the host machine, use host.docker.internal (with Local-Only disabled and LAN allowed if it resolves to a private IP) or forward the port into the container's loopback.

Modes and Workspace Tools

  • Ask (read-only): Answer questions using read-only tools (read_architecture, list_files, search_text, read_file, read_diagnostics, inspect_git_changes, read_command_result). Write and command tools are strictly blocked by the extension host.
  • Plan (read-only + editable plan): Inspect files across repositories and draft an editable implementation plan. Click Approve Plan & Switch to Agent when ready.
  • Agent: Inspect files, propose exact diffs (propose_edit), apply approved edits via VS Code WorkspaceEdit (apply_edit), create/rename/delete files with collision and unsaved-buffer checks, run approved shell commands (run_command) with bounded output and Stop cancellation, and verify results.
  • Smaller / Text-Only Models: Disable Supports native tool calling (or rely on automatic fallback) to use <tool_call> file inspection plus the strict freecode-proposal JSON edit-proposal workflow. Malformed JSON, unknown actions, invalid paths, or ordinary fenced code blocks never execute writes or commands.

Credentials & Privacy

  • API keys and sensitive custom headers (Authorization, X-API-Key, etc.) are stored exclusively in VS Code SecretStorage.
  • Secrets are stripped from ordinary settings, webview state, Output Channel logs, command output, and exported Markdown chats.
  • Zero telemetry by default.

Development: Launching Extension Development Host (F5)

  1. Install dependencies and build:
    npm install
    npm run build
    
  2. Open this repository folder in VS Code.
  3. Press F5 (or run Run Free Code Extension (Extension Development Host) from the Run and Debug view).
  4. In the Extension Development Host window, open the Free Code (Winged-F) icon in the Activity Bar (or run Free Code: Open Sidebar from the Command Palette) to launch the first-run setup flow.

Manual VSIX Installation

Build the VSIX package:

npm run package

Install the generated .vsix file via the VS Code CLI:

code --install-extension free-code-0.1.0.vsix

Or install manually in VS Code:

  1. Open the Extensions view (Ctrl+Shift+X).
  2. Click the ... menu in the top-right corner of the Extensions panel.
  3. Choose Install from VSIX... and select free-code-0.1.0.vsix.
  4. Reload VS Code if prompted, then click the Free Code icon in the Activity Bar.

Commands (freeCode.*)

  • freeCode.open — Open Sidebar
  • freeCode.newChat — New Chat
  • freeCode.configureProvider — Configure Provider
  • freeCode.testConnection — Test Provider Connection
  • freeCode.explainSelection — Explain Selection
  • freeCode.editSelection — Edit Selection
  • freeCode.reviewDiff — Review Pending Diff
  • freeCode.undoLastEdit — Undo Last Agent Edit
  • freeCode.toggleLocalOnly — Toggle Local-Only Mode

Build & Test Scripts

Script Purpose
npm run typecheck Strict TypeScript type checking (tsc --noEmit)
npm run build Bundle extension host (dist/extension.js) and webview (dist/webview/main.js, styles.css) via esbuild
npm run watch Watch mode for development
npm test Run typecheck, build, and all deterministic unit & mock-provider E2E tests
npm run test:integration Run VS Code Extension Host integration tests via @vscode/test-electron
npm run package Build and package standalone free-code-0.1.0.vsix without dev dependencies

Author

Sajjad Hossain — Full-Stack Software Engineer (Dhaka, Bangladesh)

  • Email: sajjad19397@gmail.com
  • GitHub: github.com/sajjadhossain67
  • LinkedIn: linkedin.com/in/sajjad19397
  • Portfolio: sajjad-hossain.netlify.app

License

MIT — see LICENSE.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft