---
title: "Run it from a clean checkout · Agent Wranglers"
url: https://agentwranglers.se/playbook/codebase-takeover/triage/run-from-clean-checkout
id: TKO-4
level: Recommended
updated: 2026-10-22
tokens: 773
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Run it from a clean checkout

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Triage](https://agentwranglers.se/playbook/codebase-takeover/triage.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: TKO-4
- Level: Recommended
- Chapter: [Triage](https://agentwranglers.se/playbook/codebase-takeover/triage.md)
- Rule: Make the inherited code build, run and pass its own tests on a clean machine, using only the repository and the secrets store.
- Check: In a fresh container, the documented command builds the app and runs its tests, without network access to the previous team's machines or accounts.
- How: Code that only builds on the previous developer's laptop cannot be fixed safely. Write down every step you needed, every missing setting and every version you had to guess, and turn them into a script. Pin the runtime version in the repository. This is [Keep the project runnable from a clean checkout](https://agentwranglers.se/playbook/ai-assisted-development/setting-up-the-project/runnable-from-clean-checkout.md) and [Get a new person running with one command](https://agentwranglers.se/playbook/engineering/documentation/readme-quick-start.md), done on day one. When the code lives only inside an AI builder, export it first, as [Own the code in your own repository](https://agentwranglers.se/playbook/ai-assisted-development/apps-built-with-ai-builders/own-the-code.md) says.

## Sources

- [The Twelve-Factor App on dependencies](https://12factor.net/dependencies)

## Related rules

- AID-3 [Keep the project runnable from a clean checkout](https://agentwranglers.se/playbook/ai-assisted-development/setting-up-the-project/runnable-from-clean-checkout.md) in AI-assisted development
- ENG-28 [Get a new person running with one command](https://agentwranglers.se/playbook/engineering/documentation/readme-quick-start.md) in Engineering
- AID-38 [Own the code in your own repository](https://agentwranglers.se/playbook/ai-assisted-development/apps-built-with-ai-builders/own-the-code.md) in AI-assisted development
- TKO-27 [Build the product from the company's own repository](https://agentwranglers.se/playbook/codebase-takeover/due-diligence/build-from-own-repository.md) in Codebase takeover

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/codebase-takeover/triage/run-from-clean-checkout">Agent Wranglers codebase takeover playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Take a backup and restore it before the first change](https://agentwranglers.se/playbook/codebase-takeover/triage/restore-before-first-change.md)
- Next: [Map the system before changing it](https://agentwranglers.se/playbook/codebase-takeover/triage/system-map.md)
- [Triage](https://agentwranglers.se/playbook/codebase-takeover/triage.md)
