Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>PrairieLearn ReviewNew to Visual Studio Code? Get it now.
PrairieLearn Review

PrairieLearn Review

sybelblue

|
4 installs
| (0) | Free
Review PrairieLearn questions from VS Code: a review queue, safe tag edits, and a live question preview.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PrairieLearn Review

PrairieLearn Review is a VS Code extension for reviewing questions in a PrairieLearn course. It combines an ordered review queue, a searchable question browser, safe tag editing, independent review sessions, and the real PrairieLearn preview in one workspace. The same review state is available to coding agents through the bundled MCP server.

The extension does not answer questions, submit grades, edit question content, or run Git commands. Its only course-file writes are explicitly described under Tag editing and GitHub write safety.

Install

Requirements:

  • VS Code 1.101 or newer.
  • For managed mode, Docker and the prairielearn/prairielearn:us-prod-live image. The extension never pulls that image unless you opt in.
  • For pull-request status or comment writeback, the official GitHub Pull Requests extension (0.170.0 or newer) and a GitHub.com sign-in. An older version shows a warning once per session; status and comments still run but may not work.

Install the release VSIX:

code --install-extension prairielearn-reviewer-0.2.0.vsix

Open a folder containing infoCourse.json, then run PrairieLearn Review: Start. Managed mode starts PrairieLearn in Docker. Unmanaged mode connects to a PrairieLearn server you already run yourself.

Using a PrairieLearn you already run (unmanaged)

If PrairieLearn is already running, for example make dev in a PrairieLearn checkout or a docker run … prairielearn/prairielearn you started yourself, run PrairieLearn Review: Connect to Running PrairieLearn… (also in the readiness view). It asks which loopback ports to scan, prefilled from plreview.unmanagedPorts, then lists:

  • every running PrairieLearn Docker container, marked when it mounts a different course or no course, and blocked when it does not publish port 3000 on a loopback address;
  • servers answering on the scanned ports, marked by whether their course list includes this course;
  • a manual URL entry, where a /pl/course/<id> path selects that course.

You can switch between managed and unmanaged sources while the review console runs. When connecting to an unmanaged source, the current source keeps serving until the new one answers, so a wrong URL leaves it connected and only shows the error. When moving from an unmanaged source to a managed container, the console uses the container while it starts and returns to the unmanaged source, with the error shown, if the container fails. After connecting, the course is reloaded from disk. A server that can't do this shows reload needed and stays connected. Restart and Reconnect return to the same source and course.

The extension never starts, stops, or changes an unmanaged server or container. Disconnect only detaches the console, and closing the window leaves the source running. Connecting away from a container this window started asks first, then stops that container. The server_connect MCP tool refuses to do this unless it's called with stopCurrentContainer: true. The old attach mode name, plreview.attachUrl setting, and --attach CLI flag still work as aliases.

Everyday workflow

The activity bar contains four views:

  • PrairieLearn readiness shows the runner mode, phase, endpoint or current managed container, reload state, actionable errors, and the controls for the current managed or unmanaged source. Running extension-managed containers for the active course appear here for safe reconnection or stopping, alongside unmanaged PrairieLearn containers that can be connected to but are never stopped.
  • Queue is the active review’s ordered worklist. Open a row, mark it done or skipped, requeue it, remove it, or drag rows to reorder. Previous and next stop at the queue boundary rather than wrapping.
  • Questions groups questions by assessment and also shows the complete course. Search by QID, title, or tag, then open or enqueue a result.
  • Tags edits the current question’s tags. Catalog entries are nested by colon-delimited scope and retain their declared color, description, and diagnostics. Tags used by questions but missing from the catalog remain visible and reusable.

