I added one hook to Claude Code, and it stopped making the same mistake twice
Hooks really change the game.
A user of Claude Code found a way to prevent the AI from making the same mistake multiple times by adding a hook. According to XDA Developers, the user had tried including instructions in the prompt and updating the CLAUDE.md file, but the AI would still repeat its mistakes. The hook was added to make Claude revisit its mistakes and check if it had repeated any of them.
The user had installed numerous skills, agents, and commands into Claude Code, which resulted in a significant cost. As reported by Dev.to, the user had installed 107 skills, 38 agents, and 15 commands, costing 9,857 tokens per session. The user noted that the cost is not just for the skills used, but also for the descriptions of all installed skills, agents, and commands, which sit in the context window for the whole session.
The user also shared a script to calculate the cost of the Claude Code configuration before typing anything. The script, called "cc-tax," can be run against the home directory to determine the cost.
Brief written by urgent.news from XDA Developers, Dev.to — 2 reports on this story. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.
- My Claude Code config costs 9,857 tokens before I type anything dev.to
- Top AI tools including Claude, Codex, and Hermes installed suspicious code inside corporate networks techradar.com
- Anthropic will "permanently" raise weekly Claude Code limits by 25% on Sept. 14 for most plans, which will work out a 17% reduction, given the current 50% boost (@claudedevs) x.com
- I gave Claude Code, Codex, and Cursor the same memory, and stopped repeating myself xda-developers.com