# Root Cause

> Removed global mutable cache state from the user configuration module. The previous implementation used module-level configfingerprint and configcache variables for a fast-path optimization that was likely premature for…

- Skill: `tools-only/root-cause-10` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tools-only/root-cause-10`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/root-cause-10/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tools-only (https://skillmd.com/u/tools-only)
- Updated: 2026-09-29
- Page: https://skillmd.com/skills/tools-only/root-cause-10

---


## Summary

Removed global mutable cache state from the user configuration module. The previous implementation used module-level `_config_fingerprint` and `_config_cache` variables for a fast-path optimization that was likely premature for configuration file handling.

## Context

The original `load_config()` function stored parsed config and its SHA-1 fingerprint in module globals to avoid re-parsing unchanged files. This added complexity and hidden state that could cause cache staleness issues.

## Root Cause

The fast-path optimization was unnecessary overhead for configuration files that:
- Are small (typically < 1KB)
- Are read infrequently (once per session or on demand)
- May change externally between calls

The cost of hashing and comparing fingerprints likely exceeded the cost of simply parsing the JSON.

## Changes

- Removed `_config_fingerprint` and `_config_cache` module-level globals
- Simplified `load_config()` to read and parse file directly
- Changed `save_config()` return type from `bool` to `None` (always returned `True`)
- Changed `set_default_model()` return type from `bool` to `None`
- Removed dead `except ConfigurationError: raise` code in `set_default_model()`

## Behavioral Impact

- Config loading is now simpler and more predictable
- No functional change in behavior - callers already handled `None` returns and exceptions
- Slightly more straightforward debugging with no hidden cache state

## Related Cards

- [[utils]] - Parent system

