Lesson 2.1 · Your first session · 3 of 8
Set up Devin's environment before your first task
Connect your repository, let Devin propose its own setup, and understand the snapshot every session starts from. This is the step that decides whether Devin can check its own work.
By Trevor Lowing, Devin Ambassador
Checked against Devin's documentation on 2026-11-12
After this lesson you can
- Connect a source control provider and give Devin access to a repository
- Have Devin propose and build its own environment
- Explain what a snapshot is and why session changes do not persist
Most disappointing first sessions fail for the same reason: Devin was handed a task before it had an environment where it could build and test the project. Do the setup first.
Read the steps as text
- Connect source control. Settings > Connections. Choose the repositories Devin can access.
- Ask Devin to set itself up. Send “Set up your environment for this repo.”
- Approve the suggestions. Devin proposes a blueprint as cards in the timeline.
- Devin builds the snapshot. Future sessions boot from this image.
- Add secrets if needed. Stored encrypted. Devin cannot discover credentials on its own.
- Connect source control. Settings > Connections. Choose the repositories Devin can access.
- Ask Devin to set itself up. Send “Set up your environment for this repo.”
- Approve the suggestions. Devin proposes a blueprint as cards in the timeline.
- Devin builds the snapshot. Future sessions boot from this image.
- Add secrets if needed. Stored encrypted. Devin cannot discover credentials on its own.
1. Connect your source control
Go to Settings > Connections and connect GitHub, GitLab, Bitbucket or Azure DevOps. During setup you select the repositories Devin can access. Devin cannot clone or build a repository until this access exists. On Enterprise, an admin connects the provider and assigns repositories to each organization.
2. Let Devin propose the setup
Start a session and send this prompt:
Set up your environment for this repo.
Devin inspects the codebase and works out the tools, runtimes and dependencies it needs. It then proposes a blueprint, shown as suggestion cards in the session timeline. Approve the cards you want.
3. The snapshot
Devin runs a build from the approved blueprint. The result is a snapshot, which the docs describe as a “frozen, bootable image of the environment.” Four rules follow from that:
- Every session boots a fresh copy of the snapshot, so each one starts from the same clean state.
- Changes made during a session do not persist back to the snapshot.
- When the configuration changes, a new snapshot is built automatically.
- Each organization has one active snapshot per platform. Linux is the default, and Windows or macOS can be added.
The second rule explains a common surprise. Something Devin installed in one session is gone in the next. That is by design. If you need it every time, put it in the configuration.
4. Secrets and settings
Values that are not sensitive go in the blueprint as environment variables. Sensitive values go in the blueprint editor’s Secrets tab, where they are stored encrypted. The docs are direct about why this matters: Devin cannot discover credentials on its own.
Why this is worth the time
Once the environment builds, Devin can run your lint, your compiler and your tests as part of its normal work. An agent that can run the test suite behaves very differently from one that can only write code that looks right.
Next
With the environment ready, the next lesson runs a first task: plan it in Ask mode, then hand it to Agent mode.
Check what you learned
3 questions. Nothing is recorded.
-
Show the answer
Settings > Connections. Source control is connected once under Settings > Connections, where you also choose which repositories Devin can access.
-
Show the answer
No. Each session boots a fresh copy of the snapshot. Changes made during a session do not persist back to the snapshot. Anything permanent belongs in the environment configuration.
-
Show the answer
A change to the environment configuration. A new snapshot is built automatically when your configuration changes.
Sources
From Devin Central — subscribe for Devin news, features & tutorials. Devin is a trademark of Cognition.