Skip to content

Commit 363c18d

Browse files
Demwunzclaude
andcommitted
fix: remove non-functional subagent tracking (#1)
Claude Code doesn't expose subagent counts in its statusline JSON schema. Subagents are API calls within the same process, not separate `claude` child processes, so process-table scanning can't detect them. Removes dead code and references until upstream adds the field. See: #1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 51b87e1 commit 363c18d

4 files changed

Lines changed: 4 additions & 27 deletions

File tree

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ A lightweight statusline for [Claude Code](https://docs.anthropic.com/en/docs/cl
1616

1717
- 📊 **Context breakdown** - Visual bar showing token usage by segment
1818
- 🚦 **Degradation thresholds** - Color-coded warnings as context fills up
19-
-**Subagent tracking** - See how many background agents are running
2019
- 💰 **Cost tracking** - Session and daily spending at a glance
2120
- 🔀 **Git integration** - Branch, staged/unstaged changes, ahead/behind
2221
- 📁 **Working directory** - Fish-style abbreviated paths
@@ -34,8 +33,8 @@ Built in Rust with zero runtime dependencies. A statusline runs on every prompt,
3433
## What It Shows
3534

3635
```
37-
[opus] ▓▓▓████████████░░░░░░░░ 42% 116k left ⚡3 │ 1h 30m │ $0.45 / $12.30 │ main ✚2 │ ~/d/myproject
38-
▲ context bar ▲ remaining ▲ subagents ▲ elapsed ▲ cost ▲ git ▲ path
36+
[opus] ▓▓▓████████████░░░░░░░░ 42% 116k left │ 1h 30m │ $0.45 / $12.30 │ main ✚2 │ ~/d/myproject
37+
▲ context bar ▲ remaining ▲ elapsed ▲ cost ▲ git ▲ path
3938
```
4039

4140
**Context bar** — two textures show overhead vs conversation at a glance:
@@ -58,7 +57,6 @@ Built in Rust with zero runtime dependencies. A statusline runs on every prompt,
5857
Remaining tokens shown after percentage (e.g. `178k left`, `1.2m left`).
5958

6059
**Other indicators:**
61-
- `⚡n` — active subagents (hidden when 0)
6260
- 🟢 green branch = clean, 🔴 red = dirty, `↑↓` ahead/behind, `✚●?` staged/unstaged/untracked
6361
- Paths are fish-style abbreviated (`~/d/cc-statusline`)
6462

demo.tape

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Type "# 45% — degrading zone (yellow), recall precision drops"
3636
Enter
3737
Sleep 500ms
3838

39-
Type@50ms `echo '{"model":{"display_name":"Opus"},"context_window":{"total_input_tokens":60000,"total_output_tokens":20000,"context_window_size":200000,"used_percentage":45,"remaining_percentage":55},"cost":{"total_cost_usd":1.20,"total_duration_ms":900000},"workspace":{"current_dir":"/Users/demo/dev/cc-statusline"},"subagents":{"active":3}}' | cc-statusline`
39+
Type@50ms `echo '{"model":{"display_name":"Opus"},"context_window":{"total_input_tokens":60000,"total_output_tokens":20000,"context_window_size":200000,"used_percentage":45,"remaining_percentage":55},"cost":{"total_cost_usd":1.20,"total_duration_ms":900000},"workspace":{"current_dir":"/Users/demo/dev/cc-statusline"}}' | cc-statusline`
4040
Enter
4141
Sleep 2s
4242

src/main.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,6 @@ struct StdinInput {
8383
workspace: Option<WorkspaceInfo>,
8484
#[serde(default)]
8585
session_id: Option<String>,
86-
#[serde(default)]
87-
subagents: Option<SubagentInfo>,
88-
}
89-
90-
#[derive(Debug, Deserialize)]
91-
struct SubagentInfo {
92-
#[serde(default)]
93-
active: u32,
9486
}
9587

9688
#[derive(Debug, Deserialize)]
@@ -179,9 +171,6 @@ fn run_statusline(config: &Config) {
179171

180172
let cwd = input.workspace.as_ref().and_then(|w| w.current_dir.clone());
181173

182-
// Get subagent count
183-
let subagent_count = input.subagents.as_ref().map(|s| s.active).unwrap_or(0);
184-
185174
// Get cached scanner results
186175
let (skills_tokens, plugins_tokens, mcp_tokens) = cache.get();
187176

@@ -212,7 +201,6 @@ fn run_statusline(config: &Config) {
212201
history.daily_cost,
213202
&git_status,
214203
cwd.as_deref(),
215-
subagent_count,
216204
config,
217205
);
218206

src/render.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::colors::{self, BOLD, DIM, RESET, GREEN, RED, YELLOW, CYAN};
1+
use crate::colors::{self, BOLD, DIM, RESET, GREEN, RED, YELLOW};
22
use crate::config::Config;
33
use crate::context::ContextBreakdown;
44
use crate::git::GitStatus;
@@ -17,7 +17,6 @@ pub fn render(
1717
daily_cost: f64,
1818
git: &GitStatus,
1919
cwd: Option<&str>,
20-
subagent_count: u32,
2120
config: &Config,
2221
) -> String {
2322
let mut output = String::new();
@@ -53,11 +52,6 @@ pub fn render(
5352
output.push_str(&format!(" {DIM}{} left{RESET}", format_tokens(breakdown.remaining_tokens)));
5453
}
5554

56-
// Subagent count (only show when > 0)
57-
if subagent_count > 0 {
58-
output.push_str(&format!(" {CYAN}⚡{}{RESET}", subagent_count));
59-
}
60-
6155
// Session time (elapsed)
6256
output.push_str(&format!(" {DIM}│{RESET} "));
6357
output.push_str(&format_duration_ms(duration_ms));
@@ -357,7 +351,4 @@ pub fn print_legend(config: &Config) {
357351
println!(" {DIM}?n{RESET} = untracked files");
358352
println!();
359353
println!("Path: current working directory, fish-style (~/d/project)");
360-
println!();
361-
println!("Subagents:");
362-
println!(" {CYAN}⚡n{RESET} = active subagents (shown only when > 0)");
363354
}

0 commit comments

Comments
 (0)