r/javascript • u/Upper_Gold_3664 • 10h ago
update: my context-waste CLI now blocks the read before it happens
https://github.com/WJDdidi-1/dev-doctor
0
Upvotes
r/javascript • u/Upper_Gold_3664 • 10h ago
•
u/Upper_Gold_3664 10h ago
last week I posted Node burning 47.5M tokens of agent context on files nobody wrote. the two most useful comments said: scan via git ls-files, and stop the read with a PreToolUse hook instead of just measuring it. so that's what it does now.
sanity check on a fresh prettier clone: git scan and the old walk agree exactly, 9,776 files, score 96. nothing lost, just less junk to chase.
npx dev-diagnosis-cli all. hook setup is in the README.
follow-up to last week's post: https://www.reddit.com/r/javascript/comments/1xygst8/nodejs_wastes_475m_tokens_of_agent_context_on/
•
u/LukaRozman27 7h ago
If you use process.stdin, set process.stdin.pause() early or the read fires anyway on some shells.