#!/usr/bin/env bash
# Status line: Show active codeflash org/project.

cd "$CLAUDE_PROJECT_DIR" 2>/dev/null || exit 0

CF_DIR="$CLAUDE_PROJECT_DIR/.codeflash"
[ -d "$CF_DIR" ] || exit 0

# Find the org/project directory (first one found)
for ORG_DIR in "$CF_DIR"/*/; do
    [ -d "$ORG_DIR" ] || continue
    ORG=$(basename "$ORG_DIR")
    for PROJ_DIR in "$ORG_DIR"/*/; do
        [ -d "$PROJ_DIR" ] || continue
        PROJECT=$(basename "$PROJ_DIR")
        echo "codeflash-agent is working in: $ORG/$PROJECT"
        exit 0
    done
done

exit 0
