mneme-cc-plugin 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. mneme_cc_plugin-2.0.0/.claude-plugin/plugin.json +20 -0
  2. mneme_cc_plugin-2.0.0/.gitignore +88 -0
  3. mneme_cc_plugin-2.0.0/.mcp.json +8 -0
  4. mneme_cc_plugin-2.0.0/PKG-INFO +70 -0
  5. mneme_cc_plugin-2.0.0/README.md +44 -0
  6. mneme_cc_plugin-2.0.0/commands/migrate.md +41 -0
  7. mneme_cc_plugin-2.0.0/commands/prime.md +36 -0
  8. mneme_cc_plugin-2.0.0/commands/recall.md +31 -0
  9. mneme_cc_plugin-2.0.0/hooks/hooks.json +40 -0
  10. mneme_cc_plugin-2.0.0/plugin.json +56 -0
  11. mneme_cc_plugin-2.0.0/pyproject.toml +65 -0
  12. mneme_cc_plugin-2.0.0/skills/mneme-prime/SKILL.md +35 -0
  13. mneme_cc_plugin-2.0.0/skills/mneme-search/SKILL.md +42 -0
  14. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/__init__.py +3 -0
  15. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/cli.py +12 -0
  16. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/hooks/__init__.py +11 -0
  17. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/hooks/lib.py +152 -0
  18. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/hooks/lock.py +14 -0
  19. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/hooks/post_tool_use.py +99 -0
  20. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/hooks/pre_compact.py +59 -0
  21. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/hooks/session_end.py +144 -0
  22. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/hooks/session_start.py +189 -0
  23. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/hooks/stop.py +185 -0
  24. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/install/__init__.py +1 -0
  25. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/install/cli.py +1212 -0
  26. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/install/settings.py +286 -0
  27. mneme_cc_plugin-2.0.0/src/mneme_cc_plugin/py.typed +1 -0
  28. mneme_cc_plugin-2.0.0/tests/__init__.py +0 -0
  29. mneme_cc_plugin-2.0.0/tests/integration/__init__.py +0 -0
  30. mneme_cc_plugin-2.0.0/tests/integration/test_antigravity_target.py +311 -0
  31. mneme_cc_plugin-2.0.0/tests/integration/test_c3_no_network.py +111 -0
  32. mneme_cc_plugin-2.0.0/tests/integration/test_capture_loop.py +60 -0
  33. mneme_cc_plugin-2.0.0/tests/integration/test_generic_mcp_target.py +367 -0
  34. mneme_cc_plugin-2.0.0/tests/integration/test_install_cli.py +556 -0
  35. mneme_cc_plugin-2.0.0/tests/integration/test_multi_client.py +81 -0
  36. mneme_cc_plugin-2.0.0/tests/unit/__init__.py +0 -0
  37. mneme_cc_plugin-2.0.0/tests/unit/fts5_test_db.py +67 -0
  38. mneme_cc_plugin-2.0.0/tests/unit/test_hook_lib.py +168 -0
  39. mneme_cc_plugin-2.0.0/tests/unit/test_hook_timeouts_consistent.py +70 -0
  40. mneme_cc_plugin-2.0.0/tests/unit/test_hooks_codex_pass2.py +236 -0
  41. mneme_cc_plugin-2.0.0/tests/unit/test_hooks_handlers.py +528 -0
  42. mneme_cc_plugin-2.0.0/tests/unit/test_plugin_skill_drift.py +91 -0
  43. mneme_cc_plugin-2.0.0/tests/unit/test_settings.py +319 -0
  44. mneme_cc_plugin-2.0.0/tests/unit/test_skip_hooks.py +152 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "mneme",
