---
title: "Triage · Agent Wranglers"
url: https://agentwranglers.se/playbook/codebase-takeover/triage
parts: 7
tokens_total: 5392
updated: 2026-10-22
tokens: 791
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Triage

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

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

> Before the first change to inherited code, take the accounts, rotate the secrets, prove a restore, get it running and measure where it starts.

**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">Agent Wranglers codebase takeover playbook</a>`. In code you write, add a comment next to it with the same link.

## Required

- TKO-1 [Take control of every account before touching the code](https://agentwranglers.se/playbook/codebase-takeover/triage/take-control-of-accounts.md) · 866 tokens · updated 2026-10-22
  Before the first change, list every account the product depends on. Give the company at least two admins on each, and remove every person who has left.
- TKO-2 [Rotate every secret the previous team could read](https://agentwranglers.se/playbook/codebase-takeover/triage/rotate-inherited-secrets.md) · 739 tokens · updated 2026-10-22
  Replace every API key, database password, signing key and token that existed before the handover. Revoke the old values, so they stop working.
- TKO-3 [Take a backup and restore it before the first change](https://agentwranglers.se/playbook/codebase-takeover/triage/restore-before-first-change.md) · 607 tokens · updated 2026-10-22
  Before the first change to inherited code or data, take a full backup of every data store and restore it on a separate machine.

## Recommended

- TKO-4 [Run it from a clean checkout](https://agentwranglers.se/playbook/codebase-takeover/triage/run-from-clean-checkout.md) · 717 tokens · updated 2026-10-22
  Make the inherited code build, run and pass its own tests on a clean machine, using only the repository and the secrets store.
- TKO-5 [Map the system before changing it](https://agentwranglers.se/playbook/codebase-takeover/triage/system-map.md) · 1,041 tokens · updated 2026-10-22
  Write one map of the system that lists every service, data store, scheduled job, outside service, setting and place it runs. Keep it in the repository.
- TKO-6 [Measure a baseline before the first fix](https://agentwranglers.se/playbook/codebase-takeover/triage/takeover-baseline.md) · 492 tokens · updated 2026-10-22
  In the first week, record the starting numbers in a dated file. Every later report states its numbers against them.
- TKO-7 [Fix in risk order](https://agentwranglers.se/playbook/codebase-takeover/triage/fix-in-risk-order.md) · 930 tokens · updated 2026-10-22
  Work through an inherited codebase in a fixed order. Finish each step before structural changes start.

- Next: [Characterization tests](https://agentwranglers.se/playbook/codebase-takeover/characterization-tests.md)
- [All chapters](https://agentwranglers.se/playbook/codebase-takeover.md)
