The explore agent reads a git diff and figures out what changed for the user,
then proposes (or builds) Momentic tests to cover it. Reach for it to keep
coverage in step 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.
What happens to the tests
When --build writes tests, the On success behavior in your config
(ai.explore.onSuccess) decides the outcome:
| Behavior | What it does |
|---|
| Pull request | Opens a pull request with the new and edited tests. |
| Draft pull request | Opens a draft pull request. |
| Direct commit | Commits and pushes, except on main or a protected branch (draft PR). |
| Patch | Prints a git patch to stdout to apply with git apply. |
| Leave on disk | Writes 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.