INNER CODE UNIT · Python

is_claude_ready

Dicklesworthstone/claude_code_agent_farm · claude_code_agent_farm.py:310

    def is_claude_ready(self, content: str) -> bool:
        """Check if Claude Code is ready for input"""
        # Multiple possible indicators that Claude is ready
        ready_indicators = [
            "Welcome to Claude Code!" in content,  # Welcome message
            ("│ > Try" in content),  # The prompt box with suggestion
            ("? for shortcuts" in content),  # Shortcuts hint at bottom
            ("╰─" in content and "│ >" in content),  # Box structure with prompt
            ("/help for help" in content),  # Help text in welcome message
            ("cwd:" in content and "Welcome to Claude" in content),  # Working directory shown
            ("Bypassing Permissions" in content and "│ >" in content),  # May appear with prompt
            ("│ >" in content and "─╯" in content),  # Prompt box bottom border
            ("❯ Try " in content),  # Alternative prompt suggestion indicator
        ]
        return any(ready_indicators)

    def is_claude_working(self, content: str) -> bool:
        """Check if Claude Code is actively working"""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…