Auto-intercepts and translates errors from live Bash tool execution in Cowork
Detects errors in tool output, classifies severity, translates them to plain-language explanations, and suggests executable fix commands.
Cowork Error Interceptor
TL;DR
How To Start
STEP 1Let It Run or Provide Error Output
-
auto_intercept
· boolean · optional · default: true
When true, COM auto-triggers on Bash errors. Set false for manual-only mode. -
error_output
· string · required
The raw error output from the Bash tool. -
command_executed
· string · optional
The Bash command that produced the error. Improves diagnosis accuracy. -
log_errors
· boolean · optional · default: false
Append error details to a session error log file.
Usage Examples
How AI Reads This Recipe
- DETECT errors by parsing Bash tool output for indicators: non-zero exit code, “error:” or “fatal:” strings, “Traceback,” “EACCES” or “EPERM,” “command not found,” “No such file or directory,” “CONFLICT,” “npm ERR!,” “SyntaxError,” and “Connection refused.” If no indicators are found, do not activate.
- MATCH the error against the built-in pattern library: git authentication, git conflicts, git not initialized, git lock files, permission errors, Python tracebacks, file not found, missing commands, network errors, and npm errors. If no pattern matches, classify as “Unknown Error.”
- CLASSIFY severity: CRITICAL (task cannot proceed), WARNING (impacted, workarounds exist), or INFO (minor, minimal impact). For cascading errors, focus on the first error — later errors are often caused by the first failure.
- TRANSLATE the error to plain language and present fix commands. For CRITICAL: show full diagnosis, require user confirmation. For WARNING: show diagnosis, offer to try the fix. For INFO: show brief note and auto-attempt the fix.
- LOG the error if logging is enabled: timestamp, command, truncated error output, matched pattern, severity, and fix status. Session-scoped file, does not persist across sessions.
When to Use This Recipe
- Encounter any error from Bash tool execution and want instant, plain-language explanation with a fix.
- Are new to command-line tools and need errors translated to actionable guidance.
- Want automatic error detection and resolution without diagnosing issues yourself.
- Need a session error log for debugging recurring issues.
Recipe FAQ
Q.What error types are in the pattern library?
Q.What are the severity levels?
Q.What happens with unrecognized error patterns?
Q.How does cascading error handling work?
Q.Does the error log persist across sessions?
Q.Can I add custom patterns to the library?
Version History
Get this recipe with CRAFT for Claude Cowork
Cowork recipes ship bundled with CRAFT for Claude Cowork — there’s no separate download. Clone the framework once, and your AI runs every recipe automatically when invoked.
Pull anytime to stay on the latest version — free to clone, no login or email required.
Then start your session
Once CRAFT is in your project folder, open a new Cowork session and ask Claude to initialize. For example:
You
Claude
Not familiar with Git? Download as a ZIP
No command line needed. Just download, move, and unzip:
- Open the CRAFT framework repo on GitHub.
- Click the green Code button, then choose Download ZIP.
- Move the downloaded ZIP into your Claude Cowork project folder.
- Unzip it: double-click on Mac, or right-click → Extract All on Windows.