The preview opens in an editor tab. It follows queue navigation, can create or reload a variant, indicates when relevant files changed, and shows the current review’s branch/PR binding, saved-review changes, review threads, and comments posted by this review. If PrairieLearn navigation takes the preview away from its question page, a home action in both the preview and Queue title bars returns to the latest variant of that original page. Queue and Questions rows stay compact; hovering one shows compact preference defaults, assigned tag names and issues, question/template/course-wide file groups, diagnostics, and review status. Empty sections and healthy diagnostics are omitted. Row accessibility labels include the QID, title, review status, and diagnostics.

While the preview is open, the extension keeps the current question and the next configured number of available pending questions warm. Selecting a warm question reuses its ready frame instead of requesting another variant. The cache is scoped to the active review-console session: closing the preview may discard its frames, and stopping or restarting the console clears it. Cache data is never written to review state, portable exports, runtime descriptors, or the VSIX.

The cache budget measures each retained question’s resolved source-file footprint, not webview heap usage. Shared files count once per retained question because each entry represents one rendered preview. Current and lookahead entries stay protected even when they exceed the budget; the overage is reported in the PrairieLearn Review output channel. Source changes invalidate affected entries and warm replacements without swapping the visible frame underneath the reviewer. Invalidate All Question Caches performs the same generation-safe reset explicitly, preserves the visible preview and review state, and rebuilds the protected window.

Useful commands from the Command Palette include:

  • Start, Stop, and Restart the review console.
  • New Review…, Switch Review…, Fork Review…, and Rename Review….
  • Add Questions to Queue… and Remove Questions from Queue….
  • Search Questions.
  • Export Active Review… and Import Review….
  • Add or Remove Tags…, Save Tags, Save Tags and Reload Course, and Discard Tag Changes.
  • Refresh Pull Request Status, Comment on GitHub File…, Submit Pending GitHub Review…, and Open Pending GitHub Review.
  • Invalidate All Question Caches to discard ready and in-flight preview generations without navigating away.
  • Clear Cache to invalidate every question preview and drop cached pull-request files and GitHub comments, then refetch them.

While focus is in a PrairieLearn Review view, J/K move next/previous, E toggles queue membership, D marks done, S skips, T focuses Tags, R reloads the course, and Shift+R creates a variant. Cmd+Alt+P on macOS or Ctrl+Alt+P elsewhere opens question search.

Reviews and selectors

