Skip to content

Instantly share code, notes, and snippets.

Claude Code Memory Management & Context Optimization Guide

How Claude Code Memory Works

Claude Code uses a simple but powerful file-based memory system centered around CLAUDE.md files. These are automatically loaded into context when Claude Code starts, providing persistent memory across sessions.

Memory File Hierarchy

~/Developer/
function Get-InstalledSoftware {
<#
.SYNOPSIS
Get all installed from the Uninstall keys in the registry.
.DESCRIPTION
Read a list of installed software from each Uninstall key.
This function provides an alternative to using Win32_Product.
.EXAMPLE
Get-InstalledSoftware
@gwpl
gwpl / claude-continue-directory-migration.md
Created June 2, 2025 19:38
Claude Code `--continue` after Directory `mv` move - Migration Guide and Internal Mechanics explanation

Claude Code Continue Functionality: Directory Migration Guide ( Claude Code --continue after Directory mv move - Migration Guide and Internal Mechanics explanation )

This guide explains how to preserve Claude Code's --continue functionality when moving project directories, along with the underlying mechanics.

Note: Claude Code currently lacks built-in directory migration features. Each directory maintains independent conversation sessions, and history doesn't automatically transfer when projects are moved.

Quick Fix: Steps to Maintain Continue History

When you move a project directory and want to preserve your conversation history:

System Instructions:

The assistant is Claude, created by Anthropic.

The current date is Thursday, May 22, 2025.

Here is some information about Claude and Anthropic's products in case the person asks:

This iteration of Claude is Claude Sonnet 4 from the Claude 4 model family. The Claude 4 family currently consists of Claude Opus 4 and Claude Sonnet 4. Claude Sonnet 4 is a smart, efficient model for everyday use.

@EliteHustler
EliteHustler / Duplicate Files Fixer License Key
Created May 10, 2025 19:42
Duplicate Files Fixer Crack
Duplicate Files Fixer Keygen
@peteralcock
peteralcock / claude.txt
Created May 6, 2025 00:39
Clause System Prompt Leak
<citation_instructions>If the assistant's response is based on content returned by the web_search, drive_search, google_drive_search, or google_drive_fetch tool, the assistant must always appropriately cite its response. Here are the rules for good citations:
- EVERY specific claim in the answer that follows from the search results should be wrapped in <antml:cite> tags around the claim, like so: <antml:cite index="...">...</antml:cite>.
- The index attribute of the <antml:cite> tag should be a comma-separated list of the sentence indices that support the claim:
-- If the claim is supported by a single sentence: <antml:cite index="DOC_INDEX-SENTENCE_INDEX">...</antml:cite> tags, where DOC_INDEX and SENTENCE_INDEX are the indices of the document and sentence that support the claim.
-- If a claim is supported by multiple contiguous sentences (a "section"): <antml:cite index="DOC_INDEX-START_SENTENCE_INDEX:END_SENTENCE_INDEX">...</antml:cite> tags, where DOC_INDEX is the corresponding document index and START_S
@LordVeovis
LordVeovis / Set-ScreenResolution.ps1
Last active May 25, 2025 10:37
Change screen resolution in WinPE
Function Set-ScreenResolution {
param (
[Parameter(Mandatory=$true, Position = 0)]
[int]$Width,
[Parameter(Mandatory=$true, Position = 1)]
[int]$Height
)
$pinvokeCode = @"
using System;
@vignesh865
vignesh865 / web_scrap_agent.py
Created April 14, 2025 01:13
Web Scrapper Client Using Playwright MCP.
import asyncio
import json
import logging
import os
import re
from contextlib import AsyncExitStack
import yaml
from dotenv import load_dotenv
from mcp import ClientSession, StdioServerParameters, Tool
from mcp.client.stdio import stdio_client
import os
# Bot credentials
API_ID = '25193832'
API_HASH = 'e154b1ccb0195edec0bc91ae7efebc2f'
# MongoDB connection string
DB_URI = 'mongodb+srv://copy:[email protected]/?retryWrites=true&w=majority&appName=Cluster0'
LOG_CHANNEL = '-1002240372506'
TOKEN = "7488527811:AAEPMstK_YmEXlB2nOhaBYElaQimhoiYXQc"
OWNER_ID = 7379318591 # Change to actual owner ID
ALERT_CHANNEL_ID = "-1002469829347"
@alexbujduveanu
alexbujduveanu / windows-harden.ps1
Created March 26, 2025 20:33
Windows Hardening Script
#Requires -RunAsAdministrator
<#
.SYNOPSIS
Windows Hardening Script for Cloud Environments (AWS, GCP, Azure)
.DESCRIPTION
This script implements security hardening measures for Windows instances
running in public cloud environments while maintaining usability.
.NOTES
Run with administrator privileges
#>