git:20260104.75ecd36 to git:20260916.4e0e8ee

35 added, 32 removed. Audit A to A.

- # Claude-Mem Memory Import Agent Instructions
-
- ## Purpose
+ # .claude-mem/memories/
- This directory contains Claude-Mem memory snapshots that should be imported at session start for team knowledge sharing and cross-session persistence.
+ Committed claude-mem exports; four wrappers in `.claude-mem/scripts/`.
- ## Session Start Import (REQUIRED)
+ ## Matters
- Run the import script at session start:
+ No hook or lefthook job imports these; import is manual.
+ Hand-maintained; not in `build_all.py` OWNED_PREFIXES.
+ Contract: `tests/claude_mem/`, `tests/test_claude_mem_scripts.py`.
- ```bash
- pwsh .claude-mem/scripts/Import-ClaudeMemMemories.ps1
- ```
+ ## Entry points
- The script is idempotent. Claude-Mem prevents duplicates using composite keys (`sdk_session_id` + `title` + `created_at_epoch`). Safe to run multiple times.
+ `import_claude_mem_memories.py`: globs `memories/*.json`, `npx tsx` per file; `--importer` > `$CLAUDE_MEM_IMPORTER` > plugin default.
+ `export_claude_mem_memories.py`: positional query, `--output-file`, `--session-number`, `--topic`.
+ `export_claude_mem_full_backup.py`: query `.`, `--project`, `--output-file`.
+ `export_claude_mem_direct.py`: `--project`, `--output-file`; reads the plugin's home-dir SQLite DB via `sqlite3`.
- ## Export at Session End
+ ## Where to look
- When ending sessions with valuable learnings:
+ | Path | Why |
+ | --- | --- |
+ | `.agents/governance/MEMORY-MANAGEMENT.md` | Usage surface; `python3` calls and "Auto-import" step are stale |
- ```bash
- npx tsx scripts/export-memories.ts "[query]" .claude-mem/memories/YYYY-MM-DD-session-NNN-topic.json
- ```
+ ## Skip
- ## Directory Contents
+ `README.md` here: dead `.ps1` and `scripts/*.ts` refs.
+ Committed `direct-backup-*.json`: 9.6MB; grep or jq only.
- All `.json` files in this directory are memory exports that will be automatically imported.
+ ## Constraints
- ## Naming Convention
+ `--output-file` outside `.claude-mem/memories/` exits 1 (CWE-22 guard).
+ markdownlint, `stale_script_refs.py`, `check_doc_interpreter_portability.py` skip this tree; dash and path gates do not.
- `YYYY-MM-DD-session-NNN-topic.json`
+ ## Dangerous assumptions
- Examples:
+ No plugin exits 0. ADR-035 deviation: blank `--importer`, bad path, or missing `npx` exit 1, not 2.
+ Default export filenames differ per script.
- - `2026-01-03-session-229-frustrations.json`
- - `2026-01-03-testing-philosophy.json`
- - `2026-01-03-onboarding.json`
+ ## Dependencies
- ## Privacy Review
+ `npx` + `tsx` and the thedotmack plugin (three scripts); `sqlite3` (direct only).
+ Exports run `scripts/review_memory_export_security.py`; nonzero blocks.
- Before committing, review exports for:
+ ## Architecture
- - API keys, tokens, passwords
- - Private file paths
- - Confidential business logic
- - Personal identifying information
+ Three shims over plugin TypeScript; direct reads SQLite.
- ## References
+ ## Commands
- - [README.md](README.md) - Full documentation
- - [ADR-007](../../.agents/architecture/ADR-007-memory-first-architecture.md) - Memory-First Architecture
+ ```bash
+ uv run python .claude-mem/scripts/import_claude_mem_memories.py
+ uv run python .claude-mem/scripts/export_claude_mem_memories.py "<query>" --topic <topic>
+ uv run pytest tests/claude_mem/ tests/test_claude_mem_scripts.py -x
+ ```