{"slug": "i-gave-github-copilot-cli-a-memory-i-own", "title": "I Gave GitHub Copilot CLI a Memory I Own", "summary": "A developer built Copilot CLI Local Memory, an extension that lets GitHub Copilot CLI save and recall project-specific rules across sessions using plain Markdown files. The tool avoids databases and background services, storing each memory as a modular instruction file under ~/.copilot/instructions/local-memory/, with commands like /remember, /memories, and /forget for explicit control. It supports file-scoped rules and deduplication, though it relies on Copilot's tool invocation for natural-language requests.", "body_md": "Honestly, I was not trying to build a memory system.\n\nI just wanted to talk to Copilot CLI the way I would talk to another developer:\n\n“Save this debugging finding to local memory: the Redis integration tests must run serially because the workers share DB 0.”\n\n“Remember locally that changing the auth timeout requires updating both `gateway.yml`\n\nand `worker.yml`\n\n.”\n\n“Save this migration decision to local memory: use expand–migrate–contract because the API and workers deploy independently.”\n\nThen I wanted to close the terminal, come back tomorrow, and not explain them again.\n\nThese are the kinds of details engineers learn while doing the work: a flaky-test cause, a coupling between two configuration files, and the reasoning behind a migration strategy. Copilot could help uncover them, yet the lesson could still disappear with the session.\n\nI wanted those rules to survive across sessions. But I also wanted to know exactly where they lived, what they said, and how to remove them.\n\nThat became **Copilot CLI Local Memory**.\n\nI did not want to build another database, background service, or dashboard. For a handful of important project rules, that felt heavier than the problem.\n\nI wanted memory to be boring in the best possible way: a file you can open.\n\nThe extension therefore has three explicit commands:\n\n```\n/remember Production deployments must always use --dry-run.\n/memories deployment\n/forget 51e81a1f6f\n```\n\nSave a rule. Start a new session. Copilot remembers.\n\nEach memory becomes one modular Copilot instruction file under:\n\n```\n~/.copilot/instructions/local-memory/\n```\n\nA generated file looks like this:\n\n```\n---\napplyTo: \"**\"\n---\n\nProduction deployments must always use --dry-run.\n```\n\nIt is ordinary Markdown. You can inspect it, edit it, back it up, or delete it yourself.\n\nFile-scoped rules are possible too:\n\n```\n/remember --scope \"src/**/*.ts\" Use Zod rather than Joi for validation.\n```\n\nThere is no vector database, embedding service, server, telemetry, background process, or runtime dependency. Explicit search uses local term ranking.\n\nThe extension deduplicates equivalent entries and refuses deletion by text when several memories match. It also blocks several common credential formats, although no detector is perfect and secrets should never be stored in agent instructions.\n\nYou can ask in natural language:\n\n```\nSave this caveat to local memory: run deploy-tool with --dry-run first.\nCheck local memory for caveats about deploy-tool.\n```\n\nThere is an honest limitation: Copilot decides whether to invoke a tool for natural-language requests. Use `/remember`\n\n, `/memories`\n\n, and `/forget`\n\nwhen predictable behavior matters.\n\nNewly saved instructions are automatically applied in a new session. And although the extension itself makes no network calls, Copilot may include applicable instruction text in the prompt sent to the model. Local storage does not make secrets safe to place in prompts.\n\n`copilot-instructions.md`\n\n?\nFor stable, team-wide rules, you should. Language versions, formatting standards, and permanent repository conventions belong in documentation or checked-in instructions.\n\nThis extension is for the moment when useful knowledge emerges during a task and you want to capture it without stopping to curate a large instruction file. Each memory is stored separately, can be searched or removed by command, and can be scoped to matching files. If a memory becomes a permanent team rule, promote it into the repository’s documentation or instructions.\n\n[GitHub’s Memory documentation](https://docs.github.com/en/copilot/concepts/agents/copilot-memory) describes this learned context as including architectural decisions, build commands, database-connection patterns, and settings that must remain synchronized across files. That is the territory these examples are meant to represent.\n\nGitHub’s managed Memory is the right option when it is available and fits the workflow. This project serves a narrower preference: explicit saves, plain local files, and direct user control. It may also help developers whose organizations disable managed Memory while still permitting extensions and custom instructions.\n\nIt does not imitate GitHub’s service or bypass organization policy.\n\nThe repository includes Windows, macOS, and Linux installers, uninstallers that preserve saved memories by default, tests, and recordings from the real Copilot CLI.\n\nTry it here:\n\n[https://github.com/shankarnarayanb/copilot-cli-local-memory](https://github.com/shankarnarayanb/copilot-cli-local-memory)\n\nIf you have ever grown tired of teaching your coding assistant the same lesson twice, save one rule and start a new session.\n\nThen tell me what worked, what surprised you, and what Copilot should never forget again.", "url": "https://wpnews.pro/news/i-gave-github-copilot-cli-a-memory-i-own", "canonical_source": "https://dev.to/shankarnarayanb/i-gave-github-copilot-cli-a-memory-i-own-4cb0", "published_at": "2026-08-29 00:01:52+00:00", "updated_at": "2026-08-29 00:18:49.835326+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-agents"], "entities": ["GitHub Copilot CLI", "Copilot CLI Local Memory", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/i-gave-github-copilot-cli-a-memory-i-own", "markdown": "https://wpnews.pro/news/i-gave-github-copilot-cli-a-memory-i-own.md", "text": "https://wpnews.pro/news/i-gave-github-copilot-cli-a-memory-i-own.txt", "jsonld": "https://wpnews.pro/news/i-gave-github-copilot-cli-a-memory-i-own.jsonld"}}