#!/usr/bin/env bash # ctask status line helper for Claude Code # Reads ctask environment variables and prints a formatted context string. # Output (task): (ctask:|) # Output (project): (ctask:||project) # Output (project with distinct launch dir): # (ctask:||project:) # The displayed path is the effective launch path (workspace + launch_dir # when set), so the status line reflects the directory the user is actually # working in. Outputs nothing when not in a ctask session. [ -z "$CTASK_TASK" ] && exit 0 # Effective path: workspace root, plus launch_dir when set. DISPLAY_PATH="$CTASK_WORKSPACE" if [ -n "$CTASK_LAUNCH_DIR" ]; then DISPLAY_PATH="$CTASK_WORKSPACE/$CTASK_LAUNCH_DIR" fi if [ "$CTASK_TYPE" = "project" ]; then # Include the launch dir in the tag only when it differs from the slug # (so the default case stays terse). if [ -n "$CTASK_LAUNCH_DIR" ] && [ "$CTASK_LAUNCH_DIR" != "$CTASK_TASK" ]; then echo "(ctask:${CTASK_TASK}|${CTASK_MODE}|project:${CTASK_LAUNCH_DIR}) ${DISPLAY_PATH}" else echo "(ctask:${CTASK_TASK}|${CTASK_MODE}|project) ${DISPLAY_PATH}" fi else echo "(ctask:${CTASK_TASK}|${CTASK_MODE}) ${DISPLAY_PATH}" fi