Iteratively optimize your Claude Code flow state.
autoflow analyzes your Claude Code permission patterns and recommends auto-allow rules to reduce interruptions. It measures "flow score" — the percentage of tool calls that don't require a permission prompt — and helps you improve it.
claude plugin install ~/git/autoflowOr run with:
claude --plugin-dir ~/git/autoflow/autoflow silently injects one top recommendation at session start. If there's nothing to suggest, it stays completely silent.
/autoflow:audit
This runs a full analysis of the last 7 days of sessions and walks you through recommendations interactively.
# Full JSON report
python3 scripts/analyze.py --mode full --days 7
# Single recommendation for hook
python3 scripts/analyze.py --mode quick --days 7
# Apply a rule to settings.json
python3 scripts/analyze.py --mode apply --pattern "Bash(git status *)"autoflow reads your Claude Code session transcripts (~/.claude/projects/*/*.jsonl) and:
- Parses every tool call and its result
- Classifies each as approved or denied
- Extracts multi-level command patterns (e.g.,
Bash(git *)vsBash(git status *)) - Cross-references against your current
~/.claude/settings.jsonallow list - Flags destructive commands that should stay prompted
- Recommends the optimal granularity level for each command group
For each command group, autoflow analyzes at multiple granularity levels:
- Level 0 (broad):
Bash(git *)— covers all git commands - Level 1 (subcommand):
Bash(git status *)— covers one subcommand
If all uses at level 0 are safe (no denials, no destructive subcommands), it recommends the broad pattern. Otherwise, it recommends individual safe subcommands.
- low — 0 denials, 5+ approvals, not destructive
- medium — 0 denials but destructive or < 5 approvals
- high — any denials
- Python 3.6+ (stdlib only, no dependencies)
- Claude Code with session transcripts
MIT