This repository was archived by the owner on Nov 17, 2025. It is now read-only.
Commit bd41ebf
committed
Fix Claude detection by properly parsing KERN_PROCARGS2 format
- Parse process arguments correctly, handling null-separated components
- Look for 'claude' as a standalone argument after the executable path
- Handle both direct 'claude' commands and 'node claude' invocations
- Skip empty components and argc bytes at the beginning
The format is: [4 bytes argc][executable\0][padding\0s][arg0\0][arg1\0]...
This fixes detection of Claude processes that show as 'node claude' in ps.1 parent 0beb202 commit bd41ebf
1 file changed
Lines changed: 29 additions & 6 deletions
Lines changed: 29 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
215 | 223 | | |
216 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
217 | 240 | | |
218 | 241 | | |
219 | 242 | | |
| |||
0 commit comments