---
title: How I Used Codex to Fix an Item Count That Went Negative
tags:
    - Codex
    - Debugging
    - Game Development
categories:
    - AI Collaboration
date: "2026-08-21 20:00:00"
desc: "A simple bug became a useful lesson in where AI helps most: reproduce the problem first, then let it scan the details people tend to miss."
abbrlink: codex-negative-item
---
During development, an item's count became negative after a player used it. The problem was not complicated, but I missed it at first because a new item rule was unintentionally affecting the original item logic.

## Reproduce before guessing

I first skimmed the related code and reproduced the issue myself. Once the behavior was confirmed, I gave Codex the symptom and the code that provided the feature without leading it toward my own guess. I wanted it to inspect the context from scratch.

## The problem was a logic boundary

Codex found the cause quickly: the new item logic had contaminated the old logic. The fix was simple, but it was exactly the kind of low-level mistake that is easy to overlook when the code feels familiar.

I reproduced the original scenario again and reviewed the code path to make sure the fix addressed the cause, not only the visible symptom.

## Takeaway

AI is useful not only for hard problems. For repetitive, rule-based investigations where a human can easily skip a branch, it can be a very reliable second pair of eyes.

My workflow is simple: turn the issue into a verifiable behavior, provide enough feature context, and personally reproduce the result after the fix. I keep the judgment; Codex handles the detail scan.


---

**Author: **KK

**Article link: **[https://kiki.it.com/en/posts/codex-negative-item/](https://kiki.it.com/en/posts/codex-negative-item/)

This article is licensed under [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-nc-sa/4.0/).