metame-cli 1.3.18 → 1.3.22

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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # 🔮 MetaMe
1
+ # MetaMe
2
2
 
3
3
  <p align="center">
4
4
  <img src="./logo.png" alt="MetaMe Logo" width="200"/>
@@ -7,7 +7,6 @@
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/metame-cli"><img src="https://img.shields.io/npm/v/metame-cli.svg" alt="npm version"></a>
9
9
  <a href="https://www.npmjs.com/package/metame-cli"><img src="https://img.shields.io/npm/dm/metame-cli.svg" alt="npm downloads"></a>
10
- <a href="https://nodejs.org"><img src="https://img.shields.io/node/v/metame-cli.svg" alt="node version"></a>
11
10
  <a href="https://github.com/Yaron9/MetaMe/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/metame-cli.svg" alt="license"></a>
12
11
  </p>
13
12
 
@@ -15,653 +14,200 @@
15
14
  <a href="./README.md">English</a> | <a href="./README中文版.md">中文</a>
16
15
  </p>
17
16
 
18
- > **The Cognitive Profile Layer for Claude Code.**
19
- >
20
- > *Knows how you think. Works wherever you are.*
17
+ > **Claude Code that knows you and works from your phone.**
21
18
 
22
- ## 📖 Introduction
19
+ MetaMe turns Claude Code into a persistent AI that remembers how you think, runs on your Mac 24/7, and takes commands from your phone via Telegram or Feishu.
23
20
 
24
- **Claude Code** is powerful, but it has two pain points:
25
-
26
- 1. **Project Amnesia** — Switch folders, and it forgets who you are. Your communication style, coding preferences, constraints — gone. Every project, you start from scratch.
27
-
28
- 2. **Desktop-Bound** — Leave your computer, work stops. You can't continue that debugging session on your phone. You can't vibe with Claude on the train, in bed, or waiting in line.
29
-
30
- **MetaMe** solves both — and more:
31
-
32
- **🧠 Cognitive Profile** — A persistent "Global Brain" (`~/.claude_profile.yaml`) that travels with you across every project. Unlike ChatGPT/Claude's built-in memory (which stores *facts* like "user lives in X"), MetaMe captures *how you think* — your decision style, cognitive load preferences, and communication traits. It's not a memory system; it's a **Cognitive Mirror**.
33
-
34
- **📱 Mobile Bridge** — Full Claude Code from your phone via Telegram or Feishu. Same tools, same files, same conversation history. Start on your computer, continue anywhere. `/cd last` syncs you to exactly where you left off.
35
-
36
- **🔔 Remote Wake** — Daemon runs in the background on your computer. Send a message from your phone, and it wakes up Claude Code to do real work — edit files, run commands, commit code — even while you're away from your desk.
37
-
38
- **📂 File Transfer** — Send files from your computer to your phone (ask Claude to send any project file). Send files from your phone to your computer (just attach them in chat). Seamless both ways.
39
-
40
- **⏰ Heartbeat Tasks** — Schedule Claude to run automatically. Daily summaries, automated workflows, multi-step skill chains — all running on your machine, pushing results to your phone.
41
-
42
- ## ✨ Key Features
43
-
44
- * **🧠 Global Brain (`~/.claude_profile.yaml`):** A single, portable source of truth — your identity, cognitive traits, and preferences travel with you across every project.
45
- * **🧬 Cognitive Evolution Engine:** MetaMe learns how you think through three channels: (1) **Passive** — silently captures your messages and distills cognitive traits via Haiku on next launch; (2) **Manual** — `!metame evolve` for explicit teaching; (3) **Confidence gates** — strong directives ("always"/"from now on") write immediately, normal observations need 3+ consistent sightings before promotion. Schema-enforced (41 fields, 5 tiers, 800 token budget) to prevent bloat.
46
- * **🛡️ Auto-Lock:** Mark any value with `# [LOCKED]` — treated as a constitution, never auto-modified.
47
- * **🪞 Metacognition Layer (v1.3):** MetaMe now observes *how* you think, not just *what* you say. Behavioral pattern detection runs inside the existing Haiku distill call (zero extra cost). It tracks decision patterns, cognitive load, comfort zones, and avoidance topics across sessions. When persistent patterns emerge, MetaMe injects a one-line mirror observation — e.g., *"You tend to avoid testing until forced"* — with a 14-day cooldown per pattern. Conditional reflection prompts appear only when triggered (every 7th distill or 3x consecutive comfort zone). All injection logic runs in Node.js; Claude receives only pre-decided directives, never rules to self-evaluate.
48
- * **📱 Remote Claude Code (v1.3):** Full Claude Code from your phone via Telegram or Feishu (Lark). Stateful sessions with `--resume` — same conversation history, tool use, and file editing as your terminal. Interactive buttons for project/session picking, directory browser, and macOS launchd auto-start.
49
- * **🔄 Workflow Engine (v1.3):** Define multi-step skill chains as heartbeat tasks. Each workflow runs in a single Claude Code session via `--resume`, so step outputs flow as context to the next step. Example: `deep-research` → `tech-writing` → `wechat-publisher` — fully automated content pipeline.
50
- * **⏹ Full Terminal Control from Mobile (v1.3.10):** `/stop` (ESC), `/undo` (ESC×2) with native file-history restoration, concurrent task protection, daemon auto-restart, and `metame continue` for seamless mobile-to-desktop sync.
51
- * **🎯 Goal Alignment & Drift Detection (v1.3.11):** MetaMe now tracks whether your sessions align with your declared goals. Each distill assesses `goal_alignment` (aligned/partial/drifted) at zero extra API cost. When you drift for 2+ consecutive sessions, a mirror observation is injected passively; after 3+ sessions, a reflection prompt gently asks: "Was this an intentional pivot, or did you lose track?" Session logs now record project, branch, intent, and file directories for richer retrospective analysis. Pattern detection can spot sustained drift trends across your session history.
52
- * **🔌 Provider Relay (v1.3.11):** Use any Anthropic-compatible API relay as your backend — no file mutation, no invasion. MetaMe injects `ANTHROPIC_BASE_URL` + `ANTHROPIC_API_KEY` at spawn time. Separate provider roles for `active`, `distill`, and `daemon` tasks. CLI: `metame provider add/use/remove/test`. Config stored in `~/.metame/providers.yaml`.
53
- * **📊 Session History Bootstrap (v1.3.12):** Solves the cold-start problem — MetaMe previously needed 5-7 sessions before producing any visible feedback. Now, on first launch it auto-bootstraps your session history from existing Claude Code JSONL transcripts (zero API cost). Three complementary data layers: **Skeleton** (structural facts extracted locally — tools, duration, project, branch, intent), **Facets** (interaction quality from `/insights` — outcome, friction, satisfaction, when available), and **Haiku** (metacognitive judgments — cognitive load, zones, goal alignment, from the existing distill call). Patterns and mirror observations can appear from your very first MetaMe session.
54
- * **🏥 Emergency Recovery (v1.3.13):** `/doctor` interactive diagnostics with one-tap fix buttons, `/sh` direct shell access from your phone (bypasses Claude entirely — the lifeline when everything else is broken), automatic config backup before any setting change, `/fix` to restore last known good config. `/model` interactive model switcher with auto-backup.
55
- * **🌐 Browser Automation (v1.3.15):** Native Playwright MCP integration — auto-registered on first run. Every MetaMe user gets browser control capability out of the box. Combined with Skills, enables workflows like automated podcast publishing, form filling, and web scraping.
56
- * **📂 Interactive File Browser (v1.3.15):** `/list` shows clickable button cards — folders expand inline, files download on tap. Folder buttons survive daemon restarts (absolute paths, no expiry). Zero token cost.
57
-
58
- ## 🛠 Prerequisites
59
-
60
- MetaMe is a wrapper around **Claude Code**. You must have Node.js and the official Claude Code tool installed first.
61
-
62
- 1. **Node.js**: Version 14 or higher.
63
- 2. **Claude Code**: Ensure `claude` is available in your PATH and you are logged in.
64
-
65
- ## 📦 Installation
66
-
67
- **One-command install (recommended)** — installs Node.js, Claude Code, and MetaMe:
68
-
69
- macOS / Linux:
70
- ```bash
71
- curl -fsSL https://raw.githubusercontent.com/Yaron9/MetaMe/main/install.sh | bash
72
- ```
73
-
74
- Windows (PowerShell):
75
- ```powershell
76
- irm https://raw.githubusercontent.com/Yaron9/MetaMe/main/install.ps1 | iex
77
- ```
78
- > Windows uses WSL (auto-installed if missing). After WSL install you'll need to reboot once, then re-run the command.
79
-
80
- **Manual install** — if you already have Node.js and Claude Code:
81
-
82
- ```bash
83
- npm install -g metame-cli
84
- ```
85
-
86
- **Claude Code Plugin** — lightweight alternative, profile injection + slash commands only:
21
+ One command. No cloud. Your machine, your data.
87
22
 
