跳到正文
DEV Community· Neos·· 2 小時前AI 評分22

Coding Agent 減少 token 消耗的做法

Burn less tokens

AI 導讀

作者分享一套供編碼智能體使用的 lessloc 方法,以減少 token 消耗,並稱目前基準測試結果良好。作者認為,AI 生成的程式碼越精簡,後期開發越容易維持;暴力式處理則可能令上下文膨脹,增加理解 3 個檔案的負擔。

正文

Cover image for Burn less tokens

Neos

Been testing and evaluating most of software developments principles for long-term maintainability and codebase quality with coding agents.

Feeling so irrating everytime I see a literal 5 comment lines for a function with 1 loop and 2 ifs. Made my own approach to hand over to agents, and so far the benchmarks yielded good results. Sharing with anyone who would want to try or giving some practices on how you burn less tokens with your coding agents, so I can add it to my approach: lessloc

Tbh, since the day of mainly relying on AI fully for implementation, I feel like the less code it produce, the better state the development be in later stages, lots of cases where AI do so much brute-force approachs making context bloating just to understand 3 files.

來源:DEV Community · dev.to