Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>LocalJudgeNew to Visual Studio Code? Get it now.
LocalJudge

LocalJudge

Parth Mudgal

| (0) | Free
Import problem samples from Chrome and test C++, C, Java, Python and JavaScript locally.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

LocalJudge — local prototype

LocalJudge checks whitespace-separated tokens for ordinary, non-interactive problems. Extra spaces and line breaks are ignored; case and numeric spelling are exact (3.0 differs from 3). Floating-point tolerance, “print any valid answer”, optimization, and interactive problems require the original platform's judge or a suitable custom checker elsewhere. LocalJudge has no special checker or interactive protocol. Passing samples and custom cases does not establish acceptance on hidden tests.

Import samples from Codeforces, AtCoder, CodeChef, and CSES with one Chrome toolbar click. Write C++, C, Java, Python, or JavaScript and run tests locally.

  1. Open a trusted local folder in VS Code.
  2. Load the companion Chrome extension from this project's extensions/chrome directory using Chrome's Load unpacked action.
  3. Click LocalJudge in Chrome to open setup and copy its extension ID. To reopen settings, right-click its icon and choose Options. Run LocalJudge: Pair Chrome in VS Code and paste that ID.
  4. The pairing token is copied to your clipboard. Paste it into Chrome’s settings page and save. Both components default to port 27121.
  5. Open a supported problem and click the LocalJudge toolbar icon once. The solution opens in VS Code automatically. The toolbar shows OK after import, ! on an error, or SET if setup is needed. Hover over the icon for details.
  6. Use Choose Solution Language in the LocalJudge sidebar to select C++, C, Java, Python, or JavaScript. Set localjudge.defaultLanguage for new imports. Each language keeps its own solution file and shares the same tests. Write your solution and run LocalJudge: Run Tests or Cmd+Alt+J on macOS / Ctrl+Alt+J elsewhere. Results open beside the solution as plain text.
  7. Use LocalJudge: Edit Custom Tests to add, edit or remove labeled input/output test rows, then choose Save custom tests. Unsaved edits survive switching tabs; save before running tests. If saved tests fail to load, keep the editor open, resolve the error, and choose Retry loading to recover any restored draft. Existing line endings in untouched custom-test fields are preserved; editing a field normalizes its line breaks to LF. Reimports preserve the solution and custom tests.

Wrong answers identify the first differing whitespace-separated token, including missing or extra output. Long tokens show a bounded excerpt near the differing character; the full expected and actual output remains below it. Tokens are case-sensitive and numeric text is exact (1.0 differs from 1).

Solution output must be valid UTF-8. Invalid byte sequences produce a wrong-answer verdict instead of being silently converted into replacement characters for comparison.

Install the tools for your chosen language: clang++ (C++), clang (C), a JDK providing javac and java (Java), python3 (Python), or node (JavaScript). Configure executable paths and argument arrays in VS Code’s LocalJudge settings. Commands run without a shell. Java uses public class Main in Main.java; the other solution files are main.cpp, main.c, main.py, and main.js. Solutions are single-file programs reading stdin and writing stdout; external dependencies and multi-file projects are not bundled.

Verdicts: AC (accepted by these tests), WA (wrong answer), CE (compilation error), RE (runtime error), TLE (timeout), OLE (output limit), and CANCELLED. Comparison ignores whitespace differences but compares tokens exactly. Default test deadline is 2 seconds; compile deadline is 15 seconds; combined stdout/stderr is capped at 1 MiB per process. Timing is local wall time, not a platform benchmark.

Importing only stores problem data. Compilation and execution require the explicit Run command. Each test starts in a fresh temporary working directory; relative files from compilation or earlier tests are not available. Local programs run with your user privileges and can access files outside that directory; execution is not sandboxed. Samples cannot establish hidden-test acceptance. Interactive tasks, special checkers, sites/languages beyond those listed above, remote workspaces and multi-root workspaces are not supported yet. macOS is the tested platform; Windows process-tree cleanup is not implemented.

The receiver binds to 127.0.0.1, requires a pairing token and the paired Chrome extension origin, and never accepts source code or execution instructions. Pairing again rotates the token. Revoke Chrome Pairing stops imports and deletes the editor token. Stop Receiver stops imports until the next Start command or paired extension activation. Use another port if another window owns the current one.

When the editor shuts LocalJudge down, it cancels the active run and waits for its process and temporary-file cleanup. Pending selection or saving cannot start a new compilation afterward. Workspace changes cancel the old run and suppress its late result view. Stop Receiver controls imports only; it does not cancel an independent run. A stalled filesystem or document save can delay graceful shutdown; forced termination can still leave temporary files.

No hosted service, analytics, or account. Token storage: VS Code SecretStorage and the browser profile's local extension storage. Problems/tests remain in your workspace. Uninstalling the extension does not delete your solutions. Keep the token private and clear the clipboard after pasting it if desired.

Metadata saves coordinate cooperating editor processes with a per-problem .write-lock directory. If another writer holds it, retry after that save finishes. If a crash leaves a persistent lock, close all LocalJudge editor windows/processes, back up the entire .localjudge/<problem-id> folder, then remove only its empty .write-lock directory before reopening. Never remove a lock while a writer may still be active. Saved data remains readable while locked. Older extension builds and direct external edits do not honor these locks; avoid concurrent use.

New solutions are flushed before publication and require a filesystem supporting hard links; unsupported filesystems fail safely. Existing solutions are preserved. A save error after metadata replacement may mean the cases were committed: reopen custom tests to check before retrying, preserving any unsaved draft separately. Corrupt metadata is never automatically reset. Back up the complete .localjudge folder with all writers stopped, and restore to a separate workspace to inspect source and cases first. No automatic backups or universal power-loss guarantee is provided.

The live Codeforces toolbar-to-editor journey, pairing rotation/revocation, custom-test editing and persisted editor restart have been verified on macOS with Chromium 156 and VS Code 1.143.1. Version 0.1.0 was submitted under parthmudgal.localjudge; this 0.2.0 feature update is a local preview and has not been submitted. The Chrome extension remains unpublished. Public privacy/support details and broader release validation remain pending.

Imported and newly selected solutions open in their chosen language mode. Run controls and the keyboard shortcut support all five solution languages.

LocalJudge sidebar

Click the beaker icon in VS Code’s Activity Bar to open LocalJudge. Choose Pair Chrome to copy a pairing token for the Chrome settings page; the sidebar also shows whether the receiver is listening and lets you start, stop, or revoke the connection.

Import a problem from Chrome or open one of its solution files in .localjudge/<problem>/ to select it. The sidebar shows its sample and custom-test counts. Click the problem title to reopen the solution, Run Tests to save and judge it, or Edit Custom Tests to add inputs and expected outputs. The selection stays available while a result report or custom-test editor has focus. During a run, use Cancel Run to stop execution; Show Output opens the run log. Changing workspaces clears the selected problem.

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