88
23
  ```bash
89
- claude plugin install github:Yaron9/MetaMe/plugin
90
- ```
91
-
92
- ## 🚀 Usage
93
-
94
- Forget the `claude` command. From now on, simply type:
95
-
96
- **Bash**
97
-
98
- ```
99
- metame
100
- ```
101
-
102
- Or, if you prefer mixed case (it's the same command):
103
-
104
- **Bash**
105
-
24
+ npm install -g metame-cli && metame
106
25
  ```
107
- MetaMe
108
- ```
109
-
110
- ### The First Run (Genesis)
111
-
112
- When you run MetaMe for the first time, it will detect that your profile is empty. It will pause the AI and enter **Calibration Mode**:
113
26
 
114
- 1. It will ask you for a **Codename** (Nickname).
115
- 2. It will initiate a **Deep Cognitive Interview** to map your talents, mental models, and hidden anxieties.
116
- 3. **Be Honest**: It acts as a mirror. The more raw truth you provide, the better it can shadow you.
117
- 4. Once finished, it saves your "Source Code" and launches Claude.
27
+ ---
118
28
 
119
- ### Daily Workflow
29
+ ## What It Does
120
30
 
121
- 1. `cd` into any project folder.
122
- 2. Run `metame`.
123
- 3. Claude will start and immediately say: *"Ready, [Your Name]..."*
124
- 4. Start coding. MetaMe manages the context in the background.
31
+ ### 1. Knows You Across Every Project
125
32
 
126
- ### Global Initialization (Reset/Interview)
33
+ Claude Code forgets you every time you switch folders. MetaMe doesn't.
127
34
 
128
- If you want to restart the **Genesis Interview** to update your psychological profile:
129
-
130
- **Bash**
131
-
132
- ```
133
- metame interview
134
- ```
135
- (Command to be implemented in v1.3 - currently you can manually edit `~/.claude_profile.yaml` or use `set-trait`)
136
-
137
- ### Cognitive Evolution
138
-
139
- MetaMe learns who you are through two paths:
140
-
141
- **Automatic (zero effort):** A global hook captures your messages. On next launch, Haiku distills cognitive traits in the background. Strong directives ("always"/"from now on") write immediately; normal observations need 3+ consistent sightings. All writes are schema-validated (41 fields, 800 token budget). You'll see:
35
+ A cognitive profile (`~/.claude_profile.yaml`) follows you everywhere not just facts like "user prefers TypeScript", but *how you think*: your decision style, cognitive load preferences, communication patterns. It learns silently from your conversations via background distillation, no effort required.
142
36
 
143
37
  ```
38
+ $ metame
144
39
  🧠 MetaMe: Distilling 7 moments in background...
40
+ Ready, Neo. What are we building?
145
41
  ```
146
42
 
147
- **Manual:** Update a specific trait directly:
148
-
149
- ```bash
150
- metame set-trait status.focus "Learning Rust"
151
- metame evolve "I prefer functional programming patterns"
152
- ```
153
-
154
- **Episodic memory (keyframe, not full log):** MetaMe is not a memory system, but it captures two types of experiential "keyframes" that pure personality traits can't replace:
155
-
156
- * **Anti-patterns** (`context.anti_patterns`, max 5): Cross-project failure lessons — e.g., *"Promise.all rejects all on single failure, use Promise.allSettled"*. Auto-expires after 60 days. Prevents the AI from repeating the same mistakes across sessions.
157
- * **Milestones** (`context.milestones`, max 3): Recent completed landmarks — e.g., *"MetaMe v1.3 published"*. Provides continuity so Claude knows where you left off without you having to recap.
158
-
159
- **Anti-bias safeguards:** single observations ≠ traits, contradictions are tracked not overwritten, pending traits expire after 30 days, context fields auto-clear on staleness.
160
-
161
- **In-session commands (type inside Claude Code):**
162
-
163
- | Command | Description |
164
- |---------|-------------|
165
- | `!metame refresh` | Re-inject profile into current session |
166
- | `!metame evolve "..."` | Teach MetaMe a new insight |
167
- | `!metame set-trait key value` | Update a specific profile field |
168
-
169
- **Metacognition controls:**
170
-
171
- ```bash
172
- metame quiet # Silence mirror observations & reflections for 48h
173
- metame insights # Show detected behavioral patterns
174
- metame mirror on|off # Toggle mirror injection
175
- ```
176
-
177
- ### Remote Claude Code — Telegram & Feishu (v1.3)
178
-
179
- Full Claude Code from your phone — stateful sessions with conversation history, tool use, and file editing. Supports both Telegram and Feishu (Lark).
180
-
181
- **Setup:**
182
-
183
- ```bash
184
- metame daemon init # Create config + setup guide
185
- ```
43
+ ### 2. Full Claude Code From Your Phone
186
44
 
187
- Edit `~/.metame/daemon.yaml`:
45
+ Your Mac runs a daemon. Your phone sends messages via Telegram or Feishu. Same Claude Code engine — same tools, same files, same session.
188
46
 
189
- ```yaml
190
- telegram:
191
- enabled: true
192
- bot_token: "YOUR_BOT_TOKEN" # From @BotFather
193
- allowed_chat_ids:
194
- - 123456789 # Your Telegram chat ID
195
-
196
- feishu:
197
- enabled: true
198
- app_id: "YOUR_APP_ID" # From Feishu Developer Console
199
- app_secret: "YOUR_APP_SECRET"
200
- allowed_chat_ids: [] # Empty = deny all (fill via setup wizard)
201
47
  ```
202
-
203
- **Start the daemon:**
204
-
205
- ```bash
206
- metame start # Background process
207
- metame status # Check if running
208
- metame logs # Tail the log
209
- metame stop # Shutdown
210
- metame daemon install-launchd # macOS auto-start
211
- metame daemon install-systemd # Linux/WSL auto-start
48
+ You (phone): Fix the auth bug in api/login.ts
49
+ Claude: ✏️ Edit: api/login.ts
50
+ 💻 Bash: npm test
51
+ ✅ Fixed. 3 tests passing.
212
52
  ```
213
53
 
214
- **Auto-start (recommended):** The daemon survives reboots and auto-restarts on crash.
54
+ Start on your laptop, continue on the train. `/stop` to interrupt, `/undo` to rollback, `/sh ls` for raw shell access when everything else breaks.
215
55
 
216
- macOS:
217
- ```bash
218
- metame daemon install-launchd
219
- launchctl load ~/Library/LaunchAgents/com.metame.daemon.plist
220
- ```
221
-
222
- Linux / WSL:
223
- ```bash
224
- metame daemon install-systemd
225
- ```
226
- > WSL requires systemd enabled: add `[boot]\nsystemd=true` to `/etc/wsl.conf` and restart WSL.
227
-
228
- > **Important:** Choose one management method — either auto-start or manual (`metame start/stop`). Don't mix them, or you'll get duplicate processes.
229
-
230
- **Session commands (interactive buttons on Telegram & Feishu):**
231
-
232
- | Command | Description |
233
- |---------|-------------|
234
- | `/last` | **Quick resume** — prefers current directory's recent session, falls back to global recent |
235
- | `/new` | Start new session — pick project directory from button list |
236
- | `/new <name>` | Start new session with a name (e.g., `/new API Refactor`) |
237
- | `/resume` | Resume a session — clickable list, shows session names + real-time timestamps |
238
- | `/resume <name>` | Resume by name (supports partial match, cross-project) |
239
- | `/name <name>` | Name the current session (syncs with computer's `/rename`) |
240
- | `/cd` | Change working directory — with directory browser |
241
- | `/cd last` | **Sync to computer** — jump to the most recent session's directory |
242
- | `/session` | Current session info |
243
- | `/stop` | Interrupt current Claude task (like pressing ESC in terminal) |
244
- | `/undo` | Undo turns with file restoration (like pressing ESC×2 in terminal) |
245
-
246
- Just type naturally for conversation — every message stays in the same Claude Code session with full context.
247
-
248
- **Session naming:** Sessions can be named via `/new <name>`, `/name <name>` (mobile), or Claude Code's `/rename` (desktop). Names are stored in Claude's native session index and sync across all interfaces — name it on your phone, see it on your computer.
249
-
250
- **How it works:**
251
-
252
- Each chat gets a persistent session via `claude -p --resume <session-id>`. This is the same Claude Code engine as your terminal — same tools (file editing, bash, code search), same conversation history. You can start work on your computer and `/resume` from your phone, or vice versa.
253
-
254
- **Seamless switching between desktop and mobile (v1.3.13):**
255
-
256
- The same session works on both desktop and mobile, but there's an asymmetry:
257
-
258
- * **Desktop → Mobile:** Automatic. Mobile spawns a fresh `claude -p --resume` for each message, so it always reads the latest session file. Just keep chatting.
259
- * **Mobile → Desktop:** Requires a sync. Desktop Claude Code holds the session in memory — it won't see messages added by the mobile daemon. Exit Claude first (Ctrl+C), then:
260
-
261
- ```bash
262
- metame continue
263
- ```
264
-
265
- This resumes the latest session with all mobile messages included. Also works as `metame sync`.
266
-
267
- **Parallel request handling:** The daemon uses async spawning, so multiple users or overlapping requests don't block each other. Each Claude call runs in a non-blocking subprocess.
268
-
269
- **Streaming status (v1.3.7):** See Claude's work progress in real-time on your phone:
270
-
271
- ```
272
- 📖 Read: 「config.yaml」
273
- ✏️ Edit: 「daemon.js」
274
- 💻 Bash: 「git status」
275
- 🔧 Skill: 「wechat-publisher」
276
- 🌐 Browser: 「navigate」
277
- 🔗 MCP:server: 「action」
278
- ```
56
+ ### 3. Runs Autonomously
279
57
 
280
- **File transfer (v1.3.8):** Seamlessly move files between your phone and computer.
281
-
282
- *Computer → Phone (download):* Ask Claude to send any project file:
283
-
284
- ```
285
- You: Send me report.md
286
- Claude: Here you go!
287
- [📎 report.md] ← tap to download
288
- ```
289
-
290
- Works for documents, audio, images, etc. Click button to download. Links valid for 30 minutes.
291
-
292
- *Phone → Computer (upload):* Send files directly to your project:
293
-
294
- ```
295
- [📎 You send a PDF, image, or any file]
296
- Claude: 📥 Saved: document.pdf
297
- File is in your project's upload/ folder.
298
- ```
299
-
300
- Uploaded files are saved to `<project>/upload/`. Claude won't read large files automatically — just tell it when you want it to process them.
301
-
302
- - **Telegram:** Works out of the box
303
- - **Feishu:** Requires `im:resource` + `im:message` permissions in app settings
304
-
305
- **Task control (v1.3.13):** Full terminal-equivalent control from your phone.
306
-
307
- *`/stop` — ESC equivalent:* Sends SIGINT to the running Claude process. Instant interruption, just like pressing ESC in your terminal.
308
-
309
- *`/undo` — git-based code rollback (v1.3.16):* Before each Claude turn, the daemon auto-commits a `[metame-checkpoint]` to git. `/undo` lists recent checkpoints; tap one to `git reset --hard` back to that state. Session history is also truncated. Reliable across both `-p` mode and interactive sessions — no dependency on Claude CLI internals.
310
-
311
- ```
312
- You: /undo
313
- Bot: 回退到哪一轮?
314
- ⏪ 重构API接口 (5分钟前)
315
- ⏪ 修复登录bug (12分钟前)
316
- ⏪ 添加测试用例 (30分钟前)
317
- ```
318
-
319
- **Message queue & interrupt (v1.3.16):** If a Claude task is already running, new messages interrupt the current task and queue up. After 5 seconds of no new input, all queued messages are merged and processed together. Works identically on both Telegram and Feishu.
320
-
321
- **Auto-restart (v1.3.13):** The daemon watches its own code for changes. When you update MetaMe (via npm or git), the daemon automatically restarts with the new code — no manual restart needed. A notification is pushed to confirm.
322
-
323
- **Emergency & diagnostics (v1.3.13):**
324
-
325
- | Command | Description |
326
- |---------|-------------|
327
- | `/sh <cmd>` | Run shell command directly on your computer — bypasses Claude entirely. Emergency lifeline when the model is broken. |
328
- | `/doctor` | Interactive diagnostics: checks config, model validity, Claude CLI, backups. Shows fix buttons if issues found. |
329
- | `/fix` | Restore `daemon.yaml` from last backup |
330
- | `/reset` | Reset model to opus |
331
-
332
- **Other commands:**
333
-
334
- | Command | Description |
335
- |---------|-------------|
336
- | `/status` | Daemon status + profile summary |
337
- | `/tasks` | List scheduled heartbeat tasks |
338
- | `/run <name>` | Run a task immediately |
339
- | `/model [name]` | Interactive model switcher with buttons (sonnet, opus, haiku). Accepts any model name when using a custom provider. Auto-backs up config before switching. |
340
- | `/list` | File browser with clickable buttons — folders expand, files download. Zero tokens. |
341
- | `/budget` | Today's token usage |
342
- | `/quiet` | Silence mirror/reflections for 48h |
343
- | `/reload` | Manually reload daemon.yaml (also auto-reloads on file change) |
344
-
345
- **Heartbeat Tasks:**
346
-
347
- Define scheduled tasks in `daemon.yaml`:
58
+ Schedule tasks that run on your machine and push results to your phone:
348
59
 
349
60
  ```yaml
61
+ # ~/.metame/daemon.yaml
350
62
  heartbeat:
351
63
  tasks:
352
- - name: "morning-news"
353
- prompt: "Summarize today's top 3 AI news stories."
64
+ - name: "morning-brief"
65
+ prompt: "Summarize my git activity from yesterday"
354
66
  interval: "24h"
355
- model: "haiku"
356
67
  notify: true
357
- precondition: "curl -s -o /dev/null -w '%{http_code}' https://news.ycombinator.com | grep 200"
358
68
  ```
359
69
 
360
- * `precondition`: Shell commandempty output task skipped, zero tokens.
361
- * `type: "script"`: Run a local script directly instead of `claude -p`.
362
- * `notify: true`: Push results to Telegram/Feishu.
363
-
364
- **Workflow tasks** (multi-step skill chains):
70
+ Chain skills into workflowsresearch, write, publish fully automated:
365
71
 
366
72
  ```yaml
367
- heartbeat:
368
- tasks:
369
- - name: "daily-wechat"
73
+ - name: "daily-content"
370
74
  type: "workflow"
371
- interval: "24h"
372
- model: "sonnet"
373
- notify: true
374
75
  steps:
375
76
  - skill: "deep-research"
376
- prompt: "Today's top 3 AI news stories"
77
+ prompt: "Top 3 AI news today"
377
78
  - skill: "tech-writing"
378
- prompt: "Write a WeChat article based on the research above"
79
+ prompt: "Write an article from the research above"
379
80
  - skill: "wechat-publisher"
380
- prompt: "Publish the article"
381
- optional: true
382
- ```
383
-
384
- Each step runs in the same Claude Code session. Step outputs automatically become context for the next step. Set `optional: true` on steps that may fail without aborting the workflow.
385
-
386
- **Auto-reload:** The daemon watches `daemon.yaml` for changes. When Claude (or you) edits the config file, the daemon automatically reloads — no restart or `/reload` needed. A notification is pushed to confirm.
387
-
388
- **Token efficiency:**
389
-
390
- * Polling, slash commands, directory browsing: **zero tokens**
391
- * Stateful sessions: same cost as using Claude Code in terminal (conversation history managed by Claude CLI)
392
- * Budget tracking with daily limit (default 50k tokens)
393
- * 10-second cooldown between Claude calls
394
-
395
- **Security:**
396
-
397
- * `allowed_chat_ids` whitelist — unauthorized users silently ignored (empty = deny all)
398
- * `dangerously_skip_permissions` enabled by default for mobile (users can't click "allow" on phone — security relies on the chat ID whitelist)
399
- * `~/.metame/` directory set to mode 700
400
- * Bot tokens stored locally, never transmitted
401
-
402
- ### Multi-Agent Projects — Context Isolation & Nickname Routing (v1.3.18)
403
-
404
- Organize your work into named agents, each tied to a project directory. Switch between them instantly from your phone — no commands needed, just say their name.
405
-
406
- **How it works:**
407
-
408
- Each `project` entry in `daemon.yaml` defines an agent with a working directory, display name, notification color, and optional nicknames. When you send a message starting with a nickname, the daemon instantly switches to that project's last session — no Claude call, no token cost.
409
-
410
- **Setup via conversation:**
411
-
412
- The easiest way to add an agent is to tell the bot:
413
-
414
- > *"Add a project called 'work' pointing to ~/my-project, nickname is '工作'"*
415
-
416
- Or edit `~/.metame/daemon.yaml` directly:
417
-
418
- ```yaml
419
- projects:
420
- my_agent:
421
- name: "My Agent" # Display name in notifications
422
- icon: "🤖" # Emoji shown in Feishu cards
423
- color: "blue" # Feishu card color: blue|orange|green|purple|red|grey
424
- cwd: "~/my-project" # Working directory for this agent
425
- nicknames: [nickname1, nickname2] # Wake words (matched at message start)
426
- heartbeat_tasks: [] # Scheduled tasks for this project (optional)
81
+ prompt: "Publish it"
427
82
  ```
428
83
 
429
- **Available colors:** `blue` · `orange` · `green` · `purple` · `red` · `grey` · `turquoise`
84
+ ### 4. Skills That Evolve Themselves
430
85
 
431
- **Phone commands:**
86
+ MetaMe has a living skill ecosystem. Skills aren't static configs — they grow.
432
87
 
433
- | Action | How |
434
- |--------|-----|
435
- | Switch agent | Send the nickname alone: `贾维斯` `🤖 Jarvis 在线` |
436
- | Switch + ask | `贾维斯, what's the status?` switches then asks Claude |
437
- | Pick from list | `/agent` → tap button to switch |
438
- | Continue a reply | Reply to any bot message → session auto-restored |
439
- | View all tasks | `/tasks` → grouped by project |
440
- | Run a task | `/run <task-name>` |
88
+ - **Auto-discovery**: When a task fails or a capability is missing, MetaMe's skill-scout automatically searches for, installs, and verifies new skills.
89
+ - **Learning by watching**: Can't automate a complex browser workflow? Say "我来演示" and MetaMe records your actions, then converts them into a reusable skill.
90
+ - **Post-task evolution**: After every significant task, the skill-evolution-manager reviews what worked and what didn't, then surgically updates the relevant skills with new knowledge.
91
+ - **Composable**: Skills chain together in workflows. A `deep-research` skill feeds into `tech-writing`, which feeds into `wechat-publisher` — each one improving from real usage.
441
92
 
442
- **Nickname routing rules:**
443
- - Matched at **message start only** — mentioning a nickname mid-sentence never triggers a switch
444
- - Pure nickname (no content after) → instant switch, zero token cost, bypasses cooldown
445
- - Nickname + content → switch then send content to Claude
446
-
447
- **Heartbeat task notifications** arrive as colored Feishu cards — each project's color is distinct, so you can tell at a glance which agent sent the update.
448
-
449
- ### Provider Relay — Third-Party Model Support (v1.3.11)
450
-
451
- MetaMe supports any Anthropic-compatible API relay as a backend. This means you can route Claude Code through a third-party relay that maps `sonnet`/`opus`/`haiku` to any model (GPT-4, DeepSeek, Gemini, etc.) — MetaMe passes standard model names and the relay handles translation.
452
-
453
- **How it works:** At spawn time, MetaMe injects `ANTHROPIC_BASE_URL` + `ANTHROPIC_API_KEY` environment variables. Zero file mutation — `~/.claude/settings.json` is never touched.
454
-
455
- **CLI commands:**
456
-
457
- ```bash
458
- metame provider # List all providers
459
- metame provider add <name> # Add a relay (prompts for URL & key)
460
- metame provider use <name> # Switch active provider
461
- metame provider remove <name> # Remove a provider (can't remove 'anthropic')
462
- metame provider test [name] # Test connectivity
463
- metame provider set-role distill <name> # Use a different provider for background distill
464
- metame provider set-role daemon <name> # Use a different provider for daemon tasks
465
93
  ```
466
-
467
- **Configuration** (`~/.metame/providers.yaml`):
468
-
469
- ```yaml
470
- active: 'anthropic'
471
- providers:
472
- anthropic:
473
- label: 'Anthropic (Official)'
474
- my-relay:
475
- label: 'My Relay'
476
- base_url: 'https://api.relay.example.com/v1'
477
- api_key: 'sk-xxx'
478
- distill_provider: null # null = use active
479
- daemon_provider: null # null = use active
94
+ Task fails → skill-scout finds a skill → installs → retries → succeeds
95
+
96
+ skill-evolution-manager
97
+ updates skill with lessons learned
480
98
  ```
481
99
 
482
- Three independent provider roles let you optimize cost: e.g., use an official Anthropic key for active work, a cheaper relay for background distill, and another for daemon heartbeat tasks.
483
-
484
- ### Hot Reload (Refresh)
485
-
486
- If you update your profile or need to fix a broken context **without restarting your session**:
100
+ This is the difference between a tool library and an organism. OpenClaw has a skill marketplace; MetaMe has skills that **learn from their own failures**.
487
101
 
488
- * **Inside Claude**: Run `!metame refresh`
489
- * **External Terminal**: Run `metame refresh`
102
+ ---
490
103
 
491
- This re-injects your latest profile into `CLAUDE.md` instantly.
104
+ ## Quick Start
492
105
 
493
- ## ⚙️ Configuration & The "Global Brain"
106
+ ### Install
494
107
 
495
- Your profile is stored in a hidden YAML file in your home directory.
496
-
497
- **Location:** `~/.claude_profile.yaml`
498
-
499
- You can edit this file manually to update your status or lock your values.
500
-
501
- **Example Profile (v2 Schema):**
502
-
503
- **YAML**
504
-
505
- ```
506
- # === T1: Identity (LOCKED) ===
507
- identity:
508
- nickname: Neo # [LOCKED]
509
- role: Senior Architect
510
- locale: en-US # [LOCKED]
511
-
512
- # === T2: Core Traits (LOCKED) ===
513
- core_traits:
514
- crisis_reflex: Analysis # [LOCKED]
515
- flow_trigger: Debugging # [LOCKED]
516
- learning_style: Hands-on # [LOCKED]
517
-
518
- # === T3: Preferences (auto-learnable) ===
519
- preferences:
520
- code_style: concise
521
- communication: direct
522
- explanation_depth: brief_rationale
523
-
524
- # === T3b: Cognition (auto-learnable, slow to change) ===
525
- cognition:
526
- decision_style: analytical
527
- info_processing:
528
- entry_point: big_picture
529
- preferred_format: structured
530
- cognitive_load:
531
- chunk_size: medium
532
- preferred_response_length: moderate
533
-
534
- # === T4: Context (auto-overwrite) ===
535
- context:
536
- focus: "Refactoring Legacy Code"
537
- energy: high
538
-
539
- # === T5: Evolution (system-managed) ===
540
- evolution:
541
- distill_count: 12
542
- last_distill: "2026-01-30T10:00:00Z"
543
- ```
544
-
545
- * **T1-T2 fields** marked `# [LOCKED]` are never auto-modified.
546
- * **T3 fields** are auto-learned with confidence thresholds.
547
- * **T4 fields** are freely overwritten as your context changes.
548
- * **T5 fields** are managed by the distillation system.
549
-
550
- ### Profile Migration (v1 → v2)
551
-
552
- If you have an existing v1 profile, run the migration script:
108
+ ```bash
109
+ # One-line install (includes Node.js + Claude Code if missing)
110
+ curl -fsSL https://raw.githubusercontent.com/Yaron9/MetaMe/main/install.sh | bash
553
111
 
112
+ # Or if you already have Claude Code
113
+ npm install -g metame-cli
554
114
  ```
555
- node ~/.metame/migrate-v2.js --dry-run # preview changes
556
- node ~/.metame/migrate-v2.js # apply migration (auto-backup created)
557
- ```
558
-
559
- ## 🗑️ Uninstallation
560
-
561
- If you wish to remove MetaMe completely from your system, follow these steps:
562
-
563
- ### 1. Remove the Package
564
-
565
- Uninstall the CLI tool:
566
115
 
567
- **Bash**
116
+ ### First Run
568
117
 
569
- ```
570
- npm uninstall -g metame-cli
118
+ ```bash
119
+ metame
571
120
  ```
572
121
 
573
- ### 2. Remove the Global Brain (Optional)
122
+ On first launch, MetaMe runs a brief cognitive interview to build your profile. After that, it's automatic.
574
123
 
575
- If you want to delete your stored profile data:
124
+ ### Enable Mobile Access
576
125
 
577
- **Bash**
578
-
579
- ```
580
- rm ~/.claude_profile.yaml
126
+ ```bash
127
+ metame daemon init # Creates config with setup guide
128
+ metame start # Launches background daemon
581
129
  ```
582
130
 
583
- ### 3. Stop the Daemon (if running)
131
+ Edit `~/.metame/daemon.yaml` with your Telegram bot token or Feishu app credentials, then:
584
132
 
585
133
  ```bash
586
- metame stop
587
-
588
- # macOS: remove auto-start
589
- launchctl unload ~/Library/LaunchAgents/com.metame.daemon.plist 2>/dev/null
590
- rm -f ~/Library/LaunchAgents/com.metame.daemon.plist
591
-
592
- # Linux/WSL: remove auto-start
593
- systemctl --user disable metame-daemon 2>/dev/null
594
- rm -f ~/.config/systemd/user/metame-daemon.service
134
+ metame daemon install-launchd # Auto-start on boot + crash recovery
595
135
  ```
596
136
 
597
- ### 4. Remove Passive Distillation Data (Optional)
137
+ Done. Open Telegram, message your bot.
598
138
 
599
- Remove the signal capture scripts:
139
+ ---
600
140
 
601
- **Bash**
141
+ ## Core Capabilities
602
142
 
603
- ```
604
- rm -rf ~/.metame
605
- ```
143
+ | Capability | What It Does |
144
+ |-----------|-------------|
145
+ | **Cognitive Profile** | Learns how you think across sessions. Schema-enforced, 800-token budget, auto-distilled via Haiku. Lock any value with `# [LOCKED]`. |
146
+ | **Mobile Bridge** | Full Claude Code via Telegram/Feishu. Stateful sessions, file transfer both ways, real-time streaming status. |
147
+ | **Skill Evolution** | Self-healing skill system. Auto-discovers missing skills, learns from browser recordings, evolves after every task. Skills get smarter over time. |
148
+ | **Heartbeat Tasks** | Scheduled Claude runs with cron-like intervals. Preconditions, workflows, push notifications. |
149
+ | **Multi-Agent** | Multiple projects with dedicated chat groups. `/bind` for one-tap setup. True parallel execution. |
150
+ | **Browser Automation** | Built-in Playwright MCP. Browser control out of the box for every user. |
151
+ | **Provider Relay** | Route through any Anthropic-compatible API. Use GPT-4, DeepSeek, Gemini — zero config file mutation. |
152
+ | **Metacognition** | Detects behavioral patterns (decision style, comfort zones, goal drift) and injects mirror observations. Zero extra API cost. |
153
+ | **Emergency Tools** | `/doctor` diagnostics, `/sh` raw shell, `/fix` config restore, `/undo` git-based rollback. |
606
154
 
607
- ### 5. Remove the Signal Capture Hook (Optional)
155
+ ## Mobile Commands
608
156
 
609
- MetaMe installs a global hook in `~/.claude/settings.json`. To remove it, edit the file and delete the `UserPromptSubmit` entry under `hooks`, or run:
157
+ | Command | Action |
158
+ |---------|--------|
159
+ | `/last` | Resume most recent session |
160
+ | `/new` | Start new session (project picker) |
161
+ | `/resume` | Pick from session list |
162
+ | `/stop` | Interrupt current task (ESC) |
163
+ | `/undo` | Rollback with file restoration |
164
+ | `/list` | Browse & download project files |
165
+ | `/model` | Switch model (sonnet/opus/haiku) |
166
+ | `/bind <name>` | Register group as dedicated agent |
167
+ | `/sh <cmd>` | Raw shell — bypasses Claude |
168
+ | `/doctor` | Interactive diagnostics |
610
169
 
611
- **Bash**
170
+ ## How It Works
612
171
 
613
172
  ```
614
- node -e "
615
- const fs = require('fs');
616
- const p = require('os').homedir() + '/.claude/settings.json';
617
- const s = JSON.parse(fs.readFileSync(p, 'utf8'));
618
- if (s.hooks) { delete s.hooks.UserPromptSubmit; }
619
- fs.writeFileSync(p, JSON.stringify(s, null, 2));
620
- console.log('Hook removed.');
621
- "
173
+ ┌─────────────┐ Telegram/Feishu ┌──────────────────────┐
174
+ │ Your Phone │ ◄──────────────────────► │ MetaMe Daemon │
175
+ └─────────────┘ │ (your Mac, 24/7) │
176
+ │ │
177
+ │ ┌──────────────┐ │
178
+ │ │ Claude Code │ │
179
+ │ │ (same engine) │ │
180
+ │ └──────────────┘ │
181
+ │ │
182
+ │ ~/.claude_profile │
183
+ │ (cognitive layer) │
184
+ └──────────────────────┘
622
185
  ```
623
186
 
624
- ### 6. Cleanup Project Files (Optional)
625
-
626
- MetaMe adds a header to `CLAUDE.md` files in your projects. To restore them to their original state (if you have many), you can use a text editor to remove the block starting with `## 🧠 SYSTEM KERNEL`.
627
-
628
- ## ⚡ Performance & Cost
187
+ - **Profile** (`~/.claude_profile.yaml`): Your cognitive fingerprint. Injected into every Claude session via `CLAUDE.md`.
188
+ - **Daemon** (`scripts/daemon.js`): Background process handling Telegram/Feishu messages, heartbeat tasks, and file watching.
189
+ - **Distillation** (`scripts/distill.js`): On each launch, silently analyzes your recent messages and updates your profile.
629
190
 
630
- You might worry: *"Does this eat up my context window?"*
191
+ ## Security
631
192
 
632
- **Short answer: No. It likely saves you money.**
193
+ - All data stays on your machine. No cloud, no telemetry.
194
+ - `allowed_chat_ids` whitelist — unauthorized users are silently ignored.
195
+ - `operator_ids` for shared groups — non-operators get read-only mode.
196
+ - `~/.metame/` directory is mode 700.
197
+ - Bot tokens stored locally, never transmitted.
633
198
 
634
- * **Context Cost**: The entire MetaMe kernel + your profile takes up **~800-1000 tokens**.
635
- * **Impact**: On a 200k context window, this is **0.5%** of the memory.
636
- * **ROI**: By pre-loading your context, you avoid the "instructional drift" and repetitive correction loops that usually waste thousands of tokens at the start of every session.
637
- * **Passive Distillation Cost**: The signal capture hook is a local Node.js script (zero API calls). The Haiku distillation on launch processes only a small buffer of filtered messages — typically a few hundred tokens at Haiku's very low cost.
199
+ ## Performance
638
200
 
639
- ## FAQ
201
+ The entire cognitive layer costs ~800 tokens per session (0.4% of a 200k context window). Background distillation uses Haiku at minimal cost. Mobile commands like `/stop`, `/list`, `/undo` consume zero tokens.
640
202
 
641
- **Q: Does this replace `CLAUDE.md`?**
642
- A: No. It *prepends* its meta-cognitive protocol to your existing `CLAUDE.md`. Your project-specific notes remain intact.
203
+ ## Plugin (Lightweight)
643
204
 
205
+ Don't need mobile access? Install as a Claude Code plugin — profile injection + slash commands only:
644
206
 
645
- **Q: Is my data sent to a third party?**
646
- A: No. Your profile stays local at `~/.claude_profile.yaml`. MetaMe simply passes text to the official Claude Code tool.
647
-
648
- ## 📋 Changelog
649
-
650
- | Version | Highlights |
651
- |---------|------------|
652
- | **v1.3.18** | **Multi-agent project isolation** — `projects` in `daemon.yaml` with per-project heartbeat tasks, Feishu colored cards per project, `/agent` picker button, nickname routing (say agent name to switch instantly), reply-to-message session restoration, fix `~` expansion in project cwd |
653
- | **v1.3.17** | **Windows support** (WSL one-command installer), `install-systemd` for Linux/WSL daemon auto-start. Fix onboarding (Genesis interview was never injected, CLAUDE.md accumulated across runs). Marker-based cleanup, unified protocols, `--append-system-prompt` guarantees interview activation, Feishu auto-fetch chat ID, full mobile permissions, fix `/publish` false-success, auto-restart daemon on script update |
654
- | **v1.3.16** | Git-based `/undo` (auto-checkpoint before each turn, `git reset --hard` rollback), `/nosleep` toggle (macOS caffeinate), custom provider model passthrough (`/model` accepts any name for non-anthropic providers), auto-fallback to anthropic/opus on provider failure, message queue works on Telegram (fire-and-forget poll loop), lazy background distill |
655
- | **v1.3.15** | Native Playwright MCP (browser automation for all users), `/list` interactive file browser with buttons, Feishu image download fix, Skill/MCP/Agent status push, hot restart reliability (single notification, no double instance) |
656
- | **v1.3.14** | Fix daemon crash on fresh install (missing bundled scripts) |
657
- | **v1.3.13** | `/doctor` diagnostics, `/sh` direct shell, `/fix` config restore, `/model` interactive switcher with auto-backup, daemon state caching & config backup/restore |
658
- | **v1.3.12** | Session history bootstrap (cold-start fix), three-layer data architecture (Skeleton + Facets + Haiku), session summary extraction |
659
- | **v1.3.11** | Goal alignment & drift detection, provider relay system for third-party models, `/insights` facet integration |
660
- | **v1.3.10** | `/stop`, `/undo` with file restoration, `/model`, concurrent task protection, `metame continue`, daemon auto-restart on code change |
661
- | **v1.3.8** | Bidirectional file transfer (phone ↔ computer) |
662
- | **v1.3.7** | Real-time streaming status on mobile |
663
- | **v1.3** | Metacognition layer, remote Claude Code (Telegram & Feishu), workflow engine, heartbeat tasks, launchd auto-start |
207
+ ```bash
208
+ claude plugin install github:Yaron9/MetaMe/plugin
209
+ ```
664
210
 
665
- ## 📄 License
211
+ ## License
666
212
 
667
- MIT License. Feel free to fork, modify, and evolve your own Meta-Cognition.
213
+ MIT