Skip to main content
The explore agent reads a git diff and determines what changed for the user, then proposes (or builds) Momentic tests to cover it. Reach for it to keep coverage current with the product without someone remembering to write a test for every pull request.
The explore agent is in beta and may change.

What it does

Given a base and head ref, the agent:
  • Diffs the two refs and identifies user-facing changes. These are not always frontend edits: a backend change that surfaces to the user counts, and the agent reasons about which parts of the app are affected and how.
  • Maps each change to the user journeys it touches.
  • Checks existing tests for coverage. When a test already partially covers a journey, it proposes an edit to that test rather than a brand-new sibling.
  • With --build, opens a live browser session and authors or edits the tests, drawing on your knowledge base for terminology and flows.
The agent’s analysis is read-only with respect to your application code. It describes observable behavior and the test-coverage implication; it does not propose product code changes.

Discover vs. build

Without --build, the agent only discovers and logs the changed journeys. This is the safe default for inspecting what it would do:
npx momentic ai explore --base main --head HEAD
With --build, it authors or edits tests for each discovered journey:
npx momentic ai explore --base main --head HEAD --build
When run in CI (GitHub Actions, CircleCI, GitLab, Buildkite, Azure DevOps), --base and --head default to the current pull request’s base and head, so you usually do not pass them. See Author tests from a diff in CI for a ready-to-use workflow. You can steer the agent with --prompt (or --prompt-file to load the prompt from a file), or set a default custom prompt in Settings > Explore.

Seed coverage for the whole app

A diff is the usual starting point, but you can also explore the entire product at once with --seed. Instead of a commit range, the agent maps the whole app and self-replicates into child explorers, one per surface, so a new project can go from zero to a baseline of coverage without a diff to anchor on. --seed ignores --base and --head.
npx momentic ai explore --seed --build

Ground the agent in the running app

By default the explorer reads your repository (git history and files) to reason about changes. Two flags shift it toward the running app instead:
  • --browser hands the agent a live browser session, starting on a blank page, that it can navigate freely to ground its analysis in what the app actually does.
  • --no-code removes the agent’s git and filesystem access entirely, forcing it to earn coverage through the browser. It implies --browser.

Control how deep it goes

--granularity sets how specific the proposed test plans are:
LevelCoverage
lowHeadline journeys only.
mediumAdds common secondary flows and key error states. The default.
highExhaustive, down to individual UI elements, options, and states.
The flag overrides the per-project default; leave it unset to use the project config (medium if not configured). --timeout caps the wall-clock budget for a run (default 15 minutes). On timeout the agent stops and emits whatever partial results it has rather than running indefinitely, which keeps a stuck build from consuming a full CI job.

What happens to the tests

When --build writes tests, the On successful explore behavior in Settings > Explore decides the outcome:
BehaviorWhat it does
Pull requestOpens a pull request with the new and edited tests.
Draft pull requestOpens a draft pull request.
Direct commitCommits and pushes, except on main or a protected branch (draft PR).
PatchPrints a git patch to stdout to apply with git apply.
Leave on diskWrites the changes without committing or opening a pull request.
Pull requests are pushed to a momentic-explore/ branch. Because the output is a reviewable PR, generated coverage lands in the same review flow as any other change rather than appearing silently.