Blame

969aa7 Claude (MCP) 2026-03-18 03:43:55
[mcp] Backup Claude Code project memories to wiki
1
---
2
category: reference
3
tags: [claude-code, memory, process, backup]
4
last_updated: 2026-03-18
5
confidence: high
6
---
7
8
# Claude Code Project Memory Backup
9
10
Backup of Claude Code's persistent memory for the otterwiki/robot.wtf project. These memories guide how Claude Code operates across sessions.
11
12
## Architecture
13
14
### Repos and Tools
15
16
All repos live under `/Users/sderle/code/otterwiki/`. The parent directory is NOT a git repo.
17
18
**F/OSS Repos:**
19
- `otterwiki/` — Fork of redimp/otterwiki (wiki engine). Upstream: `github.com:redimp/otterwiki`. Our remote: `github.com:schuyler/otterwiki` (SSH). Deploy branch: `wikibot-io`. Feature branches: `feat/*` off `wikibot-io`.
20
- `otterwiki-api/` — REST API plugin. Remote: `github.com:schuyler/otterwiki-api`. Branch: `main`.
21
- `otterwiki-semantic-search/` — FAISS + ONNX MiniLM semantic search plugin. Remote: `github.com:schuyler/otterwiki-semantic-search`. Branch: `main`.
22
- `otterwiki-mcp/` — MCP server plugin (12 tools). Remote: `github.com:schuyler/otterwiki-mcp`. Branch: `main`.
23
24
**Private Repos:**
25
- `robot.wtf/` — Platform app server, auth, MCP sidecar, API, Ansible deploy. Remote: `github.com:schuyler/robot.wtf`.
26
- `wikibot-io/` — AWS SaaS predecessor (Pulumi IaC, Lambda packaging). Remote: `github.com:schuyler/wikibot-io`. AWS profile: `wikibot` (us-east-1).
27
- `deploy/` — Legacy 3GW deploy config. No git remote.
28
- `dev-wiki/` — Local dev wiki git repo.
29
30
**Deploy flow (robot.wtf):** `ansible-playbook ansible/deploy.yml -i ansible/inventory.yml` from robot.wtf repo.
31
32
### MCP Servers (DO NOT CONFUSE)
33
34
- **dev-wiki** (`mcp__dev-wiki__*`) = dev.robot.wtf — platform dev instance
35
- **thirdgulfwar** (`mcp__thirdgulfwar__*`) = 3gw.robot.wtf — research wiki (LXC/Caddy)
36
- **claude_ai_Third_Gulf_War_research_wiki** — same as thirdgulfwar, via Claude.ai connector
37
38
### MCP Authentication
39
40
- `MultiAuth` composes `InMemoryOAuthProvider` (OAuth 2.1 for Claude.ai) + `StaticTokenVerifier` (bearer token for Claude Code)
41
- OAuth is the transport layer — Caddy basic auth on `/authorize*` is the actual gate
42
- Tokens are in-memory; server restart forces re-auth
43
- Claude.ai URL: `https://mcp.3gw.robot.wtf/mcp` (must include `/mcp`!)
44
- Claude.ai does NOT support bearer token auth — only OAuth
45
46
### VPS Infrastructure
47
48
**wiki-1 (app server):** `ssh sderle@192.168.77.107`
49
- Services: otterwiki (8000), MCP sidecar (8001), API (8002), auth (8003)
50
- Data: `/srv/data/robot.db`, `/srv/data/wikis/`, `/srv/data/robot.env`
51
- Ansible: `/Users/sderle/code/otterwiki/robot.wtf/ansible/`
52
53
**proxy-1 (Caddy):** `ssh sderle@robot.wtf`
54
- Manages TLS for robot.wtf, *.robot.wtf
55
- Read-only only. Managed by separate Ansible repo.
56
57
**3GW (local network):** LXC container at `3gw.lan`, zmx session `3gw`
58
59
## Process Rules
60
61
### Agent Delegation Model
62
63
- **Opus orchestrates, Sonnet implements.** No Opus manager layer.
64
- **ALL subagents run in background** (`run_in_background: true`), no exceptions.
65
- **Worktree isolation required** for code changes. Parent dir is NOT a git repo — must scope to specific repo.
66
67
### Implementation Workflow
68
69
See [[Design/Implementation_Workflow]] for full process. Pipeline: Plan (Opus) → Plan Review (Sonnet) → Implement (Sonnet, worktree) → Chico review → Zeppo review → Fix → Re-review → Verify.
70
71
### Feedback Rules (Hard-Won Lessons)
72
73
**Rule of Two:** Never accept a subagent finding without independent verification. A test agent once reported a 404 bug using the wrong URL — it was accepted and written into the wiki before anyone checked.
74
75
**Fix, don't defer:** Never suggest carrying known debt when the fix is bounded and small. Default is always: fix it now.
76
77
**Self-sufficient:** Don't ask questions you can answer by reading code, wiki, or design docs. Only escalate when genuinely blocked or when a decision requires user judgment.
78
79
**Reproducible VPS:** NEVER mutate the VPS via SSH. All changes through Ansible. This has been corrected five times. Allowed via SSH: read-only diagnostics only (`journalctl`, `systemctl status`, `curl`, `cat`, `ls`, `sqlite3 SELECT`).
80
81
**Pre-merge verification:** Always dispatch a verification agent before merging any subagent's branch. Read the diff, confirm changes match spec, run tests.
82
83
**TDD by default:** Red/green TDD whenever possible. Write failing test first, then implementation. Discuss with user before skipping.
84
85
**No ignored failures:** If a test is failing before your changes, fix it or flag it. Don't normalize broken tests.
86
87
**Plan Review:** Always dispatch a Plan Review agent after Plan, before implementation. Include deployment context (gunicorn timeout, etc.).
88
89
**Opus never implements:** Always dispatch a subagent, even for trivial tasks. Opus holds the steering wheel, not the wrench.
90
91
**Question the premise:** When a finding says X is slow, ask whether X should exist at all before optimizing. The bcrypt linear scan fix was "add a prefix column" when the answer was "don't use bcrypt for API tokens."
92
93
**Pre-flight checklist:** Before dispatching worktree agents: (1) verify CWD is inside target git repo, (2) confirm plan-review loop complete, (3) confirm task dependencies wired.
94
95
**Otterwiki config override:** `update_app_config()` loads DB preferences and overwrites Flask config. DB wins over settings.cfg. Always seed values via `_init_wiki_db()`.
96
97
**Read memories first:** Read MEMORY.md and Implementation_Workflow wiki page before dispatching any agents. Create full task list before launching first agent.
98
99
## Project Context
100
101
### Per-Wiki SQLite DB (COMPLETED)
102
103
Each wiki gets `/srv/data/wikis/{slug}/wiki.db`. Resolver swaps DB per-request. `_init_wiki_db()` seeds SITE_NAME, access levels, AUTH_METHOD, schema version.
104
105
### Cold Start / Performance
106
107
Lambda cold starts: ~4.5s mean (512MB, Python 3.12). .pyc files make it WORSE (+700ms from extra decompression). CDN caching is the path forward, not Lambda optimization.
108
109
### Shared Worktree Trial
110
111
Trial file-level parallelism: multiple agents writing different files in a shared worktree. Use `EnterWorktree` to create shared worktree, dispatch agents to same path with assigned files.
112
113
## User Preferences
114
115
- Concise, no sycophancy, no fake enthusiasm
116
- Bias toward minimal solutions
117
- Uses plan mode for non-trivial changes
118
- Time is the most precious resource
119
- `git add -A` is forbidden
120
121
## Reference Pointers
122
123
- **To-Do page** in dev wiki is the authoritative task tracker (supersedes Tasks/ pages)
124
- **Implementation Workflow** at [[Design/Implementation_Workflow]]
125
- **OWASP Audit** at [[Security/OWASP_2025_Audit]]