Five Practices for Cleaning Up Old Configs After Upgrading Your Coding Agent

    When you switch to a newer, more capable coding agent, the configuration file you built for the previous model often becomes a liability. This article explains why outdated rules accumulate, and walks through five practices for a configuration cleanup: removing conflicting rules, using staged handoffs to counter long-context compaction, simplifying tool-calling rules, layering instructions by scope, and replacing rule stacking with iterative feedback. Follow them to cut wasted tokens, reduce interference with model judgment, and keep your agent a productivity tool rather than a new burden.

    1. Background: Why a Model Upgrade Should Trigger a Config Review

    When you use a coding agent, the prompt you type each turn usually occupies only a small fraction of the context window. What actually consumes most of it is the system instructions, tool definitions, skill descriptions, and conversation history. All of that stays in effect on every subsequent request, even when it no longer fits the task at hand.

    One widely overlooked fact: many developers keep a large pile of rules they originally added to patch weaknesses in an older model, and they keep them after upgrading to a stronger model. Those rules did compensate for real gaps at the time, but in front of a new model they are not merely redundant — they can actively interfere. Scenarios the model would have handled correctly get pulled off course by obsolete constraints, and errors become more likely, not less.

    So whenever a model generation changes, reviewing and trimming your configuration files should become a fixed step. The five practices below will help you do it systematically.

    2. Practice 1: Delete Conflicting Legacy Rules

    The typical path to a bloated config file is simple: hit a problem, append a rule. The model once wrote meaningless comments, so add “limit comments.” Worried the model would change too much, so add “only modify the specified files.” Over time, user-level global instructions, project-level instructions, and the current task instructions start contradicting each other.

    A concrete example: the global rule says “do not add any comments,” but the current task is precisely “add documentation comments to a public function.” You have handed the model two opposite instructions at once. Faced with that contradiction, the model spends extra reasoning tokens deciding which one to obey — and usually ends up following the earlier, more authoritative legacy rule, so the current task fails.

    The right approach:

    • Delete rigid code-style constraints and replace them with flexible instructions such as “follow the style of the existing code.”
    • Before adding a new rule, check whether it conflicts with rules already in place.
    • Periodically (for example, on every model upgrade) read the whole config file, with the goal of keeping it short enough to fit on one screen.

    A trimmed config file can look like this:

    1. # Global config (keep it short)
    2. - Follow the project's existing code style and naming conventions
    3. - Read the relevant files before modifying code
    4. - Ask when requirements are unclear instead of guessing

    3. Practice 2: Counter Capability Decay from Long-Context Compaction

    In long conversations, agents typically compress and summarize the history to control length. Compression inevitably loses detail, which shows up as the model “forgetting” earlier agreements, asking the same questions again, or drifting from the goal — the phenomenon commonly called capability degradation.

    One field-tested mitigation is a “staged handoff”: at the end of each work phase, have the model write down the key information itself, including:

    1. Current goal: what this phase was meant to accomplish;
    2. Key decisions: which trade-offs were made and why;
    3. File paths: which files are involved and what each one is responsible for;
    4. Pending items: where the next phase starts.

    Then start a brand-new session with that handoff record as the starting point. The new session has a clean context with high information density, so the model does not have to “excavate” through heavily compressed history, and output quality is noticeably more stable.

    A handoff prompt can look like this:

    1. Please summarize this session:
    2. 1. Work completed and key decisions
    3. 2. File paths involved and what changed in each
    4. 3. Outstanding items and the next step
    5. I will use this summary to start a new session and continue.

    4. Practice 3: Keep Tool-Calling Rules Simple

    Many developers pack tool rules with examples, hoping the model will copy the pattern. For a new-generation model, too many examples create two problems: they consume context tokens, and the model may mechanically reuse the concrete values from the examples (file names, paths, numbers), producing low-level mistakes.

    The better approach:

    • Delete redundant examples and state the calling rules and constraints for the interface directly;
    • Spell out what each parameter means, its allowed range, and whether it is required;
    • If you must keep an example, keep a single minimal one with placeholder values.

    For instance, instead of writing five full call examples for different scenarios, write clearly:

    1. When calling the file-reading tool:
    2. - path must be an absolute path
    3. - For large files, read in pages using offset and limit
    4. - If you are unsure whether a file exists, call the directory-listing tool first

    Letting the model reason from rules rather than imitate examples produces a lower error rate.

    5. Practice 4: Layer Instructions by Scope

    One root cause of instruction conflicts is muddled layering. Keep instructions clearly separated by scope:

    • User level (global): only genuinely cross-project preferences, such as reply language and overall code-style principles;
    • Project level: that project’s architecture constraints, directory structure, and build and test commands;
    • Task level (current session): the specific requirements of this task.

    The core principle of layering: lower-level instructions should be more specific, higher-level instructions should be more abstract and fewer. If you find a global rule that keeps getting overridden by project rules or task instructions, it does not belong at the global level in the first place.

    6. Practice 5: Replace Rule Stacking with Iterative Feedback

    When the model misbehaves occasionally, the first instinct of many people is to add a rule. A better move is to first identify the nature of the problem:

    • If it is a model capability gap that the new model has already solved — delete the corresponding rule;
    • If the task description is unclear — improve the prompt for the current task rather than adding a global rule;
    • If it is a project-specific constraint — put it in the project-level config with a short reason.

    Including the “why” matters a lot. Compared with “do not do X,” writing “in this project X causes Y, so please avoid it” helps the model make more sensible judgments in edge cases instead of applying the prohibition mechanically.

    7. Summary

    More configuration is not safer configuration. For a coding agent whose capabilities keep improving, outdated, duplicated, and conflicting rules consume extra tokens, interfere with the model’s judgment, and ultimately degrade output quality. The five practices above — clearing conflicting rules, using staged handoffs against context compaction, trimming tool-calling rules, layering instructions by scope, and replacing rule stacking with feedback iteration — form a configuration maintenance methodology you can apply directly. Make “model upgrade means a config checkup” part of your regular development workflow, so the agent stays a productivity tool rather than a new burden.