Docs
How MachineStream works
MachineStream runs your AI agent's tests, type checks, linters and builds in an isolated environment of your own. Run a command, pick checks for an edit, or see what passed on the exact tree.
Who can use it
Every ContextStream account. Remote checks are off until you turn them on for your account: the setup offers them for your project's languages, your agent turns them on when you ask, and ContextCode has /mc on. Java and Kotlin, .NET, Ruby, PHP, C and C++, Bun, Deno, Dart, Elixir, Zig and Swift have a switch of their own, off by default. See Turning remote checks on.
It runs inside AI coding agents: Claude Code, Cursor and Codex through the ContextStream MCP, and ContextCode, which has it built in. The MCP features below are available in 1.0.95.
Quickstart
Every client starts the same way: a ContextStream account, then the setup command in your project folder. The setup finds the agents you have installed, signs you in in the browser, writes each one's MCP connection, and offers remote checks for the languages it finds in your project, with their price and your balance, in one keypress.
- Create a ContextStream account (free to start; sign-up verifies your email and phone) or sign in.
- In your project folder, run:
curl -fsSL https://machinestream.io/setup.sh | bashirm https://machinestream.io/setup.ps1 | iex
Claude Code
- When the setup asks which editors to connect, choose Claude Code.
- Restart Claude Code, then ask it “what project am I in?”. It should name your project.
- Once remote checks are on for your account (how), the check tool is listed in that same connection. Ask the agent to run your tests, for example
npm test, and it can send the run to MachineStream.
Cursor
- When the setup asks which editors to connect, choose Cursor.
- Restart Cursor, then ask it “what project am I in?”. It should name your project.
- Once remote checks are on for your account (how), the check tool is listed in that same connection. Ask the agent to run your tests, for example
npm test, and it can send the run to MachineStream.
Codex
- When the setup asks which editors to connect, choose Codex CLI.
- Start a new Codex session, then ask it “what project am I in?”. It should name your project.
- Once remote checks are on for your account (how), the check tool is listed in that same connection. Ask the agent to run your tests, for example
npm test, and it can send the run to MachineStream.
Prefer to write the configuration yourself? The exact file and contents for each client are in ContextStream's manual setup; the full guide is Connect your assistant.
ContextCode
ContextCode has MachineStream built in, off by default. Run /mc on to turn it on for your account; /mc says whether it's on and which kinds of checks go, /mc engines picks them, and /mc why followed by a command says where it would run and why.
Supported commands
A command goes to MachineStream when it matches a supported shape and the worker can match your toolchain. See the versions, matching rules and command examples in Supported languages, versions and tools.
Checks in a chain
The MCP sends the checkout once for a supported && chain. The worker runs each stage in order and stops at the first failure. Editors that request MCP progress see each stage as it starts.
npx prisma generate && npx tsc --noEmitnpx next typegen && npx tsc --noEmitnpx svelte-kit sync && npx svelte-check
How a check runs
- Your agent runs a command, say
npx vitest run, in your checkout. - The client sends what the server needs: the command, the folder, and your checkout as git sees it. The worker asks for files it doesn't have. A cold workspace may need most of the tracked files. Details in What a check sends.
- The gateway routes the check by language, into your account's isolated environment on an available worker.
- The worker runs the command. It can reuse installed dependencies, incremental type checks and build daemons. An exact repeat can use the saved result.
- The result comes back with the command's exit code. The MCP check tool reports progress while it runs and returns its result at the end. ContextCode maps paths in the output back to your checkout.
Failure diagnostics
The MCP returns a short report for failures it can identify. If the worker has a saved result for the same command on your base tree, the report puts new failures first and counts existing failures separately. It cites relevant ContextStream lessons, decisions or commits when it finds them.
ContextStream can save a build lesson when the same failure repeats in a repository or when a later check passes in the same directory. It scrubs credentials before saving the lesson. A matching lesson can surface in your next session.
Targeted checks
Ask your agent to verify your changes. The ContextStream MCP's verify tool (also ms_verify) reads the changed paths and uses the project's dependency and test graph to pick checks. It runs them remotely when available and falls back to your machine.
It widens to the full suite for lockfiles, migrations, auth code, shared test fixtures or configuration, a change with many dependents, or when it can't map the edit to tests. Ask for full verification before you finish a task (scope: "full").
Verification maps
Open Capsules in your ContextStream workspace with a project selected, then open Verification Map. Add or edit the command to run when a directory changes, or save a suggestion from past edits and checks.
Saved rules apply on the next targeted verify and appear when an agent opens the Live Capsule overview. The map flags missing directories, missing scripts and checks that repeatedly exit 75.
Compare worktrees in ContextCode
Run /worktree review candidate-a candidate-b -- cargo check to review several candidates. ContextCode checks them in parallel and ranks the results by exit status and new failures. It shows diffs only for candidates that passed without new failures. A check that can't run leaves that candidate out of review.
Pre-warming and speculative checks
Prepare a workspace
With remote checks on, the MCP can send :prepare in the background when a session starts. It sends the checkout and detected languages so a worker can prepare the workspace and install dependencies before the first check. Preparation is free. If it fails or the worker is busy, the session carries on.
Check after an edit
Speculative checks are off by default. After an edit the MCP hook sees, it waits for a pause, then can run lint, type checks or affected tests on a snapshot. Ask for the same check on the same tree and the saved result is free.
Set CONTEXTSTREAM_SPECULATIVE_CHECKS=on in the MCP hook's environment, or set speculative_checks to true with PUT /api/v1/mcp/hosted-tools/enabled. Include enabled: true to keep remote checks on. Set CONTEXTSTREAM_SPECULATIVE_CHECKS=off to override the account setting on one machine.
CONTEXTSTREAM_SPECULATIVE_DEBOUNCE_MSsets the pause. It defaults to 3,000 ms.CONTEXTSTREAM_SPECULATIVE_HOURLY_CAPdefaults to 30 credits per hour on this MCP install.CONTEXTSTREAM_SPECULATIVE_REPO_HOURLY_CAPdefaults to 15 credits per repository per hour.
The service also caps background runs at 100 credits per account per hour by default. You can still ask for a check after the background budget is spent. See Pricing.
Contract checks across repositories
When a remote check passes on edits to a shared contract, the MCP can also check up to four consumers. ContextStream finds consumers in the workspace's project graph or by shared contract paths. It checks each consumer's default branch with the edited contract in a temporary checkout. The consumer repository stays untouched. This works with contracts such as OpenAPI, protobuf, GraphQL, Avro, SQL and TypeScript declarations.
The source and consumers need to be indexed in the same workspace. Each consumer's GitHub connection must be able to read its default branch, and the worker needs that tree from an earlier run. Consumer compiler errors fail the check and come back in the same result. A consumer the worker can't verify is marked unverified.
Set CONTEXTSTREAM_CONTRACT_CHECK=off in the MCP environment to turn this off.
Receipts and gates
A passing remote check with verified usage can earn a receipt for the exact tree and command. Gates are off by default. Workspace owners and admins read and set them with GET and PUT on /api/v1/mcp/hosted-tools/gate-policy. To enable a gate, scope the request to a workspace or project and set require_verified_tree_before_push, require_verified_tree_before_pr or require_verified_tree_before_complete to true. Set required_command_families to name specific checks. Receipts count for 24 hours by default.
With gates on, supported editor hooks and ContextCode can hold a push, gh pr create or task completion until the exact tree has fresh passing receipts for the required checks. The MCP setup can install a Git pre-push hook that also checks pushes from the terminal. The message names the missing checks. Run them on that tree and retry. If the service is unreachable, the hooks let the action proceed. ContextCode also records receipt information in its ProofLedger for the tree it checked.
Verified capsules and handoffs
A Live Capsule overview can show a fresh passing check for the indexed tree, known base failures, or that the tree has drifted. Handoffs with a target tree can show the same verification state for that tree. Review Capsules can include selected verification receipts. The summaries use scrubbed check metadata.
Fallback and the ran-on line
MachineStream is built around one rule: give back the same exit code, the same passes and failures and the same output your machine would. When the server can't promise that, it doesn't guess. It answers “run it locally”, and the check runs on your machine exactly as it would have without MachineStream. That happens when:
- the command isn't a supported shape or asks to rewrite your source files;
- your project needs a tool version or environment the server can't match;
- your repository keeps files in Git LFS and the check fails on the server, which receives the LFS pointer files, not their content;
- the command fetches a tool while it runs (
npx,npm exec,pnpm dlx,yarn dlx,uvx) from a registry that needs your credentials; - a Python test can't import your own package on the server because your machine finds it through
PYTHONPATHor an editable install; - an install would fetch from somewhere other than a package registry (a Git dependency, for one);
- every machine that could take the check is busy or out of space, or MachineStream can't be reached.
A worker can return exit 75 to hand the check back. The result says why and where the check ran.
Matched to your machine
- Node: the version your project pins in
.nvmrc,.node-version, a.tool-versionsor mise file that names node, orpackage.json'sdevEngines.runtimeorvolta.node. FordevEngines.runtime, the server reads the range npm or pnpm would check on your machine: the workspace root's in a workspace, otherwise the package's own. When the worker doesn't have a compatible version, the check runs on your machine. See how versions are fetched and matched. - Locale: the server has C, POSIX and these UTF-8 locales: en_US, en_GB, en_CA, en_AU, en_IN, de_DE, de_AT, de_CH, fr_FR, fr_CA, es_ES, es_MX, it_IT, pt_BR, pt_PT, nl_NL, sv_SE, da_DK, nb_NO, fi_FI, pl_PL, cs_CZ, ru_RU, uk_UA, tr_TR, ja_JP, ko_KR, zh_CN, zh_TW, he_IL, ar_SA. A locale your session sets that isn't on the list runs the check on your machine.
- Time zone: ContextCode 0.7.394 and later sends your time zone's name when it isn't UTC, so a test about the local date runs in your zone.
What a check sends
This is how ContextCode sends a check, from ContextCode's own data-handling documentation. The MCP's check tool sends the same kind of data, your checkout's tree and changed files, and leaves out the same credential-like files.
Sent with each check
- The command as written, the folder inside the repository it runs in, and time limits.
- A repository key made from the folder's name and a short digest of its origin URL. The check sends the digest. The MCP also sends the checkout's absolute path for mapping output. ContextCode replaces that path before sending.
- Your checkout as git sees it on top of its last commit: the commit's tree id, and for each changed, added or deleted path its name, mode and content hash. The contents of changed and added files go with the call.
- Files of the last commit go only when the server says it lacks them. On a first check that can be most of the files git tracks.
- For each tool the command uses, the first line of
--versionwith your user name, home folder and machine name taken out, plus your operating system and architecture, the number of CPUs your session can use, whether it runs as root, and its open-file limit, so a test gets the same limits it would have on your machine. - From ContextCode 0.7.394, the name of your time zone (an IANA name such as
America/New_York, fromTZor from where/etc/localtimepoints), only when it isn't UTC. Nothing finer goes: no offset, no place. - These environment variables, and only when your session sets them: for Node and the terminal
NODE_OPTIONS,NODE_ENV,TZ,CI,FORCE_COLOR,NO_COLOR,TERM,COLUMNS; for the localeLANG,LC_ALL,LC_COLLATE,LC_MESSAGES,LC_NUMERIC,LC_TIME,LC_MONETARY; for RustRUST_BACKTRACE,RUSTFLAGS,CARGO_TERM_COLOR,CARGO_INCREMENTAL; for PythonPYTHONHASHSEED,PYTHONUTF8,PYTHONWARNINGS,PYTHONIOENCODING,MYPY_FORCE_COLOR,MYPY_FORCE_TERMINAL_WIDTH,RUFF_OUTPUT_FORMAT,DJANGO_SETTINGS_MODULE; for GoGOFLAGS,GOOS,GOARCH,CGO_ENABLED,GOEXPERIMENT, the Go architecture tuning variables for x86-64 and ARM64,GOTOOLCHAIN,GODEBUG,GORACE,GOMAXPROCS,GOGC,GOTRACEBACK; and, only with a check of that language, for .NETDOTNET_ENVIRONMENT,ASPNETCORE_ENVIRONMENT; for RubyRAILS_ENV,RACK_ENV,SPEC_OPTS,TESTOPTS,COVERAGE,PARALLEL_WORKERS; for PHPXDEBUG_MODE,PHPUNIT_RESULT_CACHE; for Ruby and PHPAPP_ENV; for C and C++CC,CXX,CFLAGS,CXXFLAGS,CPPFLAGS,LDFLAGS,MAKEFLAGS,CMAKE_BUILD_TYPE,CMAKE_GENERATOR,CMAKE_BUILD_PARALLEL_LEVEL,CTEST_OUTPUT_ON_FAILURE,CTEST_PARALLEL_LEVEL,VERBOSE. Deno can also sendDENO_JOBSand Elixir can sendMIX_ENV. Some settings keep a check on your machine, such asMAVEN_OPTSfor Java.
Left on your machine
- Everything
.gitignoreleaves out,node_modules, Cargo'starget, Python virtual environments and the__pycache__,.mypy_cache,.ruff_cacheand.pytest_cachefolders. - A changed or new file that looks like a credential is never uploaded:
.envfiles (except examples and templates), SSH keys,.pem,.key,.p12and similar, service-account JSON,.npmrc,.pypirc,.netrc, kubeconfigs, Terraform state, MCP config files, and files up to 1 MiB whose first 256 KiB hold a private key or an AWS key pair. The result names withheld paths. The worker uses the last committed copy of a tracked file whose changes were withheld. - Files already committed aren't withheld: if the server asks for the last commit's files, a committed credential goes with them, because it's in your history already.
What comes back, and what the server keeps
The command's output, exit status and result summary come back. The server keeps a warm copy of your checkout and the answers to past checks. It also keeps receipts for eligible passing checks. See Verification receipts.
Turning remote checks on
Remote checks are off until you turn them on, and every ContextStream account can. It is one account setting, so any of these turns them on everywhere: in ContextCode and in the ContextStream MCP, where the check tool then appears in Claude Code, Cursor and Codex without a restart.
- The setup. Its Remote checks step finds your project's languages, says which run remotely, shows the price and your balance, and turns them on when you press Enter.
- Your agent. Ask it to turn on remote checks; it can also say whether they're on and what they cost.
- A terminal.
contextstream-mcp remote-checks on, with--more-enginesfor the extra languages;contextstream-mcp remote-checks offturns them off. - ContextCode.
/mc on, and/mc offto turn them off.
Java and Kotlin, .NET, Ruby, PHP, C and C++, Bun, Deno, Dart, Elixir, Zig and Swift have a switch of their own, off by default: --more-engines, /mc more on in ContextCode, or the switch under Dashboard → Settings → Profile → Remote checks. All of them change the same account setting.
Checks are paid with your account's Context Credits by run time: see Pricing.
On one machine, CONTEXTSTREAM_HOSTED_TOOLS=off keeps every check local, in ContextCode and the MCP alike, whatever your account says.
Limits
- Checks run on Linux. A project that needs macOS or Windows to build or test should run those checks on your machine.
- Up to 4,000 changed files per check, 64 MiB in all and 16 MiB per file. Over a limit, the check runs on your machine.
- A check that starts more processes or threads than the server allows, which can be fewer than your machine allows, runs on your machine.
- Only the shapes in Supported commands run remotely. Commands that modify source files or use paths outside the checkout run on your machine.
cargo build,cargo runandgo run, which produce or start your program, always run on your machine.
FAQ
Can I use it today?
Yes. Every ContextStream account can turn remote checks on: here's how.
What does it cost?
1 Context Credit per half second of remote command time, rounded up per check. Cached results, pre-warming and local runs are free. See Pricing.
Is my code kept apart from other accounts?
Yes. Each account's checks run in an isolated environment of its own, with its own kernel, disk and network, and we test that boundary with hostile code. See Security.
Will my results differ from my machine?
That's the one thing MachineStream is built not to do. When the server can't match your machine it hands the check back, and it runs locally. See Fallback.
What if MachineStream is down?
Your checks run on your machine, as they did before. Nothing waits on us.
Where is the status page?
MachineStream runs on ContextStream's services: status.contextstream.io.