---
title: "Characterization tests · Agent Wranglers"
url: https://agentwranglers.se/playbook/codebase-takeover/characterization-tests
parts: 3
tokens_total: 2394
updated: 2026-10-22
tokens: 548
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Characterization tests

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 changing inherited code, record what it does today in tests. Keep known bugs pinned until their own fix, and cut seams to reach hard code.

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

## Recommended

- TKO-8 [Pin today's behaviour before changing code](https://agentwranglers.se/playbook/codebase-takeover/characterization-tests/pin-behaviour-first.md) · 1,054 tokens · updated 2026-10-22
  Before you change a module, write tests that record what it does today for the inputs it gets in production. They must pass on the code as it is now.
- TKO-9 [Keep known bugs pinned until their own fix](https://agentwranglers.se/playbook/codebase-takeover/characterization-tests/pin-known-bugs.md) · 579 tokens · updated 2026-10-22
  When a characterization test records a bug, keep the buggy output as expected and link the test to a ticket. Fix the bug in a separate change that updates that one test.
- TKO-10 [Cut a seam before testing hard code](https://agentwranglers.se/playbook/codebase-takeover/characterization-tests/cut-a-seam.md) · 761 tokens · updated 2026-10-22
  When code reads the clock, the network, the database or a global directly, make the smallest change that lets a test pass that dependency in. Make no other change in the same step.

- Previous: [Triage](https://agentwranglers.se/playbook/codebase-takeover/triage.md)
- Next: [Rewrite or refactor](https://agentwranglers.se/playbook/codebase-takeover/rewrite-or-refactor.md)
- [All chapters](https://agentwranglers.se/playbook/codebase-takeover.md)
