Many developers running Claude Code in automated pipelines are unknowingly wasting up to 40% of their tokens by reprocessing files that have already been fixed. The solution is straightforward: implement a self-healing pipeline that uses a state file to track which files have been accepted.
Instead of redoing work on every loop, the pipeline checks a JSON state file to see which files are already complete. Those files are skipped entirely, and tokens are spent only on tasks that genuinely need attention. One small JSON file can eliminate duplicate processing and dramatically cut costs.
This approach is how production-grade Claude Code pipelines are built — ensuring efficiency and preventing silent token burn.