{"id":16620,"date":"2026-07-25T16:35:13","date_gmt":"2026-07-25T23:35:13","guid":{"rendered":"https:\/\/mattfife.com\/?p=16620"},"modified":"2026-06-20T22:03:17","modified_gmt":"2026-06-21T05:03:17","slug":"ai-context-storage-fighting-the-amnesia-loop","status":"publish","type":"post","link":"https:\/\/mattfife.com\/?p=16620","title":{"rendered":"AI Context storage &#8211; Fighting the amnesia loop"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Having big context windows is critical for LLM&#8217;s, but fitting a decent sized context on a GPU is rough work. Even when you do get a decent budget, the reality is that you&#8217;ll be running out of context more than a few times in an 8 hour session with a 120,000 or even 250,000 token context window. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s worse than that since research seems to indicate contexts start to degrade and lose coherence after you use up about 60% of your context budget. You can try \/compress commands, but eventually things degrade enough you have to close and restart &#8211; which means you lose all that great context and have to retrain the LLM.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There&#8217;s a couple ways to fight this. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On Claude, you can <a href=\"https:\/\/code.claude.com\/docs\/en\/agent-sdk\/session-storage\" data-type=\"link\" data-id=\"https:\/\/code.claude.com\/docs\/en\/agent-sdk\/session-storage\">persist sessions to external storage<\/a> and resume sessions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On Copilot CLI, the memory already exists<strong>.<\/strong>\u00a0Copilot CLI writes every session to a local SQLite database \u2014\u00a0<code>~\/.copilot\/session-store.db<\/code>. Desi Villanueva wrote a <a href=\"https:\/\/devblogs.microsoft.com\/all-things-azure\/i-wasted-68-minutes-a-day-re-explaining-my-code-then-i-built-auto-memory\/\" data-type=\"link\" data-id=\"https:\/\/devblogs.microsoft.com\/all-things-azure\/i-wasted-68-minutes-a-day-re-explaining-my-code-then-i-built-auto-memory\/\">simple python script that will re-load that context if you use Copilot<\/a>. Handy if you use it for Visual Studio Code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Having big context windows is critical for LLM&#8217;s, but fitting a decent sized context on a GPU is rough work. Even when you do get a decent budget, the reality is that you&#8217;ll be running out of context more than a few times in an 8 hour session with a 120,000 or even 250,000 token context window. It&#8217;s worse than that since research seems to indicate contexts start to degrade and lose coherence after you use up about 60% of&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/mattfife.com\/?p=16620\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[28,9],"tags":[],"class_list":["post-16620","post","type-post","status-publish","format-standard","hentry","category-ai","category-cool"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4WECr-4k4","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts\/16620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16620"}],"version-history":[{"count":2,"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts\/16620\/revisions"}],"predecessor-version":[{"id":16622,"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts\/16620\/revisions\/16622"}],"wp:attachment":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}