ctxline-claude 1.6.0 → 1.6.1

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
@@ -88,6 +88,8 @@ chmod +x ~/.claude/hooks/statusline.js
88
88
  }
89
89
  ```
90
90
 
91
+ Note: the effort level only shows on a subagent row when that task has its own effort override — Claude Code doesn't currently report effort for a subagent that just inherits the session's setting.
92
+
91
93
  </details>
92
94
 
93
95
  ## Update
package/bin/install.js CHANGED
@@ -62,9 +62,17 @@ if (fs.existsSync(settingsFile)) {
62
62
  }
63
63
  }
64
64
 
65
+ // Path is quoted — the command runs through a shell, so an unquoted home dir with spaces would split.
66
+ const commandPath = scriptDest.replace(/\\/g, '/');
67
+
65
68
  settings.statusLine = {
66
69
  type: 'command',
67
- command: `node ${scriptDest.replace(/\\/g, '/')}`
70
+ command: `node "${commandPath}"`
71
+ };
72
+
73
+ settings.subagentStatusLine = {
74
+ type: 'command',
75
+ command: `node "${commandPath}" subagent`
68
76
  };
69
77
 
70
78
  fs.writeFileSync(settingsFile, JSON.stringify(settings, null, 2));
@@ -86,26 +94,38 @@ function runUninstall() {
86
94
  return;
87
95
  }
88
96
 
89
- // 1. Remove our statusLine entry from settings.json (preserving everything else)
97
+ // 1. Remove our statusLine/subagentStatusLine entries from settings.json (preserving everything else)
90
98
  if (fs.existsSync(settingsFile)) {
91
99
  try {
92
100
  const settings = JSON.parse(fs.readFileSync(settingsFile, 'utf8'));
93
101
  const command = ((settings.statusLine && settings.statusLine.command) || '').replace(/\\/g, '/');
102
+ const subagentCommand = ((settings.subagentStatusLine && settings.subagentStatusLine.command) || '').replace(/\\/g, '/');
94
103
  // Match our hook path only (covers absolute + manual `~` installs), not any statusline.js.
95
104
  const isOurs = command.includes('/.claude/hooks/statusline.js');
105
+ const isSubagentOurs = subagentCommand.includes('/.claude/hooks/statusline.js');
106
+ let changed = false;
96
107
  if (settings.statusLine && isOurs) {
97
- const backup = `${settingsFile}.backup.${Date.now()}`;
98
- fs.copyFileSync(settingsFile, backup);
99
108
  delete settings.statusLine;
100
- fs.writeFileSync(settingsFile, JSON.stringify(settings, null, 2));
101
- console.log(`${green}✓ Removed statusLine from settings.json (backup: ${path.basename(backup)})${reset}`);
109
+ changed = true;
102
110
  } else if (settings.statusLine) {
103
111
  console.log(`${yellow}! settings.json has a different statusLine — leaving it untouched.${reset}`);
104
112
  } else {
105
113
  console.log(`${green}✓ No statusLine entry in settings.json${reset}`);
106
114
  }
115
+ if (settings.subagentStatusLine && isSubagentOurs) {
116
+ delete settings.subagentStatusLine;
117
+ changed = true;
118
+ } else if (settings.subagentStatusLine) {
119
+ console.log(`${yellow}! settings.json has a different subagentStatusLine — leaving it untouched.${reset}`);
120
+ }
121
+ if (changed) {
122
+ const backup = `${settingsFile}.backup.${Date.now()}`;
123
+ fs.copyFileSync(settingsFile, backup);
124
+ fs.writeFileSync(settingsFile, JSON.stringify(settings, null, 2));
125
+ console.log(`${green}✓ Removed statusLine/subagentStatusLine from settings.json (backup: ${path.basename(backup)})${reset}`);
126
+ }
107
127
  } catch (e) {
108
- console.log(`${red}✗ Could not parse settings.json — remove the "statusLine" block manually.${reset}`);
128
+ console.log(`${red}✗ Could not parse settings.json — remove the "statusLine"/"subagentStatusLine" blocks manually.${reset}`);
109
129
  }
110
130
  }
111
131
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ctxline-claude",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "A customizable statusline for Claude Code that tracks context usage and session limits",
5
5
  "bin": {
6
6
  "ctxline-claude": "bin/install.js"