Each review has a stable opaque ID and owns its queue, current question, completion state, saved-review fingerprints, lineage, and optional Git binding. A custom name is optional and may be shared by multiple reviews. Without one, every surface derives the same stable label from the review’s persisted ordinal and captured pull request, local branch, upstream, or detached revision—for example, Review [#3](https://github.com/SybelBlue/prairielearn-reviewer/issues/3) on fix-tags. The Queue header displays this label and provides a pencil action for renaming or clearing it; matching another review’s label requires confirmation but remains valid because IDs are authoritative. Switching reviews restores its own navigation. A new review starts with selected questions and copies the active review’s existing approval baselines. A fork additionally copies the full queue and current question into an independent child. Reviews remain visible when Git branches change; mismatched or unverifiable bindings are shown as warnings rather than hiding data.

Switch Review… works like VS Code's Git: Checkout to…. Reviews are grouped under Matching current branch / PR, Other branches, and Unbound, with rows above them for New Review…, Fork Review… (from any review), and Show Closed Reviews. Each row has buttons to rename the review and to close or reopen it. Picking a review bound to a different branch or pull request asks whether to Fork onto Current Branch or Switch Anyway. Neither choice runs Git, so check out the branch yourself if you need it. Switching never changes the review you leave.

Close Review… (in the Queue's overflow menu, or from a picker row) hides a review without discarding its queue, progress, binding, or lineage. The confirmation names any unposted GitHub comments from that review, which stay in your pending GitHub review. Closing the active review asks which open review to activate next, defaulting to the most recently updated one. The last open review cannot be closed. Closed reviews reappear under Show Closed Reviews; reopen one from its button, by picking it, or with Reopen Review….

New-review, add, and bulk-remove dialogs share these selectors:

  • exact QID or QID glob;
  • assessment;
  • exact tag or proper tag scope;
  • queued, active, pending, done, skipped, completed, or selected status;
  • changed on the current branch or changed since the saved review baseline;
  • any or unresolved pull-request comments.

Combined selectors form a de-duplicated union in stable course/QID order. The dialog previews exact matches before a mutation. Bulk removal identifies every matched QID and requires confirmation.

State migration and portable reviews

Review state is stored outside the course checkout by default, keyed by the course’s real path. Set plreview.stateFile only when you intentionally want a different location. The current review-state schema is v5. Schema-v1 queues and schema-v2 baselines migrate into an unnamed Review [#1](https://github.com/SybelBlue/prairielearn-reviewer/issues/1); schema-v3 review names and bindings migrate without loss; schema-v4 reviews migrate as open reviews. Queue progress and baselines are preserved.

Export Active Review… writes the active review and its available ancestors to a path-free prairielearn-review JSON envelope. The current envelope is v3; v1, v2, and v3 are importable. Exports include review IDs, ordinals, optional custom names, lineage, portable Git bindings, queue order/status, current QID, timestamps, baselines, and optional course/Git/PR provenance. They exclude absolute paths, local state/runtime locations, credentials, bearer tokens, and gateway URLs.

Import is always previewed first. Missing questions and provenance differences are warnings and remain preserved in the imported data. Conflicts behave as follows:

  • Update existing replaces records with matching stable IDs while preserving unrelated local reviews.
  • Import as copy creates new IDs and ordinals and remaps lineage while retaining custom names.
  • Names and generated labels never determine identity or create import conflicts.
  • Cancel changes nothing. If state or course discovery changes after the preview, apply is rejected and must be previewed again.

Tag editing

Tag checkboxes and Add or Remove Tags… edit only the tags array in the discovered questions/<qid>/info.json. Saves use a content-hash precondition and atomic replacement, so an externally changed file is not overwritten. Autosave is on by default; turn off plreview.autoSaveTags to keep a visible draft and use Save or Discard explicitly. Navigation waits for autosave, and a failed save retains the draft.

To give a question a tag the course doesn't use yet, type its name in Add or Remove Tags… and choose Create question tag. The name is kept exactly as typed, and matching is case-sensitive. The new tag is uncataloged until you add it to the course. Add Tag to Course Catalog, in the Tags view or the Command Palette, inserts a minimal { "name": "…", "color": "gray1" } object into the open infoCourse.json editor. It does not save the document, preserves formatting and existing dirty edits, and participates in normal VS Code undo.

GitHub write safety

GitHub integration is opt-in. Local change indicators use VS Code’s Git support. Remote PR status is read only after Enable GitHub Pull Request Status obtains a compatible GitHub session. Refreshing status never writes to GitHub.

The session uses the same scope sets as the GitHub Pull Requests extension, so an existing sign-in is reused without a prompt. Its repo scope is required: it lets PrairieLearn Review read private pull requests and add comments to, and submit, your pending review. When a new sign-in is needed, the prompt explains that comments go into your pending review and are published only when you confirm Submit Pending GitHub Review… or Publish now….

GitHub writes happen only through these commands:

  • Comment on GitHub File… adds a file comment to your pending GitHub review by default, unless you write it in the GitHub Pull Requests editor, which offers its own publish button (see below). Only you can see a pending review until you submit it.
    1. You choose a changed question, template, or course dependency file. If the GitHub Pull Requests extension can comment on it (see Writing comments in the GitHub Pull Requests editor), the file opens with that extension's comment editor and the steps below don't apply.
    2. You enter the Markdown body. Enter adds it to the pending review; the input box's Publish now… button publishes it on its own instead.
    3. The comment is added without another prompt, and a notification offers Submit review… and Open pending review. Turn on plreview.github.confirmFileComments to confirm first in a modal that names the review, QID, pull request, file, head commit, and exact body, with Add to review or Publish now…. The revalidation and duplicate checks below run either way.
  • Publish now posts a single comment immediately, and always asks first in a modal that warns it may notify pull-request participants. GitHub doesn't accept a single comment while you have a pending review on the pull request, so Publish now is refused before anything is written; add the comment to the review and submit it instead.
  • Submit Pending GitHub Review… rereads your pending review and shows a modal listing the review, pull request, head commit, and every comment it contains, including comments from other PrairieLearn reviews or other tools. Past 20 comments, the rest are counted by file, and Open pending review shows them all on GitHub. Only choosing Submit review publishes it, and only if the pending review still holds exactly those comments.

GitHub allows one pending review per user per pull request. If one already exists, whether you started it on github.com, with the GitHub Pull Requests extension's Start Review, or here, new comments join it; it is never deleted or replaced, and nothing submits it implicitly. While it holds comments, the Queue view description, a status-bar item, and the preview show an unposted count, split into this review, other PrairieLearn reviews, and other comments. Attribution comes only from each comment's marker, so switching reviews never claims another review's comments. A warning appears when the pull-request head has moved since the pending review was started, or when the pending review could not be read ("unposted status unknown"); Publish now stays unavailable until it can be read. The indicator appears only when the active review is unbound or bound to the current pull request, since only then can it submit. Pending state is reread from GitHub on refresh and restart and is never stored locally.

Immediately before every write, the extension revalidates the active review, bound PR, head commit, and changed file. An invisible versioned marker associates each comment with the review. Repeating the same review/QID/PR/head/file/body combination, whether it is pending or published, finds the existing comment instead of creating another. Ambiguous API responses are reconciled before retry. MCP and the loopback HTTP API do not expose GitHub writeback.

Writing comments in the GitHub Pull Requests editor

By default (plreview.github.commentAuthoring is pullRequestExtension), Comment on GitHub File… hands the chosen file to the GitHub Pull Requests extension's comment editor when all of these hold:

  • the extension is installed, active, at least version 0.170.0, and provides its file-comment command;
  • it is reviewing the same pull request on the current branch;
  • your local HEAD is the pull request's latest commit.

The file opens and the extension's file-comment widget appears. Start Review adds the comment to your pending review, the same one described above; Add Comment publishes it on its own immediately, without a confirmation, and may notify pull-request participants. PrairieLearn Review writes nothing on this path, so the modals above don't apply to it; set plreview.github.commentAuthoring to builtin if you want every publish to ask first. If the widget doesn't appear, VS Code says "File comments are not allowed on this file"; choose Widget didn't open? Use built-in dialog on PrairieLearn Review's notification to write the comment in the built-in box instead. That button stays available after the widget opens, and a comment written in the widget has no marker, so duplicate suppression can't catch a second copy written in the built-in box. If a comment without a marker has appeared on the file since the widget opened, the button asks before opening the built-in box; GitHub is read when the widget opens and again when you choose the button, and if either read fails it doesn't ask. When a condition above isn't met, the built-in box opens and its prompt says why. Set plreview.github.commentAuthoring to builtin to always use the built-in box.

Comments written in the GitHub Pull Requests editor don't carry PrairieLearn Review's marker. They don't count toward a question's comment status and aren't checked for duplicates. They do appear as "other" comments in the unposted indicator once it refreshes (on window focus, every minute, or with Refresh Pull Request Status), and Submit Pending GitHub Review… lists them.

Settings

Setting Default Meaning
plreview.courseRoot empty Course containing infoCourse.json; empty searches the workspace.
plreview.mode managed Initial source: managed owns a Docker runner; unmanaged (legacy attach) connects to PrairieLearn you run yourself. Either can switch while running.
plreview.unmanagedUrl empty Unmanaged-mode loopback URL; empty opens the picker when starting.
plreview.attachUrl empty Deprecated name for plreview.unmanagedUrl, read only when that setting is empty.
plreview.unmanagedPorts 3000-3010 Default loopback ports and ranges that Connect to Running PrairieLearn… offers to scan.
plreview.courseId empty Disambiguates course discovery, which ignores IDs the server lacks. A course chosen for a connection, such as a /pl/course/<id> URL, takes precedence.
plreview.allowImagePull false Permits an explicit managed-runner image pull when the image is absent.
plreview.containerStartupTimeoutMs 120000 Milliseconds to wait for a managed container to become ready after starting or reconnecting.
plreview.deleteContainerOnFailedLaunch true Stops and deletes a newly created container after a failed launch; off preserves a still-running container for inspection or reconnection.
plreview.stopContainerOnExit true Stops a container owned by this window; off leaves it available for reconnection.
plreview.relaxFrameHeaders true Removes local PrairieLearn frame restrictions so VS Code can embed trusted course content.
plreview.showPrairieLearnNavigation false Shows PrairieLearn's top navigation and side pane inside extension-owned previews.
plreview.github.commentAuthoring pullRequestExtension Writes file comments in the GitHub Pull Requests extension's editor when it can comment on the file; builtin always uses the built-in box.
plreview.github.confirmFileComments false Confirms in a modal before adding a file comment to your pending GitHub review.
plreview.port 0 Loopback gateway port; 0 chooses a free port.
plreview.stateFile empty Overrides the external review-state location.
plreview.onFileChange indicate indicate, reload, or off for files affecting the open question.
plreview.autoSaveTags true Saves question tag changes automatically without a course reload.
plreview.questionCacheWindow 8 Protects and warms the next N available pending questions; 0 disables lookahead, not current caching.
plreview.questionCacheMaxSourceMiB 256 Source-footprint budget; eligible entries are evicted LRU while protected entries may exceed it.
plreview.readinessViewMode auto collapsed, auto, or open readiness details and controls.
plreview.autoStart false Starts the review console when a course workspace opens.

The stable VS Code API can reveal a view but cannot programmatically collapse its pane. Accordingly, auto shows full readiness details when PrairieLearn is stopped, failed, stale, disconnected, or needs a manual reload, then keeps a compact control list while healthy. Lifecycle controls remain in stable positions and unavailable actions are disabled. collapsed always keeps only the status title; open keeps all details available.

MCP and headless use

In a workspace containing a PrairieLearn course's infoCourse.json, the installed extension automatically contributes PrairieLearn Review to VS Code's MCP server inventory. It appears under MCP: List Servers and its tools can be enabled from an agent's tool picker; no mcp.json entry is needed. The first agent use starts or reuses the extension-owned review console, including the normal course, unmanaged-source, or managed-container prompt when one is needed, and then attaches the bundled MCP process to that console. Cancelling startup launches nothing. VS Code may ask you to trust the local MCP server and approve its tools.

The integrated server shares review state, navigation, and VS Code Git/GitHub selector context with the extension UI. Stopping the review console intentionally disconnects it; restart the MCP server from MCP: List Servers after starting the console again.

The VSIX includes a standalone Node 22 CLI:

node /path/to/extension/dist/server/cli.js mcp \
  --course-root /path/to/course \
  --managed

node /path/to/extension/dist/server/cli.js serve \
  --course-root /path/to/course \
  --unmanaged http://127.0.0.1:3000

If an extension or serve console is already running for the course, MCP attaches to it. Otherwise it starts a temporary console, forwards the requested gateway port, and cleans up that owned child when stdio closes. Standard output is reserved for MCP messages.

Pass --require-console to plreview mcp to fail when no live review console exists instead of starting a temporary one; no --managed or --unmanaged flag is needed then. The VS Code-provided server uses this option so the extension remains the only console owner.

The 37 tools cover server status/lifecycle, including discovering and connecting to unmanaged PrairieLearn servers and containers; question listing, search, selector preview, and navigation; assessment listing; review lifecycle (including close and reopen) and portable transfer; queue operations; tag catalog/read/update; course reload; and variant navigation. Mutation tools accept expected revisions so a preview cannot silently apply to newer state. tags_update should be previewed with dryRun: true; applying requires the returned hash. Branch-change and PR-comment selectors require context from an attached VS Code host.

The gateway binds only to 127.0.0.1, validates its Host header, and protects review APIs with a random bearer token stored in a mode-0600 runtime descriptor. Unmanaged targets must resolve exclusively to loopback addresses. Managed shutdown signals only the container recorded as owned by this console; unmanaged servers and containers are never signalled or stopped.

Self-hosted CI runner

Routine CI uses a repository-scoped Linux ARM64 GitHub Actions runner in Docker so pushes and trusted pull requests do not consume GitHub-hosted runner minutes. The container has no host filesystem mounts and does not receive the Docker socket. It accepts pull-request jobs only when the head branch belongs to this repository; move a fork contribution to a trusted repository branch before running its code.

The runner host needs Apple Silicon, Docker Desktop, and GitHub CLI authentication for an account with repository administration permission:

gh auth login --hostname github.com
gh auth status --hostname github.com
make runner-ensure

runner-ensure starts Docker Desktop on macOS when necessary, reuses an online or stopped runner when possible, and requests a short-lived registration token only when registration is needed. GitHub jobs remain queued while the container is offline; there is intentionally no GitHub-hosted fallback.

Command Effect
make runner-build Build the pinned runner image without registering it
make runner-start Build, register, and start a fresh runner
make runner-ensure Ensure the existing runner is online, rebuilding when necessary
make runner-stop Stop the container while leaving its GitHub registration offline
make runner-status Show Docker and GitHub status
make runner-logs Follow container logs
make runner-remove Remove the container and its GitHub registration
make clean-runner Remove the registration plus runner images, volumes, and networks

Before merging a release, run the hosted macOS gate explicitly against the release branch and watch it complete:

gh workflow run macos-release.yml --ref <release-branch>
gh run watch

The automatic required check should be Linux (self-hosted ARM64). The macOS workflow is a release approval rather than an every-pull-request required check.

Marketplace publishing uses GitHub Actions trusted publishing. Configure the sybelblue Marketplace publisher with a policy for repository owner SybelBlue, repository prairielearn-reviewer, workflow publish.yml, and environment vscode-marketplace.

After the release changes and macOS gate are merged, start from a clean, synchronized main checkout. The local command runs the complete release gate, bumps the requested part of the product version, moves the Unreleased changelog content under a dated version heading, creates a vX.Y.Z commit and annotated tag, and atomically pushes both. The tag triggers the trusted-publishing workflow, which the command finds and watches to completion.

make publish patch DRY_RUN=1
make publish patch

Use minor or major in place of patch when appropriate. If package.json and CHANGELOG.md were already bumped in an earlier commit, use make publish current; it leaves HEAD unchanged and creates the tag for the current version. If that tag was already pushed but Marketplace publishing failed—as with v0.3.5 during this migration—make publish-vscode dispatches and watches a new workflow run without moving the tag.

Add PRE_RELEASE=1 to any of these commands to use the Marketplace pre-release channel, and pass -f pre_release=true to the macOS gate so it verifies the same package. The Marketplace rejects semver suffixes, so the version stays a plain X.Y.Z; the vX.Y.Z-pre tag is what tells the workflow to package and publish with --pre-release.

gh workflow run macos-release.yml --ref <release-branch> -f pre_release=true
make publish current PRE_RELEASE=1 DRY_RUN=1
make publish current PRE_RELEASE=1

The Marketplace never accepts a version twice, so stable can't reuse a number that went out as a pre-release: after pre-release 0.4.0, make publish patch releases stable 0.4.1. VS Code moves everyone to the highest version available on their channel, and pre-release users also receive a higher stable version, so a stable release must stay below any pre-release it shouldn't replace.

See CHANGELOG.md for release details and LICENSE for licensing.

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