Summary
.claude/homunculus/identity.json tracks instincts.personal and instincts.inherited as numeric counters, but nothing keeps them in sync with the actual files in .claude/homunculus/instincts/{personal,inherited}/. After spawning observer agents that wrote 80 new instincts, identity.json.instincts.personal stayed at 0 until I manually edited it.
Repro
- Spawn an observer agent that writes new instinct files to
instincts/personal/
- Inspect
identity.json after — instincts.personal is unchanged
/homunculus:status reports the wrong count
The agents/observer.md doesn't tell the observer to update identity.json.instincts.personal, only evolution.ready (and only when crossing the cluster threshold).
Why this matters
/homunculus:status displays the wrong count
/homunculus:evolve's "no clusters yet" path reads from identity.json — could miss real clusters
- Operators (humans or future agents) can't trust the file as ground truth
Suggested fix
Pick one:
- Make the filesystem source of truth. Drop the numeric counts from identity.json. Anything that needs the count does
ls instincts/personal/ | wc -l or equivalent. The status/evolve commands already shell out — they can compute on the fly.
- Atomic writes via a helper. Provide a
scripts/write-instinct.sh (or similar) that writes the file AND updates identity.json in one step. Update agents/observer.md and skills/evolution/ to call it. Counts stay accurate but require discipline from any code path that creates instincts.
- PostToolUse hook. When
Write lands a file under instincts/personal/, a hook recomputes counts. Self-healing but more moving parts.
(1) is the simplest. The numbers in identity.json are derived data; treating them as authoritative invites drift.
Related
Adjacent to #14 (evolved-capabilities not auto-loaded) — both stem from identity.json being treated as state rather than computed view.
Context
- Plugin: 2.0.0-alpha
- Hit while distilling 80 instincts from a 3-month observation backlog
Summary
.claude/homunculus/identity.jsontracksinstincts.personalandinstincts.inheritedas numeric counters, but nothing keeps them in sync with the actual files in.claude/homunculus/instincts/{personal,inherited}/. After spawning observer agents that wrote 80 new instincts,identity.json.instincts.personalstayed at 0 until I manually edited it.Repro
instincts/personal/identity.jsonafter —instincts.personalis unchanged/homunculus:statusreports the wrong countThe
agents/observer.mddoesn't tell the observer to updateidentity.json.instincts.personal, onlyevolution.ready(and only when crossing the cluster threshold).Why this matters
/homunculus:statusdisplays the wrong count/homunculus:evolve's "no clusters yet" path reads from identity.json — could miss real clustersSuggested fix
Pick one:
ls instincts/personal/ | wc -lor equivalent. The status/evolve commands already shell out — they can compute on the fly.scripts/write-instinct.sh(or similar) that writes the file AND updates identity.json in one step. Updateagents/observer.mdandskills/evolution/to call it. Counts stay accurate but require discipline from any code path that creates instincts.Writelands a file underinstincts/personal/, a hook recomputes counts. Self-healing but more moving parts.(1) is the simplest. The numbers in identity.json are derived data; treating them as authoritative invites drift.
Related
Adjacent to #14 (evolved-capabilities not auto-loaded) — both stem from
identity.jsonbeing treated as state rather than computed view.Context