News for hackers. Stuff that matters.

Luseniik

Re:Reduce Claude Token Usage by 50% on Friday February 27, 2026 @07:48AM (#47179910)
This is a really sharp breakdown.

The "what's here" vs "what happened" framing is exactly right. HAM's CLAUDE.md files handle the first — conventions, stack decisions, patterns. We have a .memory/ layer (decisions.md, session logs) for the second, but your ledger approach sounds like it handles "what happened" more cleanly than what we're doing. 40k down to 3k cold-start is a serious number. Would love to hear more about your NDJSON setup if you're open to sharing.

The governance point is the one that sticks with me most. Right now HAM is permissive — the agent reads context files but nothing constrains what it can scan beyond that. Your 3-hook pipeline that scopes the context window before the agent starts is a stronger guarantee. Curious what the three hooks are and how you handle edge cases where the agent needs context outside its scoped window mid-task.

On multi-agent conflict — context files are read-only during sessions. The agent never writes to them. Conflicts happen when two developers update the same CLAUDE.md, which resolves at the git/PR layer.

Our approaches seem complementary more than competing. The ledger and directory-scoped files could work together well. Down to compare notes if you're interested.

Re:Reduce Claude Token Usage by 50% on Friday February 27, 2026 @07:45AM (#47179891)
Good question and appreciate the thoughtful framing.

--resume and planning mode solve different problems than HAM. --resume carries forward one session's state. Planning mode structures one task. Neither gives the agent persistent knowledge about the codebase across sessions, across tasks, or across developers.

If you start a fresh session tomorrow in src/api/, --resume doesn't help unless you're literally continuing yesterday's session. HAM means every new session in that directory starts with the right context — conventions, patterns, decisions — regardless of what came before.

They're complementary. I use all three together.

The file count concern is fair though. Not every directory needs a CLAUDE.md. v0.2 adds a routing section in the root file that maps which directories actually need context files. So instead of scattering them everywhere, you're explicit about which folders the agent frequently works in and only those get context files. Fewer files, higher quality.

Re:Reduce Claude Token Usage by 50% on Thursday February 26, 2026 @11:38PM (#47176579)
AI coding agents are stateless. Every new session, they re-scan your entire codebase to figure out where they are. That burns thousands of tokens before writing a single line of code. I hit this building my own products. So I built HAM. HAM gives agents scoped memory files at every directory level. Instead of re-reading everything, the agent reads a small file that says what's here, what decisions were made, and what happened last session.
Re:Green Eggs and HAM (Hierarchical Agent Memory) on Thursday February 26, 2026 @11:31PM (#47176538)
I do not like them in my code. I do not like them, token load. I do not like re-reading files. I do not like re-learning styles. So I built HAM (Hierarchical Agent Memory).

Every Claude Code session, your agent burns 5,000–15,000 tokens just getting oriented. Re-reading your project. Re-discovering conventions. Re-proposing decisions you already rejected. One dev had 76K in a single CLAUDE.md eating 47% of his context window. Every request.

HAM replaces one bloated file with scoped memory.

Before: 5,000–15,000 tokens/request. After: 300–800. The system is self-maintaining. Agent creates memory files as you build.

Zero dependencies. Open source. For token-poor builders and small teams. Would you eat them in a box? Would you eat them with a fox?

No. You'd go HAM.