Skip to main content
skill CX Codex

monitoring-terminal-errors — Claude Code skill: watch logs, fix

A skill that watches a running process — dev server, test runner, build — for crashes and stack traces, then opens the failing file and fixes it. Handy when the log is long and the error is buried.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add spencerpauly/awesome-cursor-skills --skill monitoring-terminal-errors -a claude-code
Open on GitHub

What monitoring-terminal-errors does

The skill runs a loop: find the terminal holding the target process, read its output, pull the file path and line number out of the stack trace, open that file and patch it. Then it re-reads the log to confirm the server came back — hot reload usually picks the change up. If errors remain, the loop starts again.

The workflow is written out step by step. First the agent scans terminal files for one running npm run dev, pnpm dev or python manage.py runserver. Then it looks for known patterns: stack traces in the form at <function> (<file>:<line>:<col>), Node.js and Python errors, Unhandled Runtime Error from React and Next.js, Failed to compile, [vite] Internal server error:, error TS\d+:. From a match it extracts the path, the line and the message.

One hard stop: after five attempts without a fix the skill gives up and reports back to you. It also tells you to check exit_code in the terminal file footer — if it is there, the process died outright and needs a restart rather than a code change. Cascading errors are worth fixing at the root first; the rest often clear on their own.

What it helps with

  • find the terminal running a crashed dev server among several
  • pull the failing file and line out of a stack trace
  • fix Module not found after a file moved
  • debug an Unhandled Runtime Error in React or Next.js
  • tell a dead process apart from an error hot reload can fix

Example prompts for the agent

  • check the dev server terminal and fix whatever it is throwing
  • the server keeps crashing with a stack trace — find the file and patch it
  • read the build log and clear the Failed to compile error

How to install monitoring-terminal-errors

1Skills CLI (Vercel)

npx skills add spencerpauly/awesome-cursor-skills --skill monitoring-terminal-errors -a claude-code

2Manually: put the files in place

~/.claude/skills/monitoring-terminal-errors/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/monitoring-terminal-errors/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about monitoring-terminal-errors

How do I install monitoring-terminal-errors in Claude?

Run npx skills add spencerpauly/awesome-cursor-skills --skill monitoring-terminal-errors -a claude-code. The skill file lands at ~/.claude/skills/monitoring-terminal-errors/SKILL.md.

What does monitoring-terminal-errors do?

It watches a running process for errors and stack traces, navigates to the failing file and line, and applies a fix. Then it re-reads the log to check the server recovered.

How many attempts does the skill make before stopping?

Five. If the errors are still there after that, it ends the loop and reports the result to you.

Source text

SKILL.md · CC0-1.0
---
name: monitoring-terminal-errors
description: Watch running terminal processes for crashes and stack traces. When an error appears, navigate to the failing file and line, diagnose, and fix it automatically.
user-invocable: true
---

# Monitoring Terminal Errors

Continuously watch a running process (dev server, test runner, build) for errors and fix them as they appear.

## Workflow

### 1. Identify the Terminal

List terminal files and find the one running the target process:

```bash
head -n 10 <terminals_folder>/*.txt
```

Look for terminals running dev servers (`npm run dev`, `pnpm dev`, `python manage.py runserver`, etc.).

### 2. Read Terminal Output

Read the full terminal file content. Search for error patterns:

- **Stack traces**: `at <function> (<file>:<line>:<col>)`
- **Node.js**: `Error:`, `TypeError:`, `ReferenceError:`, `ENOENT`, `ECONNREFUSED`
- **Python**: `Traceback (most recent call last):` followed by `File "<path>", line <n>`
- **React/Next.js**: `Unhandled Runtime Error`, `Error: ...`, `Module not found`
- **Build errors**: `ERROR in`, `Failed to compile`, `SyntaxError`
- **Vite**: `[vite] Internal server error:`
- **TypeScript**: `error TS\d+:`

### 3. Extract the Source Location

From the stack trace, extract:
- File path
- Line number
- Error message

For Node.js: `at functionName (/path/to/file.ts:42:10)`
For Python: `File "/path/to/file.py", line 42, in function_name`

### 4. Navigate and Fix

1. Read the identified file around the error line
2. Understand the error (missing import, type mismatch, undefined variable, etc.)
3. Apply the fix
4. Re-read the terminal file to confirm the server recovered (hot reload should pick it up)

### 5. Loop

If the server is still showing errors after the fix, repeat from step 2. Stop when:
- The terminal shows a clean "compiled successfully" or equivalent
- No new errors appear in the output
- You've made 5 attempts without resolution (report to user)

## Tips

- Check for `exit_code` in the terminal file footer — if present, the process has crashed entirely and needs a restart
- Some errors cascade — fix the first/root error and the rest often disappear
- For HMR errors, the fix might just be saving the file again to trigger a rebuild

© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set59

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor