agileflow 2.95.2 → 2.95.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.95.3] - 2026-02-01
11
+
12
+ ### Added
13
+ - Fresh restart flag for tmux with conversation auto-resume
14
+
10
15
  ## [2.95.2] - 2026-02-01
11
16
 
12
17
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agileflow",
3
- "version": "2.95.2",
3
+ "version": "2.95.3",
4
4
  "description": "AI-driven agile development system for Claude Code, Cursor, Windsurf, and more",
5
5
  "keywords": [
6
6
  "agile",
@@ -5,6 +5,8 @@
5
5
  # ./claude-tmux.sh # Start in tmux with default session
6
6
  # ./claude-tmux.sh --no-tmux # Start without tmux (regular claude)
7
7
  # ./claude-tmux.sh -n # Same as --no-tmux
8
+ # ./claude-tmux.sh --fresh # Kill and restart with latest scripts
9
+ # ./claude-tmux.sh -f # Same as --fresh
8
10
  # ./claude-tmux.sh --rescue # Kill frozen session and restart fresh
9
11
  # ./claude-tmux.sh --kill # Kill existing session completely
10
12
  # ./claude-tmux.sh --help # Show help with keybinds
@@ -26,6 +28,9 @@ NO_TMUX=false
26
28
  RESCUE=false
27
29
  KILL_SESSION=false
28
30
  SHOW_HELP=false
31
+ FRESH_START=false
32
+ USE_RESUME=false
33
+ RESUME_SESSION_ID=""
29
34
 
30
35
  for arg in "$@"; do
31
36
  case $arg in
@@ -33,6 +38,10 @@ for arg in "$@"; do
33
38
  NO_TMUX=true
34
39
  shift
35
40
  ;;
41
+ --fresh|-f)
42
+ FRESH_START=true
43
+ shift
44
+ ;;
36
45
  --rescue|-r)
37
46
  RESCUE=true
38
47
  shift
@@ -58,6 +67,7 @@ USAGE:
58
67
  agileflow [options] [claude-args...]
59
68
 
60
69
  OPTIONS:
70
+ --fresh, -f Kill existing session and start fresh (use after updates)
61
71
  --no-tmux, -n Run claude without tmux
62
72
  --rescue, -r Kill frozen session and restart fresh
63
73
  --kill Kill existing session completely
@@ -124,6 +134,37 @@ if [ "$RESCUE" = true ]; then
124
134
  # Continue to create new session below
125
135
  fi
126
136
 
137
+ # Handle --fresh flag (kill old session and start fresh with latest scripts + resume conversation)
138
+ if [ "$FRESH_START" = true ]; then
139
+ if tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
140
+ echo "Killing old session: $SESSION_NAME"
141
+ tmux kill-session -t "$SESSION_NAME"
142
+ echo "Starting fresh with latest scripts..."
143
+ sleep 0.3
144
+ else
145
+ echo "No existing session. Starting fresh..."
146
+ fi
147
+
148
+ # Find the most recent session for this directory
149
+ PROJ_DIR=$(pwd | sed 's|/|-|g' | sed 's|^-||')
150
+ SESSIONS_DIR="$HOME/.claude/projects/-$PROJ_DIR"
151
+
152
+ if [ -d "$SESSIONS_DIR" ]; then
153
+ # Get most recent non-agent session (main conversations only)
154
+ RECENT_SESSION=$(ls -t "$SESSIONS_DIR"/*.jsonl 2>/dev/null | grep -v "agent-" | head -1)
155
+ if [ -n "$RECENT_SESSION" ] && [ -s "$RECENT_SESSION" ]; then
156
+ # Extract session ID from filename (remove path and .jsonl extension)
157
+ RESUME_SESSION_ID=$(basename "$RECENT_SESSION" .jsonl)
158
+ echo "Found recent conversation: $RESUME_SESSION_ID"
159
+ USE_RESUME=true
160
+ else
161
+ echo "No previous conversation found. Starting fresh."
162
+ fi
163
+ else
164
+ echo "No session history found. Starting fresh."
165
+ fi
166
+ fi
167
+
127
168
  # Check if tmux auto-spawn is disabled in config
128
169
  METADATA_FILE="docs/00-meta/agileflow-metadata.json"
129
170
  if [ -f "$METADATA_FILE" ]; then
@@ -271,9 +312,16 @@ tmux bind-key -n M-R respawn-pane -k
271
312
 
272
313
  # Send the claude command to the first window
273
314
  CLAUDE_CMD="claude"
315
+ if [ "$USE_RESUME" = true ] && [ -n "$RESUME_SESSION_ID" ]; then
316
+ # Fresh restart with specific conversation resume (skips picker)
317
+ CLAUDE_CMD="claude --resume $RESUME_SESSION_ID"
318
+ elif [ "$USE_RESUME" = true ]; then
319
+ # Fresh restart with conversation picker
320
+ CLAUDE_CMD="claude --resume"
321
+ fi
274
322
  if [ $# -gt 0 ]; then
275
323
  # Pass any remaining arguments to claude
276
- CLAUDE_CMD="claude $*"
324
+ CLAUDE_CMD="$CLAUDE_CMD $*"
277
325
  fi
278
326
  tmux send-keys -t "$SESSION_NAME" "$CLAUDE_CMD" Enter
279
327
 
@@ -93,6 +93,14 @@ class ClaudeCodeSetup extends BaseIdeSetup {
93
93
  }
94
94
  }
95
95
 
96
+ // Copy lib/damage-control-utils.js (required by hook scripts via ../lib/damage-control-utils)
97
+ const libSource = path.join(agileflowDir, 'scripts', 'lib', 'damage-control-utils.js');
98
+ const libTarget = path.join(claudeDir, 'hooks', 'lib', 'damage-control-utils.js');
99
+ if (fs.existsSync(libSource)) {
100
+ await this.ensureDir(path.dirname(libTarget));
101
+ await fs.copy(libSource, libTarget);
102
+ }
103
+
96
104
  // Copy patterns.yaml (preserve existing)
97
105
  const patternsSource = path.join(damageControlSource, 'patterns.yaml');
98
106
  const patternsTarget = path.join(damageControlTarget, 'patterns.yaml');