mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-17 21:42:11 +00:00
On native Windows, Claude Code runs each hook as `bash.exe -c "<command>"` through the Windows command line. That extra unescape layer collapses the backslashes in the WSL path conversion of the inline plugin-root resolver, so `.replace(/\\/g,'/')` reaches node as `.replace(/\/g,'/')` and every hook fails with `SyntaxError: missing ) after argument list`. Build the backslash separator with String.fromCharCode(92) and split/join instead of regex escapes, so the resolver contains no backslash. Conversion behaviour is unchanged. Regenerate every embedded copy (hooks.json, codex-hooks.json, commands/*.md) and refresh hooks.metadata.json fingerprints. Add a test that the resolver and each hook `node -e` program are backslash-free, and run the shipped SessionStart command through bash with backslashes collapsed the way Windows does. Fixes #3746
3.2 KiB
3.2 KiB
name, description, command
| name | description | command |
|---|---|---|
| instinct-status | Show learned instincts (project + global) with confidence | true |
Instinct Status Command
Shows learned instincts for the current project plus global instincts, grouped by domain.
Implementation
Run the instinct CLI, resolving the active ECC plugin root the same way
hooks/hooks.json and the other slash commands (/sessions, /skill-health)
do — env var → standard install → known plugin roots → plugin cache → fallback.
This avoids the divergence that happens when CLAUDE_PLUGIN_ROOT is unset
while a legacy ~/.claude/skills/continuous-learning-v2/ directory still
exists (#2037).
ECC_ROOT="$(node -e "var r=(function(){var p=require('path'),f=require('fs'),o=require('os');var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var d=(process.env.CLAUDE_CONFIG_DIR||'').trim()||p.join(o.homedir(),'.claude');if(d==='~')d=o.homedir();else if(d.charAt(0)==='~'&&(d.charAt(1)==='/'||d.charCodeAt(1)===92))d=p.join(o.homedir(),d.slice(2));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var b=String.fromCharCode(92),m=d.match(/^([A-Za-z]):/);if(m&&(d.charAt(2)==='/'||d.charAt(2)===b)){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).split(b).join('/')}}}}catch(_){}d=p.resolve(d);function L(x){try{return require(p.join(x,'scripts','lib','resolve-ecc-root')).resolveEccRoot()}catch(_){return null}}var r=L(d);if(r)return r;var s=['ecc','ecc@ecc','marketplaces/ecc','everything-claude-code','everything-claude-code@everything-claude-code','marketplaces/everything-claude-code'];for(var i=0;i<s.length;i++){r=L(p.join(d,'plugins',s[i]));if(r)return r}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}var g=['ecc','everything-claude-code'];for(var j=0;j<g.length;j++){var c=p.join(d,'plugins','cache',g[j]);var O=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
python3 "$ECC_ROOT/skills/continuous-learning-v2/scripts/instinct-cli.py" status
Usage
/instinct-status
What to Do
- Detect current project context (git remote/path hash)
- Read project instincts from
~/.claude/homunculus/projects/<project-id>/instincts/ - Read global instincts from
~/.claude/homunculus/instincts/ - Merge with precedence rules (project overrides global when IDs collide)
- Display grouped by domain with confidence bars and observation stats
Output Format
============================================================
INSTINCT STATUS - 12 total
============================================================
Project: my-app (a1b2c3d4e5f6)
Project instincts: 8
Global instincts: 4
## PROJECT-SCOPED (my-app)
### WORKFLOW (3)
███████░░░ 70% grep-before-edit [project]
trigger: when modifying code
## GLOBAL (apply to all projects)
### SECURITY (2)
█████████░ 85% validate-user-input [global]
trigger: when handling user input