Skip to content
Development
Command

/improve

Analyze recent sessions for improvement opportunities

From plugin
autonomous-dev
3226 skills16 agents26 commands1 MCP
Install
$ npx -y skills add akaszubski/autonomous-dev --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/improve

Context preview

What this command does when you run it.

Analyze recent sessions for improvement opportunities

Command definition

improve.md
name: improve
description: "Analyze recent sessions for improvement opportunities"
argument-hint: "[--auto-file] [--session <id>] [--date YYYY-MM-DD] [--trends]"
allowed-tools: [Task, Read, Bash, Glob, Grep]
user-invocable: true
user_facing: true

Continuous Improvement Analysis

Analyze session activity logs to test whether autonomous-dev's automation is working correctly — hooks firing, pipeline executing, HARD GATEs enforcing.

Usage

# Analyze today's sessions
/improve

# Also create GitHub issues for findings
/improve --auto-file

# Analyze specific session
/improve --session abc123

# Analyze specific date
/improve --date 2026-02-15

# Trend analysis across all sessions and CI issues
/improve --trends

Arguments

  • `--auto-file`: Create GitHub issues in `akaszubski/autonomous-dev` for detected problems (default: report only)
  • `--session <id>`: Analyze a specific session ID
  • `--date YYYY-MM-DD`: Analyze a specific date (default: today)
  • `--trends`: Aggregate analysis across all auto-improvement issues and recent sessions. Identifies recurring patterns, worsening metrics, and systemic gaps.

Implementation

STEP 1: Load Activity Logs

Read session logs from `.claude/logs/activity/`:

# Find available logs
ls -la .claude/logs/activity/*.jsonl 2>/dev/null

If `--date` specified, load that date's log. Otherwise load today's. If `--session` specified, filter entries to that session ID.

If no logs found, report: "No activity logs found. The session_activity_logger hook must be active to generate logs. Verify that your settings include all 4 hook layers (UserPromptSubmit, PreToolUse, PostToolUse, Stop)."

STEP 2: Gather Ground Truth Context

Read autonomous-dev's source-of-truth documents to provide to the analyst:

1. **PROJECT.md**: Read `.claude/PROJECT.md` (or locate via `plugins/autonomous-dev/`) — extract GOALS and enforcement sections 2. **CLAUDE.md**: Read `CLAUDE.md` — extract Critical Rules section 3. **Known bypass patterns**: Read `plugins/autonomous-dev/config/known_bypass_patterns.json` 4. **Recent git history**: `git log --oneline -20` 5. **Repo context (registered hooks)**: Read the target repo's settings.json to calibrate expectations:

   cat .claude/settings.json 2>/dev/null | python3 -c "import sys,json; d=json.load(sys.stdin); hooks=d.get('hooks',{}); print(json.dumps({k: [h.get('command','') for h in v] if isinstance(v,list) else v for k,v in hooks.items()}))" 2>/dev/null || echo "{}"

STEP 2.5: Skill Effectiveness Report

Scan skill baselines for weak, low-quality, or stale skills:

python3 -c "
import sys, json, os as _os
for _p in ('.claude/lib', 'plugins/autonomous-dev/lib', _os.path.expanduser('~/.claude/lib')):
    if _os.path.isdir(_p):
        sys.path.insert(0, _p)
        break
from skill_change_detector import get_weak_skills
from pathlib import Path

baselines_path = Path('tests/genai/skills/baselines/effectiveness.json')
weak = get_weak_skills(baselines_path, min_delta=0.10, min_pass_rate=0.80, stale_days=30)

if weak:
    print('WEAK SKILLS DETECTED:')
    for s in weak:
        print(f\"  - {s['skill_name']}: {s['reason']} (delta={s['delta']:+.2f}, pass_rate={s['pass_rate_with']:.2f})\")
else:
    print('All skills within acceptable thresholds.')
"

Pass the weak skill list to the CI analyst agent in STEP 3 so it can include skill health in its analysis. Skills flagged here are candidates for `/skill-eval --update` runs.

STEP 2.7: Test Health Report

Run the TestLifecycleManager to generate a unified test health dashboard:

python3 -c "
import sys, os as _os
for _p in ('.claude/lib', 'plugins/autonomous-dev/lib', _os.path.expanduser('~/.claude/lib')):
    if _os.path.isdir(_p):
        sys.path.insert(0, _p)
        break
from test_lifecycle_manager import TestLifecycleManager
from pathlib import Path

manager = TestLifecycleManager(Path('.'))
report = manager.analyze()
print(manager.format_dashboard(report))
" 2>/dev/null || echo "Test health report unavailable"

Pass the dashboard output to the CI analyst agent in STEP 3 so it can include test lifecycle health in its analysis.

STEP 2.8: Test Pruning Analysis (Weekly)

Run `/sweep --tests` analysis to surface prunable test candidates as part of the weekly cycle (root-cause Issue #908):

# Only run if last weekly run was ≥7 days ago (avoid redundant slow scans)
last_prune_log=$(find .claude/logs -name "sweep-tests-*.log" -mtime -7 2>/dev/null | head -1)
if [ -z "$last_prune_log" ]; then
    echo "Running weekly test pruning analysis (Issue #908)..."
    python3 -c "
import sys, os as _os
from datetime import datetime
from pathlib import Path
for _p in ('.claude/lib', 'plugins/autonomous-dev/lib', _os.path.expanduser('~/.claude/lib')):
    if _os.path.isdir(_p):
        sys.path.insert(0, _p)
        break
try:
    from test_pruning_analyzer import TestPruningAnalyzer
    analyzer = TestPruningAnalyzer(Path('.'))
    report = analyzer.analyze()
    prunable = sum(1 for f in report.findings if f.prunable)
    total = len(report.findings)
    print(f'Pruning analysis: {prunable} prunable / {total} total findings across {report.files_scanned} files ({report.scan_duration_ms:.0f}ms)')
    # Persist weekly log for cycle tracking
    log_dir = Path('.claude/logs')
    log_dir.mkdir(parents=True, exist_ok=True)
    stamp = datetime.now().strftime('%Y%m%d')
    (log_dir / f'sweep-tests-{stamp}.log').write_text(
        f'prunable={prunable} total={total} files={report.files_scanned} ms={report.scan_duration_ms:.0f}\\n'
    )
except Exception as e:
    print(f'Test pruning analysis unavailable: {e}')
" 2>&1
else
    echo "Test pruning analysis already run this week (last: $last_prune_log)"
fi

Pass the prunable-count summary to the CI analyst in STEP 3 so it can include test-pruning drift in its analysis. Drift target: prunable count should trend toward <500 (Issue #908 acceptance criterion).

Read more
Ships withautonomous-dev

A harness that wraps Claude Code with enforcement, specialist agents, and alignment gates to deliver consistent, production-grade software engineering outcomes.

Get the whole plugin, auto-invoked
Stats
32
Stars
0
Views
5
Forks
Active
Maintenance
Python
Language
2h ago
Last commit
9mo ago
Created

Repo: akaszubski/autonomous-dev