context
CommandAnalyze and optimize Claude Code's context configuration (analyze, optimize, or reset).
Manage cross-device **semantic memory** for scaffolding (self-hosted mem0 + pgvector, Ollama on GPU). Opt-in, per-device. Memory is **off by default** — nothing is wired until you enable it.
> /plugin marketplace add komluk/scaffolding> /plugin install scaffolding@komluk-scaffolding
Manage cross-device **semantic memory** for scaffolding (self-hosted mem0 + pgvector, Ollama on GPU). Opt-in, per-device. Memory is **off by default** — nothing is wired until you enable it.
/memory enable # wire the memory MCP backend into Claude Code (user scope) /memory disable # remove it from this device (stored memories on the backend are kept) /memory status # show whether it's wired and reachable
The assistant reads the argument (`enable` / `disable` / `status`; default: `status`) and performs the matching section below.
---
Connects this device so scaffolding agents gain persistent memory via the `semantic_search` / `semantic_recall` / `semantic_store` tools (see the `semantic-memory-mcp` skill). The token is personal — memory is yours only; anyone without it gets 401.
1. **Check the token** is in the environment:
test -n "${MEMORY_MCP_TOKEN:-}" || echo "MEMORY_MCP_TOKEN not set — export it (e.g. from Vault: export MEMORY_MCP_TOKEN=$(vault kv get -field=token kv/memory/mcp)) and re-run"2. **Register the MCP server** (user scope; default endpoint = homelab backend, override with `MEMORY_MCP_URL`):
claude mcp add --scope user --transport http memory \
"${MEMORY_MCP_URL:-http://memory.bernardynska.waw.pl:8000/mcp}" \
--header "Authorization: Bearer \${MEMORY_MCP_TOKEN}"(The literal `${MEMORY_MCP_TOKEN}` is stored and expanded at runtime — the token is never written to disk.) 3. **Verify**: `claude mcp list | grep memory` 4. **(Optional) Wire token auto-refresh from Vault.** Offer this only if the user wants the token kept fresh per-device without manual re-export. It installs a SessionStart hook (shipped with the plugin) into **user** settings — opt-in, never an always-on plugin hook:
mkdir -p "$HOME/.claude/hooks"
cp "${CLAUDE_PLUGIN_ROOT}/hooks/refresh-mcp-token.sh" "$HOME/.claude/hooks/refresh-mcp-token.sh"
chmod 700 "$HOME/.claude/hooks/refresh-mcp-token.sh"
node - "$HOME/.claude/settings.json" <<'JS'
const fs = require("fs");
const p = process.argv[2];
const d = fs.existsSync(p) ? JSON.parse(fs.readFileSync(p, "utf8")) : {};
const cmd = "$HOME/.claude/hooks/refresh-mcp-token.sh";
d.hooks ??= {};
const ss = (d.hooks.SessionStart ??= []);
if (!ss.some((e) => (e.hooks ?? []).some((h) => h.command === cmd))) {
ss.push({ matcher: "", hooks: [{ type: "command", command: cmd, timeout: 30 }] });
fs.writeFileSync(p, JSON.stringify(d, null, 2) + "\n");
console.log("auto-refresh hook installed");
} else {
console.log("auto-refresh hook already present");
}
JSIt re-pulls `MEMORY_MCP_TOKEN` from Vault (`kv/memory/mcp`) each session and keeps `settings.json` topped up. Requires the `vault` CLI + a valid login; a clean no-op without them. **Skip** if the token is supplied another way (e.g. the `claude()` shell wrapper). Takes effect next session. 5. **Tell the user to restart Claude Code** so the server + token load and connect. After restart, `mcp__memory__*` tools are available and skills use them automatically.
claude mcp remove memory --scope user
If the optional auto-refresh hook was installed, also remove it:
rm -f "$HOME/.claude/hooks/refresh-mcp-token.sh" # then drop its SessionStart entry from ~/.claude/settings.json
Then tell the user to restart Claude Code. Stored memories on the backend are **not** deleted — re-enable any time with `/memory enable`.
claude mcp list | grep -i memory || echo "memory: not enabled on this device"
If present, report the URL and whether `MEMORY_MCP_TOKEN` is set in the environment (connection needs both). Note: `Failed to connect` usually just means the current shell lacks `MEMORY_MCP_TOKEN` — it loads on the next Claude Code launch via the `claude()` shell wrapper.
---
`memory.bernardynska.waw.pl:8000`); Ollama on GPU for distillation/embeddings; egress-blocked at the UDM — nothing leaves the LAN.
`project_id` (derived from the git remote) so each repo has its own memory namespace, shared across your devices.
file-based memory (`.scaffolding/agent-memory/`) — agents never block.
without semantic memory.
Spec-driven multi-agent orchestration for Claude Code — pure markdown, zero backend, runs on the stock runtime. 13 agents, 39 skills, 21 commands, 20 hooks, per-phase model tiers, opt-in lifecycle hooks, optional cross-device semantic memory.
Analyze and optimize Claude Code's context configuration (analyze, optimize, or reset).
Scaffold a new scaffolding-compatible skill: an interactive flow that creates `skills/<name>/SKILL.md` from the canonical…
Health-check the scaffolding install and report install problems plus exact fixes (diagnose-only, never mutates).
Initialize OpenSpec in a project directory with the scaffolding-workflow schema.
Scaffold opt-in path-scoped nested CLAUDE.md rule files into the project to lazy-load per-area conventions while keeping routing…
Bootstrap a new project with the scaffolding CLAUDE.md, settings.json, and `.scaffolding/` directory structure.
Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.