[BUG] Buddy Species (Companion) inconsistent between sessions with same userId
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Summary
Buddy (Companion) species changes between different sessions despite having the same userId, contradicting the documented "deterministic generation" behavior.
### Environment
- Claude Code version: 2.1.91
- Platform: macOS (Darwin 24.6.0)
- UserId:
316e1a34235bed116f602ce642f1544453ed96a59f5180752c1721f162e82090
### Problem
According to source code analysis, the Buddy system uses Mulberry32 PRNG with userId hash as seed for deterministic pet generation. However, the same userId
produces different species across sessions:
| Timestamp (UTC) | Species | Session ID |
|------------------------|----------|----------------------------------------|
| 2026-04-03T03:34:17 | mushroom | 19165375-f14e-4346-a4d9-cbbe60e81a24 |
| 2026-04-03T06:20:05 | mushroom | be9dc702-f7d3-4801-afa6-027f9040b816 |
| 2026-04-03T07:15:41 | ghost | 8e8e9b97-d935-4196-a4b4-dd0e0ee44204 ← Changed!
| 2026-04-03T07:36:48 | ghost | c57504ff-4eaf-457f-b7b9-350a222f752d |
| 2026-04-03T08:13:22 | ghost | b5b17b2a-5588-418b-b4e2-e9520b84b676 |
### Local Config (.claude.json)
```json
{
"companion": {
"name": "Moth",
"personality": "A common mushroom of few words.",
"hatchedAt": 1775185329846
}
}
The config only stores name, personality, hatchedAt - does NOT store species or attribute values.
Attempted Solutions
- Modified personality field → No effect
- Reset hatchedAt timestamp → No effect
- Restarted Claude Code → No effect
Expected Behavior
- Same userId should always generate the same species
- OR species should be persisted in local config
Actual Behavior
- Species varies between sessions
- Local config cannot control species
Possible Causes
- Incomplete Beta feature: Source comments mention "planned May 2026 launch", current behavior might be an unfinished evolution mechanism
- Seed includes sessionId: If hash seed includes sessionId, each session would generate different species
- Bug: Deterministic generation logic has a flaw
Suggested Fix
- If species should be fixed: persist species to .claude.json companion object
- If species should evolve: display evolution logic and data in UI
---
另外,我已确认配置已正确恢复:
```json
"companion": {
"name": "Moth",
"personality": "A common mushroom of few words.",
"hatchedAt": 1775185329846
}
What Should Happen?
Summary
Buddy (Companion) species changes between different sessions despite having the same userId, contradicting the documented "deterministic generation" behavior.
### Environment
- Claude Code version: 2.1.91
- Platform: macOS (Darwin 24.6.0)
- UserId:
316e1a34235bed116f602ce642f1544453ed96a59f5180752c1721f162e82090
### Problem
According to source code analysis, the Buddy system uses Mulberry32 PRNG with userId hash as seed for deterministic pet generation. However, the same userId
produces different species across sessions:
| Timestamp (UTC) | Species | Session ID |
|------------------------|----------|----------------------------------------|
| 2026-04-03T03:34:17 | mushroom | 19165375-f14e-4346-a4d9-cbbe60e81a24 |
| 2026-04-03T06:20:05 | mushroom | be9dc702-f7d3-4801-afa6-027f9040b816 |
| 2026-04-03T07:15:41 | ghost | 8e8e9b97-d935-4196-a4b4-dd0e0ee44204 ← Changed!
| 2026-04-03T07:36:48 | ghost | c57504ff-4eaf-457f-b7b9-350a222f752d |
| 2026-04-03T08:13:22 | ghost | b5b17b2a-5588-418b-b4e2-e9520b84b676 |
### Local Config (.claude.json)
```json
{
"companion": {
"name": "Moth",
"personality": "A common mushroom of few words.",
"hatchedAt": 1775185329846
}
}
The config only stores name, personality, hatchedAt - does NOT store species or attribute values.
Attempted Solutions
- Modified personality field → No effect
- Reset hatchedAt timestamp → No effect
- Restarted Claude Code → No effect
Expected Behavior
- Same userId should always generate the same species
- OR species should be persisted in local config
Actual Behavior
- Species varies between sessions
- Local config cannot control species
Possible Causes
- Incomplete Beta feature: Source comments mention "planned May 2026 launch", current behavior might be an unfinished evolution mechanism
- Seed includes sessionId: If hash seed includes sessionId, each session would generate different species
- Bug: Deterministic generation logic has a flaw
Suggested Fix
- If species should be fixed: persist species to .claude.json companion object
- If species should evolve: display evolution logic and data in UI
---
另外,我已确认配置已正确恢复:
```json
"companion": {
"name": "Moth",
"personality": "A common mushroom of few words.",
"hatchedAt": 1775185329846
}
Error Messages/Logs
Steps to Reproduce
Bug: Buddy species changes between sessions (mushroom ↔ ghost) despite same userId.
Fix needed: Persist species in .claude.json companion config, or fix deterministic generation.
Version: Claude Code 2.1.91 (macOS)
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
v2.1.91
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