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
feat(sessions): index workflow runs and agents (layer 2 of session intelligence) (#284)
* feat(sessions): index workflow runs and their agents
Layer 2 of session intelligence (builds on #281's git spans). Indexes
Claude Code workflow runs + agents into the session store, attached to
the parent thread and to branches/worktrees/commits. Adds the
tracedecay_workflows tool (list by thread or git ref, show a run, drill
an agent), workflow_run/agent filters on message_search, and a
'sessions unfinished' CLI. Ingest is idempotent + incremental. Tool
count 100 -> 101. Verified against ~/.claude: 11 runs / 79 agents.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* test: set directory mtime cross-platform in workflow_ingest tests
The set_mtime helper opened files read-only and called set_times, which
works on Unix but panics on Windows (adjusting a directory's timestamps
needs backup-semantics access). Switch to filetime::set_file_mtime
(already a transitive dep; added as an explicit dev-dependency).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* chore: deslop workflow indexing comments
* refactor(workflow): dedup helpers and hoist loop-invariant resolution
/simplify cleanup (behavior-preserving), converged on by 4 reviewers:
- delete WorkflowStatus::from_db (redundant with the infallible from_disk
given the status column's CHECK constraint)
- reuse crate::sessions::claude::transcript_cwd instead of a byte-copy
- promote string_arg/argument_error/tool_json_with_md to handlers/support
and share them between session.rs and workflow_query.rs
- one shared shared::one_line_truncated (single ellipsis convention)
replacing three divergent copies
- ProjectRootMatcher resolves the fixed project side's git worktree/common
dir once, so the ingest loop stops re-resolving it per run
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* refactor: split workflow session tests
* refactor(sessions): simplify workflow indexing reuse and dedup
Reuse git_scope_exists_clauses for workflow git-scope queries, avoid
per-status string allocations, HashSet dedup in roster assembly, and
colocate one_line_truncated tests with shared helpers.
* refactor(sessions): dedupe workflow args
* refactor(sessions): extract workflow scope EXISTS predicate
* fix(workflow): satisfy branch quality gates
* fix(test): normalize CI path assertions
* fix(test): normalize Windows command paths
* fix(test): normalize Cursor hook paths
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
"Recover Claude Code workflow runs (multi-agent `wf_*` orchestrations) and their per-phase agents from the active project. Three modes, chosen by which argument is set: (1) list runs for a parent thread via session_id, or every run on a branch/worktree/commit via branch/worktree/commit (a run inherits its parent session's git spans); (2) show one run's result summary, phases, and agent roster via run_id; (3) drill into one agent's transcript via run_id + agent_label. Read-only; runs that never ran leave no rows.",
2545
+
json!({
2546
+
"type":"object",
2547
+
"properties":{
2548
+
"session_id":{
2549
+
"type":"string",
2550
+
"description":"Parent thread/session id: list the workflow runs it spawned (newest first). Mutually exclusive with run_id and the git filters."
2551
+
},
2552
+
"run_id":{
2553
+
"type":"string",
2554
+
"description":"A `wf_*` run id: show that run's summary, phases, and agents. Combine with agent_label to drill into one agent."
2555
+
},
2556
+
"agent_label":{
2557
+
"type":"string",
2558
+
"description":"With run_id, drill into a single agent of that run by its label (e.g. 'mine:claude-transcripts')."
2559
+
},
2560
+
"branch":{
2561
+
"type":"string",
2562
+
"description":"List workflow runs whose parent session was active on this git branch (via the session-git correlation index)."
2563
+
},
2564
+
"worktree":{
2565
+
"type":"string",
2566
+
"description":"List workflow runs whose parent session was active in this git worktree root path."
2567
+
},
2568
+
"commit":{
2569
+
"type":"string",
2570
+
"description":"List workflow runs whose parent session was attributed to this commit sha (full or >=6-char hex prefix)."
2571
+
},
2572
+
"limit":{
2573
+
"type":"integer",
2574
+
"minimum":1,
2575
+
"maximum":100,
2576
+
"description":"Maximum runs or agents to return (default: 20)."
2577
+
}
2578
+
}
2579
+
}),
2580
+
)
2581
+
}
2582
+
2583
+
/// Optional `workflow_run` narrowing filter shared by `tracedecay_message_search`:
2584
+
/// scopes hits to the transcripts of one workflow run's agents.
2585
+
fnworkflow_run_scope_schema() -> Value{
2586
+
json!({
2587
+
"type":"string",
2588
+
"description":"Optional workflow run id (`wf_*`) filter: only messages from sessions that spawned this workflow run (via the workflow-run index). Pair with agent_label to scope to one agent."
2589
+
})
2590
+
}
2591
+
2592
+
fnworkflow_agent_scope_schema() -> Value{
2593
+
json!({
2594
+
"type":"string",
2595
+
"description":"Optional workflow agent label filter, used with workflow_run to scope to a single agent of that run."
0 commit comments