Skip to main content

resolve_subagents_dir_for_session

Function resolve_subagents_dir_for_session 

Source
pub fn resolve_subagents_dir_for_session(
    config_dir: &Path,
    cwd: &Path,
    session_id: &str,
) -> Option<PathBuf>
Expand description

Locate the subagents transcript dir for a Claude Code session.

Returns <config_dir>/projects/<slug>/<session_id>/subagents/ when it exists, where <slug> is slugify_project_path of cwd. If the cwd-derived slug doesn’t match (e.g. the command ran from a subdirectory of the session’s project), scans <config_dir>/projects/* for a child named <session_id> — the session id is a globally-unique UUID, so at most one project dir contains it. Returns None if no subagents/ dir is found.