Connect the repository
Open Runs, click Connections and add the repository, or use the terminal:
git@host:org/repo, or as org/repo for GitHub.
GitHub and GitLab repositories get pull requests. Working on an existing pull request is for GitHub repositories for now.
Start the run
In a checkout, the repository defaults to the checkout’s origin and the branch to the one you are on:How Sensei sets up
Sensei picks an image, setup commands, a test command and the services the tests need from the repository, and reports the basis for each choice in the run’s timeline.
Override the test command with
--test-command. In a definition, check sets the test command and image sets the image.
A sensei.yaml file at the root of the repository sets any of these for every run on it, and is used before what Sensei works out. Values and tokens the tests or the setup need are given to the project as settings and secrets. See Services, settings and secrets.

How a change is verified
The tests run before any change, so Sensei knows what already fails. After the change they run again, on the test files as they were at the start.
A run whose tests cannot pass because the project was not given a value they need ends Failed before any model call and names the value. See When a run is missing a value.
If the change edits test files, Sensei restores them to the starting commit before the check and says so on the run. The result is against your original tests. A run whose task is about the tests is told it may edit them, and the same restore applies.
Lint and format checks
When a CI workflow runs a lint or format check, the run does too: once before any change and once on the finished change, test files included. Each check is listed under the verdict with what it printed when it does not pass.
A command that rewrites code, such as
ruff check --fix or prettier --write, is never run as a check. Type checkers are not run.
More than one attempt
--attempts 3 runs up to five independent attempts from the same starting point and keeps the best: a verified change first, then an unverified one, then a failed one.
How the change is delivered
By default Sensei pushes a branch namedsensei/<run id> and opens a pull request. The pull request body has the task, what changed, the verification verdict and the diff summary.

Fix an open pull request
Several changes at once
To hand off several changes to the same repository, start them as one batch. Each is worked alone from the same commit, and the verified changes are tested together before the pull requests open. See Several changes at once.Ask a question
A task that asks about the repository gets an answer and no change:A saved agent on a repository
A definition can name its repository, so the team runs the same work by name:sensei check and sensei push say which repository the definition names and whether it is connected. A definition that names none starts on an empty computer, or on the repository you pass with --repo when you run it.
An agent that works on a repository cannot also list tools or use a browser. Do that part in a step before it and pass what it finds as input. See Steps.