EcoCode
Automated AI auditing to cut carbon and cloud cost
Created on 30th December 2025
•
EcoCode
Automated AI auditing to cut carbon and cloud cost
The problem EcoCode solves
Modern Python development, particularly in AI/ML, often produces "carbon-heavy" code through inefficient loops and redundant model loading. EcoCode automates the detection of these sustainability anti-patterns using AST-based analysis.
By integrating directly into the Kiro IDE via Agent Hooks, it transforms a manual auditing process into a real-time, "green-guard" workflow. Developers use it to:
Identify Inefficiencies: Automatically catch expensive nested loops or unbatched inference on file save.
Reduce Costs: Use AWS Pricing MCP data to quantify real-world dollar and CO2 savings.
Ensure Reliability: Rely on 21 formally verified properties for consistent, safe refactoring plans.
Challenges we ran into
Our primary challenge was heuristic over-aggressiveness; the analyzer initially flagged standard string-building loops in the Reporter as high-severity inefficiencies. This resulted in misleading Green Scores of 0/100 for well-written code.
To resolve this, we utilized Kiro’s Spec-Driven workflow to refine our AST detection thresholds, specifically excluding common formatting patterns. We also implemented a "Kiro-native" exclusion feature (# ecocode: ignore), allowing developers to bypass false positives manually. Finally, we verified the fix by passing 21 property-based tests, ensuring the analyzer remained rigorous without being obstructive.
Tracks Applied (1)
AWS
AWS
