Skip to main content
Nowledge Mem

Copilot CLI

GitHub Copilot CLI plugin with Context Bundle / Working Memory startup context, guided recall, and session capture before compaction and at session boundaries.

For your agent

Give this line to your agent. It should use the universal install skill first; this page remains the behavior and troubleshooting reference:

Read https://mem.nowledge.co/SKILL.md and follow the instructions to install or update Nowledge Mem for Copilot CLI. Verify with nmem status and the Context Bundle or Working Memory check, then summarize what changed.
One-minute install
copilot plugin marketplace add nowledge-co/community
copilot plugin install nowledge-mem@nowledge-community

Plugin-native path

Copilot CLI supports plugins and lifecycle hooks. Install the plugin once, keep nmem available locally, and Copilot can start with Context Bundle or Working Memory, search when past context matters, and keep appending your session into Mem before the host compresses or closes the conversation.

This is the dedicated Nowledge path for GitHub Copilot CLI. It is closer to Claude Code than to generic MCP: the plugin brings its own hooks, skills, and capture runtime. At the same time, Copilot still decides when to use the model-mediated skills, so project guidance such as AGENTS.md still helps when you want stronger proactive recall and distillation.

How you'll know it's working

Start a new Copilot session and ask What was I working on? You should see your recent focus and priorities. Then ask Copilot to save or checkpoint the session and confirm the thread appears in Mem.

Before You Start

  • Nowledge Mem running locally (installation) or a reachable remote Mem server
  • GitHub Copilot CLI installed
  • nmem CLI in your PATH

Setup

Install nmem

# Option 1: use the bundled CLI from the Mem desktop app
# Settings → Preferences → Developer Tools → Install CLI

# Option 2: pip
pip install nmem-cli

# Option 3: pipx
pipx install nmem-cli

Then verify:

nmem status

On Windows and Linux with the Nowledge Mem desktop app, nmem is already bundled.

Install the plugin

copilot plugin marketplace add nowledge-co/community
copilot plugin install nowledge-mem@nowledge-community

Restart Copilot CLI after installation.

The plugin now runs its capture runtime from its own packaged hooks/ directory. Older installs can still fall back to ~/.copilot/nowledge-mem-hooks/ if that compatibility copy already exists.

WSL bridge when needed

If Copilot CLI runs inside WSL, but nmem is installed on Windows through the Mem desktop app, create this bridge inside WSL:

mkdir -p ~/.local/bin && cat > ~/.local/bin/nmem << 'SHIMEOF'
#!/bin/bash
python3 - "$@" <<'PY'
import subprocess
import sys

cmd = subprocess.list2cmdline(["nmem.cmd", *sys.argv[1:]])
raise SystemExit(subprocess.run(["cmd.exe", "/s", "/c", cmd]).returncode)
PY
SHIMEOF
chmod +x ~/.local/bin/nmem

This lets Copilot running in WSL call the Windows nmem cleanly.

Add project guidance when you want stronger initiative

The plugin handles Context Bundle / Working Memory bootstrap and session capture on its own. If you also want Copilot to search or distill more proactively in continuation-heavy repos, merge the package AGENTS.md into your project root:

git clone https://github.com/nowledge-co/community.git /tmp/nowledge-community
cp /tmp/nowledge-community/nowledge-mem-copilot-cli-plugin/AGENTS.md ./AGENTS.md
rm -rf /tmp/nowledge-community

If your repo already has an AGENTS.md, merge the Nowledge section instead of overwriting the file.

Configure remote Mem when needed

nmem config client set url https://mem.example.com
nmem config client set api-key nmem_your_key

This writes the shared local client config used by the plugin and nmem.

What Happens Automatically

The plugin uses Copilot CLI hooks for five things:

  • SessionStart on startup, resume, and clear: load Context Bundle with nmem --json context --source-app copilot-cli, then fall back to Working Memory
  • SessionStart after compaction: reload Context Bundle or Working Memory and remind Copilot to checkpoint important findings
  • UserPromptSubmit: keep search and save guidance close to each turn
  • Stop: capture the recorded Copilot session asynchronously after each response
  • PreCompact and SessionEnd: capture the latest recorded session before compaction and when a session closes

The capture hooks append only the new conversation content. They do not keep re-importing the whole session each time.

Skills

The Copilot plugin keeps the user-facing surface simple. It does not ship a separate command-doc layer for save, search, or status. Instead, it relies on skills and the underlying nmem CLI.

SkillWhen it helpsWhat it does
read-working-memorySession start, "what am I working on?"Loads Context Bundle when available, or today's Working Memory briefing as the lightweight fallback
search-memoryPrior work, earlier rationale, past discussionsSearches durable memories and prior threads
distill-memoryA real decision or learning emergedSaves durable knowledge into Mem
save-thread"Save this session", "Checkpoint this"Saves a concise session summary thread on explicit request

For direct troubleshooting outside the skill surface, run nmem status in your terminal.

Update

copilot plugin marketplace add nowledge-co/community
copilot plugin marketplace update nowledge-community
copilot plugin update nowledge-mem

Then restart Copilot CLI.

Customize Safely

Use Copilot's own instruction files instead of editing the installed plugin:

  • .github/copilot-instructions.md or .github/instructions/*.instructions.md for shared repo rules
  • ~/.copilot/copilot-instructions.md for your personal rules across repos

For the full host-by-host map, see Customize Integration Behavior.

Troubleshooting

nmem not found

Install nmem-cli with pip or pipx, or use the bundled CLI from the Mem desktop app.

Startup context never appears

Restart Copilot CLI after installation. Then run nmem status to confirm the local client can reach Mem.

Threads are not appearing in Mem

Restart Copilot CLI after install or update, then check ~/.copilot/nowledge-mem-hooks/hook-log.jsonl. If you are on an older install or local development checkout, you can still run scripts/install-hooks.sh from the source tree as a compatibility fallback.

Copilot only reads startup context, but rarely searches or distills

That usually means the bootstrap hook is working, but your repo does not yet give Copilot strong enough behavioral guidance. Merge the plugin AGENTS.md into your project root, then retry with a continuation-style question.

On this page