You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add time tracking workflow for AI cost optimization (AIML-231)
Added comprehensive "Time Tracking for AI Cost Optimization" section to
CLAUDE.md documenting the complete workflow for tracking time spent on beads
to optimize AI development spend.
Key features:
- Comment-based time tracking with ⏱️ START/END markers
- Label-based categorization for duration buckets and AI effectiveness
- Parent vs child bead tracking strategies
- Rating workflow with AI calculation and user confirmation
- Analysis framework for identifying AI value patterns
Workflow tracks:
- Duration buckets: 0-15min, 15-30min, 30-60min, 1-2hr, 2hr+
- AI effectiveness: ai-multiplier, ai-helpful, ai-neutral, ai-friction
- When to track: Parent beads (in_progress → PR), Child beads (start → close)
Purpose: Identify which code change types benefit most from AI assistance
and where AI adds friction vs value to optimize AI spend decisions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+108-5Lines changed: 108 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,6 +131,95 @@ Example: If B must be done after A completes, use `bd dep add B A` (not `bd dep
131
131
132
132
Verify with `bd show <task-id>` - dependent tasks show "Depends on", prerequisites show "Blocks".
133
133
134
+
### Time Tracking for AI Cost Optimization
135
+
136
+
This project tracks development time and AI effectiveness to optimize AI spend on code changes. Time tracking uses comments for precise timestamps and labels for categorization.
137
+
138
+
**Time Tracking Rules:**
139
+
140
+
**Parent Beads (Jira-linked, generate PR):**
141
+
-**START:** When parent bead is set to `in_progress` (when coding work begins)
142
+
-**END:** When PR is created (after all children complete and branch is ready for review)
143
+
-**Duration:** Captures full end-to-end timeline from first work to PR creation
144
+
-**Rating:** Asked once when PR is created
145
+
146
+
**Child Beads (use parent's branch, no PR):**
147
+
-**START:** When child bead is set to `in_progress` (when work on that subtask begins)
148
+
-**END:** When child bead is closed (when that specific subtask completes)
149
+
-**Duration:** Captures time spent on that specific child
bd comments add <bead-id>"⏱️ START: $(date -u +%Y-%m-%dT%H:%M:%SZ) - [Brief description of what you're starting]"
296
+
```
204
297
- Record the branch name in the bead (so it's easily found later)
205
298
- **If this is a stacked branch** (based on another PR branch):
206
299
- Label the bead with `stacked-branch`
@@ -311,12 +404,16 @@ This workflow creates a standard PR ready for immediate review, targeting the `m
311
404
**2. Push to remote:**
312
405
- Push the feature branch to remote repository
313
406
314
-
**3. Create or update Pull Request:**
407
+
**3. Complete time tracking:**
408
+
- Follow the **"Completing Time Tracking"** process in the Time Tracking section
409
+
- This is for parent beads only (child beads were already rated when closed)
410
+
411
+
**4. Create or update Pull Request:**
315
412
- If PR doesn't exist, create it with base branch `main`
316
413
- If PR exists, update the description
317
414
- PR should be ready for review (NOT draft)
318
415
319
-
**4. Generate comprehensive PR description:**
416
+
**5. Generate comprehensive PR description:**
320
417
- Follow the **"Creating High-Quality PR Descriptions"** section above
321
418
- Use the standard structure: Why / What / How / Walkthrough / Testing
322
419
- No special warnings or dependency context needed
@@ -339,7 +436,11 @@ This workflow creates a draft PR that depends on another unmerged PR (stacked br
339
436
**3. Push to remote:**
340
437
- Push the feature branch: `git push -u origin <branch-name>`
341
438
342
-
**4. Create DRAFT Pull Request:**
439
+
**4. Complete time tracking:**
440
+
- Follow the **"Completing Time Tracking"** process in the Time Tracking section
441
+
- This is for parent beads only (child beads were already rated when closed)
442
+
443
+
**5. Create DRAFT Pull Request:**
343
444
- **Base branch**: Set to the parent PR's branch (NOT main)
344
445
- **Status**: MUST be draft
345
446
- **Title**: Include `[STACKED]` indicator
@@ -362,7 +463,7 @@ This workflow creates a draft PR that depends on another unmerged PR (stacked br
362
463
- After the warning and dependency context, follow the **"Creating High-Quality PR Descriptions"** section
363
464
- Use the standard structure: Why / What / How / Walkthrough / Testing
364
465
365
-
**5. Verify configuration:**
466
+
**6. Verify configuration:**
366
467
- Confirm PR is in draft status
367
468
- Confirm base branch is the parent PR's branch
368
469
- Confirm warning and dependency context are prominently displayed
@@ -561,4 +662,6 @@ This workflow is for ending the current session while preserving all state so wo
561
662
562
663
**Cannot close parent beads** if they still have open children. Ensure all child beads are closed first.
563
664
564
-
Beads typically remain `in_progress` (with `in-review` label) until the PR review is complete and merged. Only close beads when explicitly instructed by the user.
665
+
**For child beads:** When closing a child bead, complete time tracking using the **"Completing Time Tracking"** process in the Time Tracking section. This captures the time spent on that specific subtask.
666
+
667
+
**For parent beads:** Time tracking is completed when the PR is created, not when the bead is closed. Beads typically remain `in_progress` (with `in-review` label) until the PR review is complete and merged. Only close beads when explicitly instructed by the user.
0 commit comments