osFoundry detects Claude Code permission prompts by emulating the terminal screen
osFoundry's desktop app shows whether each terminal pane's agent is waiting for user input on its Sessions board. The author examined raw terminal output captured from Claude Code 2.1.303, which asks for permission before running commands, and found that its bytes lack spaces and newlines, which defeats simple text matching. The app uses an ordered set of regex rules per agent, where the blocked state is checked first so a prompt is not hidden by the working footer. Screen state is re-evaluated every 700 ms rather than on every write. Testing the rules on captured fixtures showed that stripping escape codes from the last 8 KB misclassified blocked and working captures as idle, whereas emulating a 32x120 screen classified them correctly.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in