frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Fixing Claude Code's amnesia with persistent memory

https://github.com/agynio/claude-map-reduce-memory
1•NBenkovich•1h ago

Comments

NBenkovich•1h ago
Every few sessions I'd find myself typing the same thing again. "Auth token expiry is 900s not 3600s." "Don't use duck typing here, the object structure is already defined." After the fifth time I stopped blaming myself for not writing it down and started thinking there has to be a better way.

CLAUDE.md is manual — you maintain it. MEMORY.md is automatic but it only gets read once at session startup, it's scoped per repo so your cross-project preferences don't carry over, and once it gets long enough only the top N lines are read. Older notes just silently disappear from context regardless of how important they are. I had a note about a critical config value fall off the bottom and cost me an hour.

So the core idea: instead of a flat file, use a small LLM as memory. Store notes in the LLM's context window (system prompt), prompt it with what the agent is currently doing, and get back only the hints that are actually relevant right now. Not at startup — right before each tool call.

You write notes like this:

``` cmr-memory write "auth token expiry is 900s not 3600s" --when "working on auth, tokens, config.ts" ```

The `--when` field is a plain-language activation condition. The memory LLM reads the conversation transcript and decides if the condition matches the current context. It's not keyword matching — a note tagged "working on authentication" will surface when the agent is editing JWT middleware even if neither word appears in the recent transcript.

