Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>Sapling SAPNew to Visual Studio Code? Get it now.
Sapling SAP

Sapling SAP

Preview

DataStep Labs

| (0) | Free
Write a statistical analysis plan for a clinical trial as a structured document: forms, checks, a decision interview, PDF and Word. Works without AI; an AI of your choice can propose.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Sapling SAP

Write a statistical analysis plan (SAP) for a clinical trial as a structured document. Sapling reads your protocol, makes a first plan whose every block quotes the protocol sentence it rests on, and shows the plan as a page you edit with forms; the checks run as you type, and the PDF and the Word file are one click.

It works without any AI. If you connect one of your own, it can propose blocks that you accept, decline or improve: it never approves a plan and never decides for you.

A reviewer discusses a block at its place, History keeps the versions you name, and one comparison says what changed and which outputs the change reaches.

Preview. Sapling is young: expect rough edges, and tell us where you stop (see "Feedback").

The first ten minutes

Install the extension, then run Sapling: Open the Sample Study (command palette, Cmd/Ctrl+Shift+P). It copies a small made-up study (a hypertension trial with a protocol written for the purpose and dummy data) into a folder you choose and opens a walkthrough (Help > Get Started > Sapling: the first ten minutes):

  1. open the sample study;
  2. make the first plan from the protocol (one confirmation);
  3. read the plan as a page: the yellow blocks are the decisions the protocol leaves to you;
  4. work through three decisions in the interview;
  5. accept a proposal that Sapling makes from its rules and templates;
  6. add an efficacy table (MMRM of the change in blood pressure) from a template by answering three questions, and look at its shell;
  7. build the PDF (needs Quarto, below) and export Word for your reviewer;
  8. optional: open Run and check to see what running the programs would need.

No step needs R, SAS, an AI or the command line. Running the programs is optional and has its own view, Run and check in the Sapling side bar: it says in plain words what is missing (DataStep Studio for R and dsr, R and its packages; or DataStep Studio and a window connected to SAS), with one button for each. Check traces each problem of a run back to the block of the plan or the rule of the specification. With an AI connected, Ask the agent to find the cause puts one tested proposal in the Inbox; you accept or decline it, and a proposal that would change what the plan analyses is shown apart and needs your reason.

Review: discussions, History, what changed

  • Discussions. The note button of a block writes a comment at that block. Under the block, Reply adds a line and Resolve closes the discussion. A resolved discussion leaves the plan and stays in the record of the review.
  • History. Save a version keeps the plan as it is now under a name. Go back to it makes the plan that version again, as one edit that undo takes back. A version is not an approval.
  • What changed since. The comparison is by blocks, not by lines. It tells a change of the analysis from a change of words or of a source, and names the outputs each change of the analysis reaches. Copy the summary of changes drafts the table of an amended SAP; you write each reason.

Versions and discussions are files of the study folder. They are shared when the folder is shared (git, a network drive). Sapling has no server.

Three parts, and only what a change reaches

The work has three parts, each with its owner: the SAP (the statistician), the specifications (the statistician and the programmer), the programs (the programmer). Each part is made by itself and knows which SAP it was made from, so a programmer can start from a draft. After a change of the SAP, History shows What it means for each part: the derivations to agree again, the ADaM data sets to make again, the outputs to run and check again, and the outputs that no change reaches.

In a terminal, sapling status shows each part and says when a part is behind the SAP, and sapling run --behind makes again only the data sets and the outputs the change reaches. It refuses when the links of the plan are not the whole truth (code in custom/, a specification edited by hand, other SDTM data). The check on numbers is one study on dummy data and one change: all 12 output files were the same, byte for byte, as after a full run. Check it on your own study before you rely on it.

Works without AI

With no AI connected (or sapling.ai.provider set to none) you have everything below, and no button leads to an error:

  • the visual editor with forms for every block (populations, estimands, tables, analyses, multiplicity, sample size ...), the checks, the review, the PDF and Word export;
  • the decision interview: one open decision at a time, with the question, the protocol sentence, what the knowledge base says good SAPs do, what recent public SAPs do (counts and trial numbers), and options; deciding records your name and the date, and writes the blocks that follow from the option where Sapling has a template for it;
  • proposals from the rules and templates in an inbox (what is missing from the plan, the fixes of the review, the next block), each marked "from the rules" or "from a template".

What an AI adds

An AI is yours: the Claude Code, Codex or Gemini command-line tool with your own login, any OpenAI-compatible address (a company gateway, Ollama, LM Studio), or a command your IT provides. It adds chat and questions about your protocol (answers quote the protocol, checked by the compiler), Ask AI on a block, drafting a section, and its own recommendation in the interview. Every proposal is compiled in its place before you see it. See the data statement for what is sent.

Your data

  • Without an AI nothing leaves your computer. The extension has no telemetry and makes no network call of its own.
  • With an AI, requests go only to the provider you chose, only for the helpers marked AI, and contain your wording, the lines of the plan around the place, and the protocol sentences that fit. Switch off the one automatic request (sapling.ai.prepare) if you want a click for every request.
  • The full statement: Sapling: Data and AI Statement (command palette) or docs/data-and-ai.md.

Requirements

  • VS Code 1.85 or newer, or Positron. Node.js is not needed.
  • Quarto (free, quarto.org) only for the PDF; the page, the preview and the Word export work without it.
  • R and SAS, with DataStep Studio for R or DataStep Studio (separate extensions of DataStep Labs), only to run the analyses; the first ten minutes do not need them.

What it is not, yet

  • A preview: parts are new, and the compiler checks your plan, it does not replace a statistician's review. Nothing here is validated for regulatory use.
  • Its tables and methods cover what the checks and generators below know (see the reference); a method it does not know cannot be written as a block.
  • The sample study is made up: the protocol is written for it and the data are dummy data made by Sapling. Do not report its numbers as results.
  • Some features need R, SAS, Quarto or an AI, as said above.

Feedback

Run Sapling: Give Feedback: four questions and a box for your words. Nothing is sent from there: you get a text to copy or save and send to whoever asked you to try Sapling. You choose whether it contains your plan.

The reference of every command, setting and block: REFERENCE.md.

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