3
+ "version": "2.0.0",
4
+ "description": "Vault-native memory for Claude Code. Markdown is ground truth. Hybrid retrieval, temporal knowledge graph, zero LLM cost on Stop, token-aware adaptive context.",
5
+ "author": {
6
+ "name": "Onour Impram",
7
+ "url": "https://github.com/TheGoatPsy/mneme"
8
+ },
9
+ "homepage": "https://github.com/TheGoatPsy/mneme",
10
+ "repository": "https://github.com/TheGoatPsy/mneme",
11
+ "license": "MIT",
12
+ "keywords": [
13
+ "memory",
14
+ "mcp",
15
+ "vault",
16
+ "fts5",
17
+ "retrieval",
18
+ "temporal"
19
+ ]
20
+ }
@@ -0,0 +1,88 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ share/python-wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ MANIFEST
24
+ .pytest_cache/
25
+ .coverage
26
+ .coverage.*
27
+ .cache
28
+ nosetests.xml
29
+ coverage.xml
30
+ *.cover
31
+ .hypothesis/
32
+ htmlcov/
33
+ .mypy_cache/
34
+ .ruff_cache/
35
+
36
+ # Virtual envs
37
+ .env
38
+ .venv
39
+ env/
40
+ venv/
41
+ ENV/
42
+ env.bak/
43
+ venv.bak/
44
+
45
+ # Node
46
+ node_modules/
47
+ npm-debug.log*
48
+ yarn-debug.log*
49
+ yarn-error.log*
50
+ pnpm-debug.log*
51
+ .pnpm-store/
52
+ *.tsbuildinfo
53
+
54
+ # TypeScript
55
+ *.js.map
56
+ *.d.ts.map
57
+
58
+ # IDE
59
+ .vscode/
60
+ .idea/
61
+ *.swp
62
+ *.swo
63
+ .DS_Store
64
+
65
+ # OS
66
+ Thumbs.db
67
+ desktop.ini
68
+
69
+ # mneme local
70
+ .mneme/
71
+ *.local.json
72
+ vault-test/
73
+ benchmarks/results/
74
+ benchmarks/_runs/
75
+ benchmarks/*/output/
76
+ benchmarks/*/result.json
77
+ benchmarks/*/hardware.json
78
+
79
+ # Secrets
80
+ .env.local
81
+ .env.*.local
82
+ secrets/
83
+ *.key
84
+ *.pem
85
+
86
+ # Build artifacts
87
+ *.tgz
88
+ *.whl
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "mneme": {
4
+ "command": "mneme-mcp",
5
+ "args": []
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,70 @@
1
+ Metadata-Version: 2.4
2
+ Name: mneme-cc-plugin
3
+ Version: 2.0.0
4
+ Summary: Claude Code plugin for mneme: hooks, slash commands, skills, and the install CLI.
5
+ Project-URL: Homepage, https://github.com/TheGoatPsy/mneme
6
+ Project-URL: Repository, https://github.com/TheGoatPsy/mneme
7
+ Project-URL: Issues, https://github.com/TheGoatPsy/mneme/issues
8
+ Author: Onour Impram
9
+ License: MIT
10
+ Keywords: claude-code,fts5,mcp,memory,vault
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Requires-Python: >=3.11
18
+ Requires-Dist: click<9,>=8.1
19
+ Requires-Dist: mneme-core<3,>=2.0.0
20
+ Provides-Extra: dev
21
+ Requires-Dist: mypy>=1.10; extra == 'dev'
22
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
23
+ Requires-Dist: pytest>=8.2; extra == 'dev'
24
+ Requires-Dist: ruff>=0.4.7; extra == 'dev'
25
+ Description-Content-Type: text/markdown
26
+
27
+ # mneme-cc-plugin
28
+
29
+ Claude Code plugin manifest for [mneme](https://github.com/TheGoatPsy/mneme).
30
+
31
+ ## Hooks
32
+
33
+ | Hook | Purpose | Latency budget |
34
+ |---|---|---|
35
+ | `PostToolUse` | Capture tool output with `distill.shell_compress` compression and stage for indexing. | non-blocking background |
36
+ | `SessionStart` | Inject preflight vault context with `distill.injection_dedup`. | under 500ms p95 |
37
+ | `Stop` | Append session summary deterministically. No LLM call on the critical path. | under 1s p95 |
38
+ | `PreCompact` | Snapshot pre-compaction state for recovery. | under 200ms p95 |
39
+ | `SessionEnd` | Flush staging buffers, schedule opt-in background compression. | under 500ms p95 |
40
+
41
+ ## Commands
42
+
43
+ - `/mneme:prime` loads context for the current task.
44
+ - `/mneme:recall` retrieves a specific session.
45
+ - `/mneme:migrate` runs one-command migration from claude-mem.
46
+
47
+ ## Skills
48
+
49
+ - `mneme-prime` is the context priming workflow.
50
+ - `mneme-search` is the vault search workflow. v1.0 search is FTS5, with RRF and KG surfaces gated as documented in the root README.
51
+
52
+ ## Installation
53
+
54
+ ```bash
55
+ mneme install --profile=lite
56
+ ```
57
+
58
+ This mutates your Claude Code `settings.json` in a BOM-safe way (Windows-friendly), invokes Python via the launcher (`py -3` on Windows), and registers all hooks, commands, the MCP server, and skills.
59
+
60
+ ## Three-Tier Install Profiles
61
+
62
+ - `lite`: hooks + commands + 6 MCP tools (Python + Node only).
63
+ - `standard`: lite + optional ONNX runtime slot and RRF extension points. Packaged LEANN retrieval is roadmap.
64
+ - `full`: standard + gated Graphiti temporal knowledge graph enrichment for summarize and timeline (Docker + Neo4j required).
65
+
66
+ Upgrade in place: `mneme upgrade --profile=standard`.
67
+
68
+ ## License
69
+
70
+ MIT. See LICENSE in the repository root.
@@ -0,0 +1,44 @@
1
+ # mneme-cc-plugin
2
+
3
+ Claude Code plugin manifest for [mneme](https://github.com/TheGoatPsy/mneme).
4
+
5
+ ## Hooks
6
+
7
+ | Hook | Purpose | Latency budget |
8
+ |---|---|---|
9
+ | `PostToolUse` | Capture tool output with `distill.shell_compress` compression and stage for indexing. | non-blocking background |
10
+ | `SessionStart` | Inject preflight vault context with `distill.injection_dedup`. | under 500ms p95 |
11
+ | `Stop` | Append session summary deterministically. No LLM call on the critical path. | under 1s p95 |
12
+ | `PreCompact` | Snapshot pre-compaction state for recovery. | under 200ms p95 |
13
+ | `SessionEnd` | Flush staging buffers, schedule opt-in background compression. | under 500ms p95 |
14
+
15
+ ## Commands
16
+
17
+ - `/mneme:prime` loads context for the current task.
18
+ - `/mneme:recall` retrieves a specific session.
19
+ - `/mneme:migrate` runs one-command migration from claude-mem.
20
+
21
+ ## Skills
22
+
23
+ - `mneme-prime` is the context priming workflow.
24
+ - `mneme-search` is the vault search workflow. v1.0 search is FTS5, with RRF and KG surfaces gated as documented in the root README.
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ mneme install --profile=lite
30
+ ```
31
+
32
+ This mutates your Claude Code `settings.json` in a BOM-safe way (Windows-friendly), invokes Python via the launcher (`py -3` on Windows), and registers all hooks, commands, the MCP server, and skills.
33
+
34
+ ## Three-Tier Install Profiles
35
+
36
+ - `lite`: hooks + commands + 6 MCP tools (Python + Node only).
37
+ - `standard`: lite + optional ONNX runtime slot and RRF extension points. Packaged LEANN retrieval is roadmap.
38
+ - `full`: standard + gated Graphiti temporal knowledge graph enrichment for summarize and timeline (Docker + Neo4j required).
39
+
40
+ Upgrade in place: `mneme upgrade --profile=standard`.
41
+
42
+ ## License
43
+
44
+ MIT. See LICENSE in the repository root.
@@ -0,0 +1,41 @@
1
+ # /mneme:migrate
2
+
3
+ Import existing memory data from another memory plugin into the vault.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /mneme:migrate from=claude-mem [path=<custom path>]
9
+ ```
10
+
11
+ ## What it does
12
+
13
+ Invokes `mneme migrate-from-<source>` under the hood. The migration:
14
+
15
+ 1. Reads the source memory store at the default or supplied path.
16
+ 2. Maps each record into a markdown document with frontmatter that
17
+ matches the vault contract.
18
+ 3. Writes the converted documents under `vault/migrated/<source>/`.
19
+ 4. Rebuilds the FTS5 index incrementally so the imported documents
20
+ are searchable immediately.
21
+ 5. Reports per-record success and any skipped or malformed entries.
22
+
23
+ The original source store is not modified. If the migration is
24
+ interrupted, re-running is safe: existing destination files are
25
+ detected by content hash and not overwritten.
26
+
27
+ ## Supported sources at v1.0
28
+
29
+ - `claude-mem` (SQLite observation database).
30
+
31
+ Future sources (`mem0`, `supermemory`, `episodic-memory`, `letta`,
32
+ `zep`) ship in v1.1 and later.
33
+
34
+ ## Verification
35
+
36
+ After migration, run `/mneme:search <known fact>` to confirm the
37
+ imported records are indexed. Or use the standalone CLI:
38
+
39
+ ```
40
+ mneme doctor --vault <your-vault>
41
+ ```
@@ -0,0 +1,36 @@
1
+ # /mneme:prime
2
+
3
+ Inject preflight context for the current task into the conversation.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /mneme:prime <task description>
9
+ ```
10
+
11
+ The task description is free text. The longer and more specific, the
12
+ better mneme can match relevant vault content.
13
+
14
+ ## What it does
15
+
16
+ Calls the `mneme_prime` MCP tool with the supplied task description.
17
+ The tool returns a markdown bundle that contains:
18
+
19
+ - The most recent session-typed vault documents.
20
+ - Vault documents whose content matches tokens in the task description.
21
+
22
+ Both selections are formatted with vault paths so you can navigate
23
+ to source content directly. The bundle is truncated to fit within the
24
+ configured token budget (default 4000 tokens).
25
+
26
+ ## When to use
27
+
28
+ - Starting a new session that picks up a long-running thread.
29
+ - Switching topics mid-session and wanting Claude oriented before
30
+ the first prompt.
31
+ - Before a code review session where prior decisions matter.
32
+
33
+ ## Related
34
+
35
+ - `/mneme:recall` to fetch a specific session by id or date.
36
+ - `/mneme:migrate` to bring data over from another memory plugin.
@@ -0,0 +1,31 @@
1
+ # /mneme:recall
2
+
3
+ Retrieve a specific past session by id or by date range.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /mneme:recall session=<session_id>
9
+ /mneme:recall from=<YYYY-MM-DD> to=<YYYY-MM-DD>
10
+ /mneme:recall # most recent sessions
11
+ ```
12
+
13
+ ## What it does
14
+
15
+ Calls the `mneme_recall` MCP tool. The tool reads only the FTS5 index
16
+ and the on-disk markdown files. No LLM call is made. Returns matching
17
+ sessions ranked by mtime descending with full markdown bodies when
18
+ the `include_body` argument is true (default).
19
+
20
+ ## Use cases
21
+
22
+ - "What did we decide about authentication last Thursday?"
23
+ - "Pull up the session where I sketched the migration plan."
24
+ - "List the last five sessions, no bodies, just titles."
25
+
26
+ ## Tips
27
+
28
+ - Combine with `/mneme:prime` when you want a curated bundle instead
29
+ of raw session text.
30
+ - The session_id format follows your vault's frontmatter convention.
31
+ If you do not know it, prefer `from`/`to` date ranges.
@@ -0,0 +1,40 @@
1
+ {
2
+ "hooks": {
3
+ "PostToolUse": [
4
+ {
5
+ "matcher": "Edit|Write|Bash|Task|MultiEdit",
6
+ "hooks": [
7
+ { "type": "command", "command": "mneme hook post-tool-use", "timeout": 5 }
8
+ ]
9
+ }
10
+ ],
11
+ "SessionStart": [
12
+ {
13
+ "hooks": [
14
+ { "type": "command", "command": "mneme hook session-start", "timeout": 5 }
15
+ ]
16
+ }
17
+ ],
18
+ "Stop": [
19
+ {
20
+ "hooks": [
21
+ { "type": "command", "command": "mneme hook stop", "timeout": 10 }
22
+ ]
23
+ }
24
+ ],
25
+ "PreCompact": [
26
+ {
27
+ "hooks": [
28
+ { "type": "command", "command": "mneme hook pre-compact", "timeout": 5 }
29
+ ]
30
+ }
31
+ ],
32
+ "SessionEnd": [
33
+ {
34
+ "hooks": [
35
+ { "type": "command", "command": "mneme hook session-end", "timeout": 10 }
36
+ ]
37
+ }
38
+ ]
39
+ }
40
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "mneme",
3
+ "version": "2.0.0",
4
+ "description": "Vault-native memory for Claude Code. Markdown is ground truth.",
5
+ "author": "Onour Impram (TheGoatPsy)",
6
+ "license": "MIT",
7
+ "repository": "https://github.com/TheGoatPsy/mneme",
8
+ "documentation": "https://github.com/TheGoatPsy/mneme/blob/main/docs/HOOKS.md",
9
+ "hooks": {
10
+ "PostToolUse": {
11
+ "module": "mneme_cc_plugin.hooks.post_tool_use",
12
+ "matcher": "Edit|Write|Bash|Task|MultiEdit",
13
+ "timeout_ms": 1000
14
+ },
15
+ "SessionStart": {
16
+ "module": "mneme_cc_plugin.hooks.session_start",
17
+ "timeout_ms": 800
18
+ },
19
+ "Stop": {
20
+ "module": "mneme_cc_plugin.hooks.stop",
21
+ "timeout_ms": 2000
22
+ },
23
+ "PreCompact": {
24
+ "module": "mneme_cc_plugin.hooks.pre_compact",
25
+ "timeout_ms": 500
26
+ },
27
+ "SessionEnd": {
28
+ "module": "mneme_cc_plugin.hooks.session_end",
29
+ "timeout_ms": 800
30
+ }
31
+ },
32
+ "commands": {
33
+ "/mneme:prime": "commands/prime.md",
34
+ "/mneme:recall": "commands/recall.md",
35
+ "/mneme:migrate": "commands/migrate.md"
36
+ },
37
+ "skills": [
38
+ "skills/mneme-prime",
39
+ "skills/mneme-search"
40
+ ],
41
+ "mcp_servers": {
42
+ "mneme": {
43
+ "command": "mneme-mcp",
44
+ "args": []
45
+ }
46
+ },
47
+ "engines": {
48
+ "claude-code": ">=2.0.0",
49
+ "python": ">=3.11",
50
+ "node": ">=20"
51
+ },
52
+ "kill_switch": {
53
+ "env": "MNEME_DISABLED",
54
+ "description": "When this environment variable is truthy, all hooks exit immediately with success."
55
+ }
56
+ }
@@ -0,0 +1,65 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.18"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "mneme-cc-plugin"
7
+ version = "2.0.0"
8
+ description = "Claude Code plugin for mneme: hooks, slash commands, skills, and the install CLI."
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ authors = [{ name = "Onour Impram" }]
12
+ requires-python = ">=3.11"
13
+ keywords = ["claude-code", "mcp", "memory", "vault", "fts5"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Programming Language :: Python :: 3 :: Only",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ ]
22
+ dependencies = [
23
+ "mneme-core>=2.0.0,<3",
24
+ "click>=8.1,<9",
25
+ ]
26
+
27
+ [project.optional-dependencies]
28
+ dev = [
29
+ "pytest>=8.2",
30
+ "pytest-cov>=5.0",
31
+ "ruff>=0.4.7",
32
+ "mypy>=1.10",
33
+ ]
34
+
35
+ [project.scripts]
36
+ mneme = "mneme_cc_plugin.cli:main"
37
+
38
+ [project.urls]
39
+ Homepage = "https://github.com/TheGoatPsy/mneme"
40
+ Repository = "https://github.com/TheGoatPsy/mneme"
41
+ Issues = "https://github.com/TheGoatPsy/mneme/issues"
42
+
43
+ [tool.hatch.build.targets.wheel]
44
+ packages = ["src/mneme_cc_plugin"]
45
+
46
+ [tool.hatch.build.targets.wheel.shared-data]
47
+ "plugin.json" = "share/mneme-cc-plugin/plugin.json"
48
+ "hooks" = "share/mneme-cc-plugin/hooks"
49
+ "commands" = "share/mneme-cc-plugin/commands"
50
+ "skills" = "share/mneme-cc-plugin/skills"
51
+
52
+ [tool.ruff]
53
+ line-length = 100
54
+ target-version = "py311"
55
+
56
+ [tool.ruff.lint]
57
+ select = ["E", "F", "W", "I", "B", "UP", "RUF"]
58
+
59
+ [tool.mypy]
60
+ python_version = "3.11"
61
+ strict = true
62
+
63
+ [tool.pytest.ini_options]
64
+ testpaths = ["tests"]
65
+ addopts = "-ra --cov=mneme_cc_plugin --cov-branch --cov-report=term-missing --cov-fail-under=80"
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: mneme-prime
3
+ description: Use when the user starts a new task that may have prior vault context worth surfacing. Invokes mneme_prime to build a token-budgeted preamble of recent sessions and topic matches.
4
+ ---
5
+
6
+ # mneme-prime
7
+
8
+ You are guiding the user into a new task. Before answering, retrieve
9
+ relevant prior context from their vault using the `mneme_prime` MCP
10
+ tool.
11
+
12
+ ## When to invoke
13
+
14
+ - The user starts the conversation with a task description that
15
+ sounds like it continues prior work.
16
+ - The user explicitly says "remember what we did about X" or
17
+ similar.
18
+ - The user types `/mneme:prime` directly.
19
+
20
+ ## How to invoke
21
+
22
+ Call `mneme_prime` with the user's task description as
23
+ `task_description` and a budget no larger than 4000 tokens. Inspect
24
+ the returned `preamble` markdown and integrate the relevant pieces
25
+ into your reply. Cite paths from the `sources` array so the user
26
+ can navigate.
27
+
28
+ ## What not to do
29
+
30
+ - Do not call `mneme_prime` on every message. The hook system
31
+ already injects session-start context once per session.
32
+ - Do not include the full preamble verbatim in your reply. Summarize
33
+ and cite. The preamble is for you, not the user.
34
+ - Do not call this with a `budget_tokens` higher than the user's
35
+ remaining context window minus a safe reserve. Smaller is better.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: mneme-search
3
+ description: Use when the user asks a factual question whose answer might live in the vault. Invokes mneme_search (FTS5 BM25, optionally fused with dense and KG backends in standard and full profiles).
4
+ ---
5
+
6
+ # mneme-search
7
+
8
+ When the user asks a question that sounds like recall from prior
9
+ work or notes, search the vault first instead of guessing.
10
+
11
+ ## When to invoke
12
+
13
+ - "Did we decide X?"
14
+ - "What was the conclusion about Y?"
15
+ - "Show me everything I have on Z."
16
+ - The user types `/mneme:search` directly (when that surface exists).
17
+
18
+ ## How to invoke
19
+
20
+ Call the `mneme_search` MCP tool with:
21
+
22
+ - `query`: the user's question in natural language.
23
+ - `top_k`: 5 by default. Raise to 10 only when the user asks for a
24
+ broad sweep.
25
+ - Optional `filters.date_from` / `filters.date_to` when the user
26
+ scopes their question to a specific time window.
27
+
28
+ Inspect the returned `hits`. Each has `path`, `title`, `snippet`,
29
+ and a relevance `score`. Read the snippets first. If they answer
30
+ the question, cite the path and reply. If they only partially
31
+ answer, follow up with `mneme_recall` on the most promising paths
32
+ to pull the full body.
33
+
34
+ ## What not to do
35
+
36
+ - Do not invoke this for the user's first hello or for questions
37
+ whose answer is general knowledge.
38
+ - Do not search for the same query twice in a row. If the first
39
+ pass returned nothing useful, refine the query terms or change
40
+ the filter window.
41
+ - Do not present raw snippets in your reply unless the user
42
+ explicitly asks for them. Summarize and link.
@@ -0,0 +1,3 @@
1
+ """Claude Code plugin package for mneme."""
2
+
3
+ __version__ = "2.0.0"
@@ -0,0 +1,12 @@
1
+ """Top-level entry point for the ``mneme`` console script.
2
+
3
+ This module exists so ``project.scripts.mneme`` in ``pyproject.toml``
4
+ can stay short. The actual CLI logic lives in
5
+ ``mneme_cc_plugin.install.cli``.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from mneme_cc_plugin.install.cli import main
11
+
12
+ __all__ = ["main"]
@@ -0,0 +1,11 @@
1
+ """Claude Code hook implementations for the mneme plugin.
2
+
3
+ Each hook module exposes a ``main()`` entry point that reads a JSON
4
+ event from stdin, performs its task, and writes a JSON response to
5
+ stdout. Every hook fails closed: any exception inside the hook is
6
+ caught and converted to a benign success response so Claude Code is
7
+ never blocked by a mneme defect.
8
+
9
+ The ``MNEME_DISABLED`` environment variable acts as a global kill
10
+ switch. When truthy, every hook short-circuits before doing any work.
11
+ """