eagle-mem 4.0.2 → 4.0.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/curate.sh +13 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eagle-mem",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "Persistent memory for Claude Code — SQLite + FTS5, no daemon, no bloat",
5
5
  "bin": {
6
6
  "eagle-mem": "bin/eagle-mem"
package/scripts/curate.sh CHANGED
@@ -168,24 +168,30 @@ command_stats=$(eagle_db "SELECT command_category,
168
168
  LIMIT 10;")
169
169
 
170
170
  if [ -n "$command_stats" ]; then
171
- # Get specific noisy commands
172
- noisy_commands=$(eagle_db "SELECT tool_input_summary,
171
+ # Get noisy commands grouped by base command (first 2 words) to catch variants
172
+ # e.g. "git diff", "git diff HEAD~1", "git -C /path diff" all group under "git diff"
173
+ noisy_commands=$(eagle_db "SELECT
174
+ CASE
175
+ WHEN tool_input_summary LIKE 'Bash: cd %' THEN 'cd ... && ' || SUBSTR(tool_input_summary, INSTR(tool_input_summary, '&& ') + 3, 40)
176
+ ELSE SUBSTR(tool_input_summary, 7, 40)
177
+ END as base_cmd,
173
178
  COUNT(*) as count,
174
179
  CAST(AVG(output_bytes) AS INTEGER) as avg_bytes,
180
+ CAST(MAX(output_bytes) AS INTEGER) as max_bytes,
175
181
  CAST(AVG(output_lines) AS INTEGER) as avg_lines
176
182
  FROM observations
177
183
  WHERE project = '$p_esc'
178
184
  AND tool_name = 'Bash'
179
- AND output_bytes > 1000
180
- GROUP BY tool_input_summary
181
- HAVING count >= 3
185
+ AND output_bytes > 2000
186
+ GROUP BY base_cmd
187
+ HAVING count >= 2
182
188
  ORDER BY avg_bytes DESC
183
189
  LIMIT 15;")
184
190
 
185
191
  if [ -n "$noisy_commands" ]; then
186
- cmd_prompt="Analyze these frequently-run commands and their output sizes for project '$project'. Suggest compression rules for commands that produce consistently large output.
192
+ cmd_prompt="Analyze these frequently-run command patterns and their output sizes for project '$project'. Suggest compression rules for commands that produce consistently large output (>2KB average).
187
193
 
188
- COMMAND STATS (command | times_run | avg_output_bytes | avg_output_lines):
194
+ COMMAND PATTERNS (base_command | times_run | avg_bytes | max_bytes | avg_lines):
189
195
  $noisy_commands
190
196
 
191
197
  For each command that deserves a compression rule, output EXACTLY: