Complete guide to managing sessions and conversations.
A session represents one focused piece of work (typically one JIRA ticket) with:
- Session name and ID
- Goal/description
- JIRA ticket link (optional)
- Workspace (named workspace location - enables concurrent sessions)
- Time tracking data (shared across all conversations)
- Progress notes
- Status (created, in_progress, paused, complete)
- One or more conversations (one per project directory)
A conversation represents work in a specific project directory with:
- Active conversation - Your current Claude Code conversation
- Claude Code conversation history
- Project path (repository directory)
- Git branch
- Claude session ID (UUID)
- Last active timestamp
- Archived conversations - Previous Claude Code conversations in the same repository
- Full conversation history preserved
- Summary of what was accomplished
- Can be viewed with
daf list
Key Points:
- Multi-project sessions create ONE conversation with SHARED CONTEXT across all selected projects - enabling Claude to coordinate changes across repositories
- Legacy sessions can have multiple separate conversations - one for each project (backward compatibility)
- Each conversation can have multiple Claude Code sessions (active + archived) for starting fresh while preserving history
Sessions progress through these states:
created → in_progress → complete
Status values (as displayed in daf list and other commands):
- created - Session exists but hasn't been opened yet
- in_progress - Currently working on (or worked on recently)
- paused - Session paused (time tracking stopped)
- complete - Work finished, session archived
Note: Status values are shown as-is in all outputs and match the filter values used with --status flag.
Workspaces enable you to work on the same project with different branches in parallel without conflicts. Each workspace is a named location (like VSCode workspaces) that can have its own active sessions.
A workspace is a named directory where you organize repositories. Examples:
primary- Your main development workspace (e.g.,~/development)product-a,product-b- Organize repositories by product (e.g.,~/development/product-a,~/development/product-b)feat-caching- Experimental caching feature branch (e.g.,~/work/caching)client-acme,client-globex- Separate client codebases
Concurrent Sessions on Same Project: Without workspaces, you can only have ONE active session per project directory at a time. With workspaces, you can work on the same project in different workspaces simultaneously:
# Terminal 1: Main development in primary workspace
daf new --name PROJ-123 -w primary --path ~/development/myproject
# Working on main branch with one conversation
# Terminal 2: Experimental work in different workspace
daf new --name PROJ-123 -w experiments --path ~/experiments/myproject
# Working on experimental branch with separate conversation
# No conflict! They're in different workspaces.Key Benefits:
- Work on main branch + experimental feature branch in parallel
- Organize repos by product, team, or workflow
- Sessions remember their workspace automatically
- No conflicts between concurrent sessions
When creating or opening sessions, workspace is resolved in this order:
-w, --workspaceflag - Explicit workspace (highest priority)- Session stored workspace - Workspace from session creation
- Default workspace - Workspace marked as default in config
- Interactive prompt - Select from available workspaces
Examples:
# Priority 1: -w flag overrides everything
daf new --name "api-work" -w product-a # Uses product-a workspace
daf open api-work -w primary # Override to primary
# Priority 2: Session remembers workspace
daf new --name "feature" -w feat-caching # Creates in feat-caching
daf open feature # Uses feat-caching (remembered)
# Priority 3: Default workspace (no -w, no stored workspace)
daf new --name "new-work" # Uses default workspace# List all workspaces (can run in Claude sessions)
daf workspace list
# Add workspace (run OUTSIDE Claude sessions)
daf workspace add product-a ~/repos/product-a
daf workspace add primary ~/development --default
# Remove workspace (run OUTSIDE Claude sessions)
daf workspace remove old-workspace
# Set default (run OUTSIDE Claude sessions)
# NOTE: For switching, use -w flag instead!
daf workspace set-default primaryImportant: Use -w flag for switching between workspaces per-session. The set-default command is for permanent configuration changes, not for frequent switching.
See Configuration Guide - Workspaces for detailed workspace configuration.
DevAIFlow prevents multiple concurrent sessions in the same repository within the same workspace to protect you from several issues:
1. Branch Switching Conflicts
If Session A is on feature-a and Session B tries to checkout feature-b in the same directory, git will either block the operation or force you to stash uncommitted work.
2. Uncommitted Work Loss
If Session A has uncommitted changes and Session B switches branches, you risk losing work or creating merge conflicts.
3. User Confusion
With 2 sessions active in the same directory, it's easy to:
- Forget which branch you're on
- Commit Session B's work to Session A's branch
- Lose track of which session is active
4. Git State Corruption
Concurrent git operations (commits, checkouts, merges) in the same repository can corrupt git state, especially with file locks and race conditions.
5. Time Tracking Conflicts
Both sessions would try to track time in the same repository, creating metadata conflicts.
Use different workspaces! Workspaces provide complete isolation:
# Setup: Create workspaces
daf workspace add primary ~/development
daf workspace add experiments ~/experiments
# Terminal 1: Main development
daf new PROJ-123 -w primary --path ~/development/myproject
# Works on feature-a branch
# Terminal 2: Experimental feature (completely isolated)
daf new PROJ-456 -w experiments --path ~/experiments/myproject
# Works on feature-b branch - no conflicts!Key Benefits:
- Complete physical isolation (different directories)
- No branch switching conflicts
- No uncommitted work risks
- No git state corruption
- Clear separation of concerns
Use Cases:
- Main branch + experimental feature branch
- Different products in same codebase
- Client-specific customizations
- Testing vs production work
See Workspaces for complete documentation.
You must complete the active session first:
# Check which session is active
daf list --active
# Complete the active session
daf complete session-name
# Now create the new session
daf new PROJ-456 --path /path/to/repoOr resume the existing session if that's what you intended:
daf open session-nameRecommended: Use Multi-Project Sessions with Shared Context (New!)
The modern approach creates ONE conversation with SHARED CONTEXT across all selected projects. This enables Claude to:
- Coordinate changes across multiple repositories
- Update backend API and frontend client together
- Maintain awareness of all project changes
- Provide consistent implementations across projects
This is more powerful than separate conversations because Claude can see and reference all project code simultaneously.
# Create session with multiple projects at once
daf new --name "user-profile" --jira PROJ-12345 -w primary --projects backend-api,frontend-app,shared-lib
# System prompts for base branch per project:
# backend-api: branch from main
# frontend-app: branch from develop
# shared-lib: branch from main
# Claude Code launches from workspace directory with ALL projects visible
# You can make changes across all projects in the same conversation!
# Example conversation:
You: "Update the API endpoint to return user profiles and modify the frontend to display them"
Claude:
- Updates backend-api/src/api/users.py
- Updates frontend-app/src/components/Profile.tsx
- Updates shared-lib/types/user.ts
# All changes coordinated with shared context!
# Complete session - creates separate PR/MR for each project
daf complete PROJ-12345
# → Creates PR for backend-api targeting main
# → Creates PR for frontend-app targeting develop
# → Creates PR for shared-lib targeting mainResult: One session (PROJ-12345) with ONE multi-project conversation:
PROJ-12345 (session)
└─ Multi-Project Conversation (SHARED CONTEXT)
├─ backend-api (branch: feature/PROJ-12345)
├─ frontend-app (branch: feature/PROJ-12345)
└─ shared-lib (branch: feature/PROJ-12345)
Benefits:
- Shared context - Claude sees all projects simultaneously
- Coordinated changes - Update API and client together
- Unified time tracking across all repositories
- Single JIRA ticket link
- Individual PRs - Each project gets its own PR with correct base branch
- Different base branches - Each project can target different branches (main, develop, etc.)
You can create a session with multiple projects from the start:
# Create session with multiple projects at once
daf new --name "user-profile" --jira PROJ-12345 -w primary --projects backend,frontend,shared
# This creates:
# - ONE conversation with SHARED CONTEXT across all projects
# - Separate git branches in each project (same branch name by default)
# - Each project can have different base branch (prompted per-project)
# - Claude Code launched from workspace root (sees all projects)All projects share the same conversation with clear context in prompts (e.g., [backend] Creating branch...).
NEW: Multi-Project Sessions (Recommended)
- ONE conversation with SHARED CONTEXT across all projects
- Claude sees all project code simultaneously
- Can coordinate changes across repositories (e.g., update API + client together)
- Launched from workspace root directory
- Each project has its own git branch
daf completecreates separate PR for each project
LEGACY: Multi-Conversation Sessions (Backward Compatibility)
- Multiple separate conversations - one per repository
- Each conversation is isolated (no shared context)
- Must switch between conversations to work on different projects
- Launched from individual project directories
- Kept for backward compatibility with existing sessions
When to use each:
- Use multi-project when you need to coordinate changes across repositories
- Legacy multi-conversation is automatically used for existing sessions
Add one or more projects after creating a session:
# Add single project
daf session add-project PROJ-12345 backend-api -w primary
# Add multiple projects at once
daf session add-project PROJ-12345 --projects frontend,docs -w primary
# Add with specific branch name
daf session add-project PROJ-12345 mobile-app -w primary --branch feature/mobileWhat happens:
- Validates workspace and project paths
- Sets up git branches (reuses session branch or asks once)
- Adds projects to the multi-project conversation
- Shows
[project-name]prefix in all prompts for clarity - Skips projects that already exist in session
- Note: Projects are added to the existing shared conversation, not as separate conversations
Alternative via open:
# Add projects when opening session
daf open PROJ-12345 -w primary --projects backend,frontendThis adds the projects and exits (doesn't launch Claude Code).
Remove a project when it's no longer needed:
# Remove project (with confirmation)
daf session remove-project PROJ-12345 old-service
# Remove without confirmation
daf session remove-project PROJ-12345 legacy-api --forceWhat happens:
- Shows project details (branch, path, messages)
- Prompts for confirmation (unless
--force) - Removes the project from the multi-project conversation
- Shows remaining projects
- Note: Removes the project from the shared conversation's projects dict
Start single, expand later:
# Day 1: Start with backend
daf new PROJ-123 backend-api -w primary
# Day 2: Add frontend
daf session add-project PROJ-123 frontend-app -w primary
daf open PROJ-123 --path frontend-app
# Day 3: Add shared library
daf session add-project PROJ-123 shared-lib -w primaryCreate multi-project from start:
daf new PROJ-123 -w primary --projects backend,frontend,shared
daf open PROJ-123 --path backend # Work on specific projectExpand via open:
daf sync PROJ-123 # Existing session from JIRA
daf open PROJ-123 -w primary --projects backend,frontend,docsClean up:
daf session remove-project PROJ-123 old-service
daf session remove-project PROJ-123 legacy-api --forceJIRA Ticket: PROJ-12345
↓
Session: PROJ-12345 (one session per ticket)
├─ Conversation: backend-api
│ ├─ Repository: /workspace/backend-api
│ ├─ Branch: feature/PROJ-12345
│ ├─ Active Claude session (current work)
│ └─ Archived Claude sessions (history)
│
└─ Conversation: frontend-app
├─ Repository: /workspace/frontend-app
├─ Branch: feature/PROJ-12345-ui
├─ Active Claude session (current work)
└─ Archived Claude sessions (history)
Important:
- 1 JIRA ticket = 1 Session
- 1 Project directory = 1 Conversation (with active + archived Claude sessions)
- Each conversation has its own git branch and own Claude Code history
- Time tracking is shared across all conversations in the session
Sometimes you need to start a fresh Claude Code conversation while preserving your previous work. This is useful when:
- The conversation history gets too long (causing 413 errors)
- You want to take a different approach but keep the old one for reference
- You've completed one part and want a clean slate for the next
# Open session and archive current conversation
daf open PROJ-12345 --new-conversation
# This will:
# 1. Archive your current Claude Code conversation
# 2. Create a new Claude Code session with fresh history
# 3. Preserve all your previous conversation historyWhat gets preserved:
- All previous conversation history (.jsonl files)
- Git branch and commits
- Summary of what was accomplished
What's new:
- Fresh Claude Code conversation (new UUID)
- Empty conversation history (clean start)
- Same project, same branch
See all conversations (active + archived) for a session:
daf list PROJ-12345Example output:
Session: PROJ-12345
Conversations (2 repositories):
#1 backend-api (active)
Claude Session: a7b3c4d5-1234-...
Branch: feature/PROJ-12345
Messages: 45
Created: 2026-01-15 09:30
Last Active: 2026-01-21 14:30
Archived (1):
UUID: f8e9d0a1-5678-...
Summary: Initial implementation of user auth
Messages: 123
Created: 2026-01-10 10:00
Archived: 2026-01-15 09:30
#2 frontend-app (active)
Claude Session: b8c4d5e6-2345-...
Branch: feature/PROJ-12345-ui
Messages: 28
Created: 2026-01-18 11:00
Last Active: 2026-01-20 16:45
Use Cases:
- Review what was tried before
- Reference previous approaches
- Understand conversation progression
- Verify nothing was lost
Use daf active to see which conversation is currently active:
daf active
# Output when working in backend-api:
┌─ ▶ Currently Active ───────────────────────────────┐
│ DAF Session: PROJ-12345 (#1) │
│ JIRA: PROJ-12345 │
│ Conversation: backend-api │
│ Project: /workspace/backend-api │
│ Goal: Add user profile API and UI │
│ Branch: feature/PROJ-12345 │
│ Time (this session): 1h 23m │
│ Status: in_progress │
│ │
│ Other conversations in this session: │
│ • frontend-app (branch: feature/PROJ-12345-ui) │
└────────────────────────────────────────────────────┘Key features:
- Shows current conversation's project and branch
- Lists other conversations with their branches
- Displays session-level time tracking
- Helps prevent working in wrong project
Active conversations are marked with ▶ symbol:
Status Name JIRA Summary Working Dir Time
▶ 🚧 PROJ-12345 (#1) PROJ-12345 User profile work backend-api 3h 45m
🆕 PROJ-12346 (#1) PROJ-12346 Fix login bug frontend 0h 0m
The ▶ indicator shows which conversation is currently open in Claude Code.
The easiest way to create sessions is to sync from JIRA:
# Sync all assigned tickets in current sprint
daf sync --sprint current
# Or sync all assigned tickets
daf syncThis automatically creates sessions for all your JIRA tickets. No need to manually create sessions!
See the JIRA Integration Guide for complete sync documentation.
For personal experiments or work not tied to a ticket:
daf new --name "redis-test" --goal "Test Redis caching approach"If you need to manually create a JIRA-linked session (less common):
daf new --jira PROJ-12345 --goal "Implement backup feature"You'll be prompted for the session name:
Session name [PROJ-12345]:
Press Enter to use the JIRA key, or type a custom name.
Note: For most workflows, use daf sync instead of manually creating sessions.
daf new --name "api-test" --goal "Test new endpoint" --path /Users/you/projects/backendOverride automatic repository detection.
# Create in named workspace
daf new --name "feature-work" --goal "Implement caching" -w feat-caching
# Create in product workspace
daf new --name "api-update" --goal "Update API" -w product-a
# Uses default workspace if -w not specified
daf new --name "regular-work" --goal "Regular development"The -w (or --workspace) flag selects which workspace to use. Sessions remember their workspace for automatic reuse on reopen.
daf new --name "new-feature" --goal "Build API" --template my-backend-templateReuse configuration from a saved template.
Each session stores:
- name - Session name (identifier)
- session_id - Unique numeric ID within the session
- goal - What you're trying to accomplish
- status - created, in_progress, or complete
- workspace_name - Workspace where this session runs (enables concurrent sessions)
- working_directory - Repository name (e.g., "backend-api")
- project_path - Full path to repository
- branch - Git branch name
- ai_agent_session_id - UUID for Claude Code conversation
- issue_key - JIRA ticket key (e.g., "PROJ-12345")
- jira_summary - Ticket title/summary
- jira_status - Ticket status
- jira_assignee - Who it's assigned to
- sprint - Sprint name/ID
- created_at - When session was created
- updated_at - Last modified time
- work_sessions - List of start/stop times
- total_time_seconds - Total time spent
- tags - Custom tags for organization
Each session has a directory at $DEVAIFLOW_HOME/sessions/{SESSION-NAME}/:
- metadata.json - All metadata above
- notes.md - Progress notes
- memory.md - Context hints (optional)
daf open redis-testdaf open PROJ-12345# Override session's stored workspace
daf open PROJ-12345 -w primary
# Switch to different workspace temporarily
daf open feature-work -w experimentsThe -w flag overrides the workspace stored in the session. Sessions remember their workspace from creation, but you can override it when opening.
-
First Time (New Session):
- Generates Claude session UUID
- Creates git branch (if configured)
- Sends initial prompt to Claude with goal
- Starts time tracking
- Sets status to
in_progress
-
Resuming Existing Session:
- Loads Claude conversation from UUID
- Checks out git branch
- Resumes time tracking
- Updates
updated_attimestamp
-
Orphaned Session (UUID exists but file missing):
- Detects missing conversation file
- Generates new UUID
- Treats as first-time launch
- User sees explanation message
When creating a session, Claude receives:
Work on: PROJ-12345: Implement backup feature
Please start by reading the following context files if they exist:
- AGENTS.md (agent-specific instructions)
- CLAUDE.md (project guidelines and standards)
Also read the JIRA ticket: jira issue view PROJ-12345
This ensures Claude has full context before starting work.
daf listOutput:
Sessions (5):
📋 backup (#1, #2)
🎯 Implement backup feature
🔗 PROJ-12345
📁 backend-api, frontend-app
📊 in_progress
⏱️ 3h 45m
📋 redis-test (#1)
🎯 Test Redis caching approach
📁 experiments
📊 complete
⏱️ 1h 20m
daf list --activeShows only sessions with status in_progress.
daf list --working-directory backend-apiShows only sessions in the specified repository.
daf list --sprint "2025-01"Shows only sessions in the specified sprint.
daf list --status completeShows sessions with specific status. Valid values: created, in_progress, paused, complete.
You can filter by multiple statuses:
daf list --status in_progress,pausedTip:
daf notenow works inside Claude Code! Add notes anytime to track progress and document decisions. Use/daf-notesto view all notes.
daf note backup "Implemented upload endpoint"Saved to $DEVAIFLOW_HOME/sessions/backup/notes.md:
## 2025-11-20 14:30:00
Implemented upload endpointdaf note backup "Backend complete, ready for review" --jiraThis:
- Saves note locally (always happens)
- Adds note as JIRA comment (if linked and JIRA CLI available)
If JIRA sync fails, note is still saved locally.
daf note "Quick update on current work"Uses the most recently updated session.
Notes are stored in markdown format:
cat $DEVAIFLOW_HOME/sessions/backup/notes.mddaf summary backupOutput:
Session: backup (#1)
Goal: Implement backup feature
JIRA: PROJ-12345 - "Customer backup and restore"
Status: in_progress
Time: 3h 45m (5 work sessions)
Files Created: 12
Files Modified: 8
Commands Run: 24
Notes: 6
Fast, offline, statistical summary.
daf summary backup --detailShows full file lists and commands.
daf summary backup --ai-summaryUses Claude API to generate intelligent natural language summary:
Session: backup (#1)
Summary:
Implemented a comprehensive backup system for customer data. Created new
backup service with upload endpoint, S3 integration, and encryption. Added
validation for backup metadata and implemented retry logic for failed uploads.
Still need to add restore functionality and write tests.
Key Accomplishments:
- Backup upload API endpoint with authentication
- S3 bucket integration with encryption
- Metadata validation and storage
- Error handling and retry logic
Next Steps:
- Implement restore endpoint
- Add comprehensive test coverage
- Update documentation
daf complete backupPrompts:
- Mark session as complete?
- Generate AI summary? (if configured)
- Add summary to JIRA? (if linked)
- Transition JIRA ticket? (if configured)
daf complete backup --status "Code Review"Marks complete and transitions JIRA ticket to "Code Review" state.
- Status Update: Session status →
complete - Time Tracking: Stops active time tracking
- AI Summary (optional): Generates summary of work done
- JIRA Comment (optional): Adds summary to JIRA ticket
- JIRA Transition (optional): Moves ticket to new status
daf delete backupPrompts for confirmation:
Delete session 'backup' (#1)?
This will remove all session data including notes and metadata.
Conversation history in Claude will NOT be deleted.
Continue? [y/N]:
daf delete backup --forcedaf delete --allComplete reset - deletes all sessions. Prompts for confirmation.
daf delete --all --force- Session metadata (
$DEVAIFLOW_HOME/sessions/{NAME}/) - Progress notes
- Memory files
- Session entry in sessions.json
What is NOT deleted:
- Claude Code conversation files (
~/.claude/projects/...) - Git branches
- JIRA tickets
daf search "backup"Searches in:
- Session names
- Goals
- JIRA summaries
- Progress notes
daf search "api" --working-directory backend-api
daf search "bug" --tag urgentdaf time backupOutput:
Time Tracking for: backup (#1)
Work Sessions:
1. 2025-11-20 09:00:00 → 11:30:00 (2h 30m)
2. 2025-11-20 14:00:00 → 15:15:00 (1h 15m)
3. (active) 16:00:00 → now (45m)
Total Time: 4h 30m
Status: in_progress
daf pause backupStops the active work session without closing Claude Code.
daf resume backupStarts a new work session.
- Automatic Start: When
daf openlaunches Claude Code - Automatic Stop: When Claude Code exits (captured via process monitoring)
- Manual Control: Use
daf pauseanddaf resumefor breaks
Time data stored in work_sessions array:
{
"work_sessions": [
{
"start": "2025-11-20T09:00:00",
"end": "2025-11-20T11:30:00"
}
]
}daf link backup --jira PROJ-12345This:
- Validates JIRA ticket exists
- Fetches ticket metadata
- Links ticket to session
- Updates all conversations in the session
daf unlink backupRemoves JIRA association but keeps session data.
daf template save backup my-backend-templateCreates reusable template with:
- Working directory pattern
- Git branch pattern
- Tags
- JIRA key pattern (optional)
daf template listdaf new --name "new-api" --goal "Build endpoint" --template my-backend-templateApplies template configuration to new session.
daf template delete my-backend-templateSessions where:
ai_agent_session_idis set- But conversation file doesn't exist at
~/.claude/projects/.../
This happens when:
- Session creation interrupted
- Claude Code crashed
- Conversation files manually deleted
daf maintenance cleanup-sessions --dry-runOutput:
Found 2 orphaned session(s):
Session Session ID JIRA Missing UUID Status
backup (#1) 1 PROJ-12345 4ff5a139... in_progress
test (#1) 1 - 8ab2c4e7... created
daf maintenance cleanup-sessionsThis:
- Clears orphaned
ai_agent_session_idfrom metadata - Next
daf openwill generate new UUID - No session data lost
When you run daf open on an orphaned session:
⚠ Conversation file not found for session 4ff5a139-113d-4e5a-abf1-92873fd96b7a
This can happen if the session was interrupted or Claude Code failed to start.
First-time launch for session: backup
Generated new session ID: 7c8d9e0f-1234-5678-9abc-def012345678
The orphan is automatically fixed.
Good:
daf new --name "user-auth-api" --goal "Implement OAuth2"Bad:
daf new --name "test123" --goal "stuff"Document progress as you work:
daf note "Completed login endpoint"
daf note "Found bug in token refresh, fixing"
daf note "Ready for code review"Don't leave sessions in in_progress forever:
daf complete user-auth-apiKeep related work organized with shared context:
# Create one session with all related projects
daf new PROJ-12345 -w primary --projects backend,frontend,infrastructure
# → ONE conversation with SHARED CONTEXT across all three projects
# → Claude can coordinate changes across all repositoriesPeriodically review and delete completed work:
daf list --status complete
daf delete old-session-1
daf delete old-session-2Or export them first:
daf export old-session-1 old-session-2 --output archive.tar.gz
daf delete old-session-1 old-session-2 --forceSave successful session configs:
daf template save successful-project my-template
daf new --name "next-project" --goal "..." --template my-templateBefore completing, check progress:
daf summary backup --ai-summaryUse for completion:
daf complete backup # Will offer AI summaryProblem: "No conversation found with session ID: ..."
Solution: Session is orphaned. Either:
# Automatic fix - just open it
daf open session-name
# Or manual cleanup
daf maintenance cleanup-sessions
daf open session-nameProblem: Prompted to select from multiple conversations
Cause: Session has multiple conversations (by design for multi-repo work)
Solution: Select the one you want to work on, or use specific conversation:
daf open session-name # Interactive selectionProblem: "Session 'name' not found"
Solution:
# List all sessions
daf list --all
# Search for it
daf search "keyword"
# Check by JIRA key
daf list | grep PROJ-12345Problem: Time doesn't update
Cause: Process monitoring may have failed
Solution:
# Manual pause/resume
daf pause session-name
daf resume session-name- JIRA Integration - Learn JIRA workflows
- Configuration Reference - Configure session behavior
- Commands Reference - All available commands