Devin — AI Software Engineer Cheatsheet
Set up and operate Devin, Cognition's autonomous AI software engineer: connect repositories, configure the environment snapshot, run Ask-to-Agent sessions, move work between the Devin CLI and cloud VMs, and automate recurring tasks.
Devin — AI Software Engineer Cheatsheet
One-line: Devin is Cognition’s autonomous AI software engineer — give it a scoped task and it plans, codes, tests, and opens pull requests on its own cloud VM, with a Devin CLI for local work that can hand off to the cloud.
Prerequisites
- A Devin account — sign up at app.devin.ai (Free, Pro, Max, and Teams self-serve plans; Enterprise via Cognition)
- Admin rights on your GitHub organization to connect repositories (or the equivalent on GitLab 15.0+, Bitbucket, or Azure DevOps)
- Optional: a supported terminal for Devin CLI — see the terminal compatibility docs in Reference
Installation
Devin has two surfaces. Cloud Devin needs no install — everything starts at app.devin.ai. For the terminal:
# Install Devin CLI — a local agent with deep Devin Cloud integration
curl -fsSL https://cli.devin.ai/install.sh | bash
# Restart your terminal, then authenticate
devin auth login
devin --version # prints the installed version
devin # start an interactive session in the current directory
Devin CLI and cloud Devin are separate tools: the CLI edits your local files, while cloud sessions get a dedicated VM with a shell, IDE, and browser. Knowledge, Playbooks, and Secrets are cloud-side features the CLI does not yet support.
Step-by-Step Setup & Optimization
Step 1 — Connect repositories and index your code
- In the web app, open Settings → Connections → GitHub, click Add Connection, and grant access to All repositories or Select repositories (GitLab, Bitbucket, and Azure DevOps follow the same flow).
- Enable code search: go to Settings → DeepWiki → Repositories, click Add, and pick the repositories to index.
- Wait for each repo’s status to move from Indexing… to Indexed — a few minutes depending on size.
Index the branches your team actively develops on so Ask Devin and DeepWiki stay current.
Step 2 — Configure the environment snapshot
The docs call this the single highest-leverage thing you can do to improve Devin’s effectiveness.
- Start a session and ask: “Set up your environment for this repo.”
- Review the blueprint Devin proposes as suggestion cards — approve the ones that match your stack.
- Let the build finish: it produces the snapshot every session in your organization boots from.
- Add credentials at app.devin.ai/secrets (organization or personal scope), or per-repo in the blueprint editor’s Secrets tab — sessions reference them as environment variables like
$MY_SECRET.
Never put secret values in blueprint YAML, setup commands, or committed .env files — store them in the Secrets tab and reference them by name.
Step 3 — Run your first task: Ask → Agent
- Toggle Ask mode, select the repo(s), and scope the task — Ask Devin cites code and builds a context-rich prompt without touching code.
- Click Send to Devin to move into Agent mode, which executes the plan on a cloud VM.
- Structure prompts as directive + context + verification: what to change, which patterns or files to follow, and the exact check that proves it works.
- Watch progress on the session page; take over in the embedded IDE, shell, or browser if needed.
Rule of thumb from the docs: if a task would take you three hours or less, Devin can most likely do it. Split bigger work into parallel sessions.
Step 4 — Bridge local and cloud with Devin CLI
-
Start local work from a project directory:
devin # interactive session devin -p "summarize this repo" # single-shot: prints and exits -
Start or resume cloud sessions — they keep running when you close the laptop:
devin --cloud # new cloud session devin --cloud -r # pick a recent cloud session to resume devin ssh <session-id-or-url> # shell on the session's VM -
Inside a session,
/handoffships the local session to the cloud (conversation context and uncommitted diff included); in a cloud session,/handoffor/pickupchecks out the PR branch and continues locally./openopens the session in the web app.
devin --version prints a version number, and /handoff returns a cloud session URL that opens in the web app.Step 5 — Teach Devin your conventions
- Add an
AGENTS.mdat each repo root — Devin auto-injects it into cloud sessions (automatic injection is capped at 16 KiB; see the agents-md doc). - Open app.devin.ai/customize and install marketplace plugins — bundles of skills, rules, hooks, and MCP servers — at personal, organization, or enterprise scope. From the CLI:
devin plugins install <source>. - Save repeated task prompts as Playbooks, then attach them with a
!macroor a.devin.mdfile at session start. - Connect external tools under the MCPs tab (Datadog, Sentry, Figma, databases) so sessions can reach them.
/<plugin>:<skill>.Knowledge is deprecated and being migrated to Skills in Plugins — author new context as skills and rules, not Knowledge items.
Step 6 — Close the loop: reviews, comments, automations
- On any open PR in a connected repo, comment
/devin fix the failing lint check— Devin starts a session and replies with a link (/devin reviewtriggers Devin Review). - Enable Devin Review with Auto-Fix so Devin responds to review comments and iterates on CI failures automatically.
- Build an automation (Automations → Create automation): pick a trigger — GitHub check-run failure, Slack message or reaction, Linear or Jira event, Schedule, Webhook — and an action (start a session, message a session, or run a triage monitor).
- Run independent tasks in parallel sessions — there is no concurrent session limit.
/devin PR comment or a scheduled run — spawns a session that links back to the PR or thread.GitHub automations fire on private repos by default. Opting a connection into public repos raises prompt-injection risk — keep trigger conditions narrow.
Best Practices
Do
- ✅ Scope with Ask Devin first, then let Agent mode execute the generated plan.
- ✅ Put explicit success criteria and verification commands in every prompt.
- ✅ Keep sessions focused (XS–M in Session Insights); parallelize big projects across sessions.
- ✅ Store credentials as Secrets on a dedicated
[email protected]service account. - ✅ Encode team conventions in
AGENTS.md, skills, and rules; standardize repeated tasks as Playbooks. - ✅ Check Session Insights after runs and convert mistakes into rules or skills.
Don’t
- ❌ Paste secrets into prompts, blueprint YAML, or committed
.envfiles. - ❌ Leave design decisions open-ended — make judgment calls for Devin up front.
- ❌ Cram unrelated tasks into one session — it burns usage and degrades quality.
- ❌ Author new Knowledge items — the feature is deprecated in favor of Skills and Rules.
- ❌ Assume the CLI sees cloud-side features — Knowledge, Playbooks, and Secrets are web-only for now.
Quick Command Reference
| Command | Use |
|---|---|
devin | Start an interactive session in the current directory. |
devin -- <prompt> | Start the session with an initial prompt. |
devin -p "<prompt>" | Single-shot: print the response and exit. |
devin -c / devin -r [id] | Continue the last session / resume a session. |
devin auth login / status / logout | Manage CLI authentication. |
devin --cloud | Start a Devin Cloud session from the terminal. |
devin --cloud -r <url-or-id> | Resume a cloud session in the terminal. |
devin ssh <session> | Open a shell on a cloud session’s VM. |
/handoff | Move the task between local and cloud — works both ways. |
/cloud · /repo · /platform · /model | Configure a cloud session before the first message (SWE-2 recommended). |
/mode <name> | Permission mode: normal, accept-edits, smart, plan, bypass (autonomous under --sandbox). |
/plan · /ask | Plan-first and question-only agent modes. |
/loop <prompt> | Run a prompt, then auto-review the diff in a loop. |
devin plugins install <source> | Install a plugin into personal scope (--local for this machine only). |
npx devin-review <pr-url> | Run Devin Review on a PR from a local clone. |
/devin <prompt> | GitHub PR comment that starts a session (/devin review runs Devin Review). |
Expected Outcomes
- Repositories are connected and indexed — Ask Devin and DeepWiki answer with file citations.
- Every session boots from a snapshot with dependencies, tools, and secrets ready.
- The Ask → Agent workflow turns scoped prompts into draft PRs for roughly three-hour tasks.
- Devin CLI moves work between local and cloud with
devin --cloud,/handoff, anddevin ssh. - Team conventions live in AGENTS.md, skills, rules, and playbooks — not repeated prompt reminders.
- Automations and Devin Review Auto-Fix keep CI and review loops moving without manual steering.
- Usage stays controlled: short scoped sessions, automatic sleep after 30 idle minutes, and Session Insights for post-task review.
Reference
Sources & deeper reading
Official docs (facts and commands):
- Devin docs — llms.txt index
- Your First Session · When to Use Devin · Instructing Devin Effectively
- Index a Repository · Environment setup · AGENTS.md for Devin
- Secrets & Site Cookies · Plugins & Customize · Creating Playbooks · Automations
- GitHub integration · Usage & billing
- CLI: Quickstart · Essential Commands · Devin Cloud in the CLI · Handoff · Commands & Flags · Terminal compatibility
Community sources:
- Bringing Devin Cloud to your terminal — Cognition blog
- Thoughts on a Month with Devin — Answer.AI field test: scope tasks tightly, results vary on ambiguous work
- Devin AI — honest review after real production use — treat Devin as an async pipeline, not a pair programmer
Omitted areas (see docs): Devin API reference, Devin Desktop, Outposts self-hosted workers, Enterprise SSO/SCIM, macOS/Windows/Android environments, DeepWiki configuration, Security Swarm and Code Scans.