The tricky part is making this fast enough to run on every tool call without being expensive. One LLM call over all your notes doesn't scale — attention degrades in long contexts, costs add up fast, and you'd be waiting 5 seconds before every file read. The solution is splitting notes into small chunks and processing them in parallel with Haiku (fast, cheap, good enough for this job — you don't need Opus to decide if a note is contextually relevant). Each chunk lives in a stable system prompt that gets cached by Anthropic's prompt caching, so after the first call against a chunk it's mostly served from cache.

There's also a deduplication step — once a hint is in the conversation it's already there, so re-injecting it next tool call just bloats context for no reason. The system extracts what's already present and skips anything redundant.

The whole thing wires in via Claude Code's PreToolUse/PostToolUse hooks. PreToolUse fires before every tool call, reads the transcript, runs retrieval, injects hints. PostToolUse sends a short nudge asking if anything worth saving just happened — the agent decides whether to write a note, nothing is forced.

To set it up:

``` npm install -g @agynio/cmr-memory cmr-m

IxInfra•1h ago
This is really interesting, especially the chunking and parallel Haiku approach.

Curious how it holds up as note volume grows. At some point you're still doing N relevance checks per tool call. do you hit a scaling limit there or does chaching keep it manageable? Also wondering if you've seen any drift in relevance when notes become more numerous or overlapping

RFC Esolang – RFCs as executable programs

https://esolangs.org/wiki/RFCEsolang
1•beefburger•1m ago•1 comments

Austria Blocks Chinese JD.com's Acquisition of MediaMarkt

https://www.vindobona.org/article/austria-blocks-chinese-jd-com-rsquo-s-acquisition-of-mediamarkt...
1•doener•1m ago•0 comments

Chemical Endurance: The Pharmacology of Russian Military Stimulant Programs

https://www.ade.pt/chemical-endurance-the-pharmacology-of-russian-military-stimulant-programs/
1•A_D_E_P_T•2m ago•0 comments

Show HN: Memdir – local, file-based memory for AI agents

https://github.com/artiebits/memdir
1•artiebits•2m ago•0 comments

Keploy – Traffic-Based Automated API Test Generator

https://github.com/keploy/keploy
1•keploy•2m ago•1 comments

What's new in Swift: March 2026 Edition

https://swift.org/blog/whats-new-in-swift-march-2026/
1•frizlab•4m ago•0 comments

Meraki MX Security: How Cloud-Managed Firewalls Protect Multi-Site Networks

https://meraki.deal/blogs/news/meraki-mx-security-cloud-managed-firewalls-multi-site-networks
1•novbox•7m ago•0 comments

Show HN: Browserbeam – a browser API built for AI agents

https://browserbeam.com/
2•nyku•12m ago•0 comments

KPMG Faces Allegations of Blown Audit in Private Credit Collapse

https://www.bloomberg.com/news/articles/2026-03-31/kpmg-faces-audit-failure-allegations-over-brid...
2•toomuchtodo•12m ago•1 comments

1-bit LLMs are here

https://twitter.com/PrismML/status/2039049400190939426
1•mathewpregasen•12m ago•0 comments

Unhealthiest Foods on the Planet, According to Science

https://techfixated.com/100-unhealthiest-foods-on-the-planet-according-to-science/
2•benlarweh•12m ago•1 comments

Show HN: Postgres data cluster by meaning (semantic search and visualization)

https://github.com/varmabudharaju/pgsemantic
1•varmabudharaju•13m ago•0 comments

Game Pirates Beat Denuvo with Hypervisor Bypasses

https://torrentfreak.com/game-pirates-beat-denuvo-with-hypervisor-bypasses-irdeto-promises-counte...
1•ls612•15m ago•0 comments

NASA plans to send a nuclear-powered spacecraft to Mars in 2028

https://www.science.org/content/article/nasa-plans-send-nuclear-powered-spacecraft-mars-2028
1•mpweiher•19m ago•1 comments

Why Some Criticisms Matter More Than Others

https://gnupg.org/blog/20260320-some-criticism-matter.html
1•upofadown•19m ago•0 comments

Karakuri Mechanical Art

https://karakurist.jp/
2•marukodo•22m ago•0 comments

Show HN: Tama96 – A virtual pet for your desktop, terminal, or AI agent

https://www.tama96.com/
4•siegers•22m ago•0 comments

Clawbernetes. Infra to deploy agents fast with enterprise grade features

https://clawbernetes.org
1•augustinczw•23m ago•1 comments

Dial9: A Flight Recorder for Tokio

https://tokio.rs/blog/2026-03-18-dial9
1•lukastyrychtr•25m ago•0 comments

French Senate votes to block social media access for under-15s

https://www.lbc.co.uk/article/france-social-media-ban-vote-5HjdX8R_2/
3•austinallegro•26m ago•1 comments

Gest

https://gest.aaronmallen.dev/
2•aaronmallen•26m ago•0 comments

Why Your AI Agent Shouldn't Define Words

https://wordorb.ai/blog/why-your-ai-agent-shouldnt-define-words
1•nicoletterankin•26m ago•0 comments

Data centers' heat exhaust is not raising the land temperature around them

https://blog.andymasley.com/p/data-centers-heat-exhaust-is-not
2•loeg•27m ago•0 comments

Caltech Researchers Claim Compression of High-Fidelity AI Models

https://www.wsj.com/cio-journal/caltech-researchers-claim-radical-compression-of-high-fidelity-ai...
1•ghshephard•27m ago•0 comments

Feat: Open-Source Claude Code

https://github.com/anthropics/claude-code/pull/41447
1•brenoRibeiro706•28m ago•1 comments

Allbirds, Once Valued at $4B, Just Sold Its Assets for Next to Nothing

https://www.wsj.com/business/retail/allbirds-the-tech-bro-favorite-once-valued-at-4-billion-just-...
3•bookofjoe•28m ago•1 comments

Show HN: A tool to solve the Agent Supply Chain pandora box

https://github.com/microsoft/apm
1•dmppch•29m ago•0 comments

Maze Algorithms

https://www.astrolog.org/labyrnth/algrithm.htm
1•marukodo•30m ago•0 comments

Don't Call It a Moat

https://99d.substack.com/p/dont-call-it-a-moat
1•herbertl•34m ago•0 comments

A satellite-smashing chain reaction could spiral out of control

https://www.theguardian.com/science/ng-interactive/2026/mar/31/this-feels-fragile-how-a-satellite...
1•andrewshadura•34m ago•0 comments