logoalt Hacker News

simonwyesterday at 10:59 PM4 repliesview on HN

I'm fed up with compaction. I want my agent to get compacted but also retain full access to the prior conversation via search and tool calls - I want it to know "the requirements for X were discussed in detail previously in conversation C51E31CE-C985-4633-A749-DCC9805A7FEB" and have a tool that lets it dispatch a subagent to find those details again.

Do any of the coding agents have this already?


Replies

smagnusotoday at 4:52 AM

Hydra is an agent in spirit, but actually wraps other agents through ACP. It drives its own async compaction algorithm that gives the agent it wraps full access to history that it can search as an MCP server after compacting.

https://github.com/smagnuso/hydra-acp

wild_eggtoday at 1:40 AM

This one does agentic search instead of compaction: https://github.com/wedow/harness

Generally works quite well but it allows nested subagents and that can use a lot of tokens if the agent prompts are too open-ended.

All messages are persisted as separate markdown files under a session directory, which makes them much more friendly to grep and such than the common jsonl files are. Agents can search them rapidly without messing around with jq.

Also written in Bash so it runs on any old potato you have laying around.

weitendorfyesterday at 11:40 PM

Claude Code makes agents reasonably aware of where their log files/history/etc are and get stored. Generally they’ll work with them without explicitly being told (especially to recover broken sub agents, corrupted sessions, etc) to do so.

I think the more general problem is that compaction is just a bandaid: you HAVE to dump context to keep going and searching back for it is more expensive than if you had just kept the right context. The better a job the harness does at filtering out junk, the more likely compaction is to remove context that might have been, forgive me, “load bearing”

IMO the default Claude Code / Codex (which to my understanding is almost continually-compacting?) compaction has got much better over the part few months. If you spam sub agents then context will naturally nest, and you can just resurrect them as needed without polluting the main thread.

auspivtoday at 1:38 AM

“Search session history for when we discussed XYZ”

https://github.com/nerdyaustin/memory_mcp

You can skip all the sync stuff, not necessary at all