---
title: "Discussion on \"My Coding Agent Waited 2 Hours on a 20-Minute Job.\" | Hashnode"
description: "Discussion on \"My Coding Agent Waited 2 Hours on a 20-Minute Job.\". Why a Claude Code background task can hang without anyone noticing, and the 2x rule, watchdog script and CLAUDE.md line that catch it."
url: "https://hashnode.com/posts/my-coding-agent-waited-2-hours-on-a-20-minute-job/6b016fc60becf0c99f0a5f9e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [My Coding Agent Waited 2 Hours on a 20-Minute Job.](https://priyanshudotsol.hashnode.dev/my-coding-agent-waited-2-hours-on-a-20-minute-job?utm_source=hashnode&utm_medium=feed)

Why a Claude Code background task can hang without anyone noticing, and the 2x rule, watchdog script and CLAUDE.md line that catch it.

Nov 21 · 6 min read · priyanshudotsol.hashnode.dev  
Read the article

-   [#claude-code](https://hashnode.com/tag/claude-code)
-   [#AI](https://hashnode.com/tag/AI)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#bash](https://hashnode.com/tag/bash)

## Written by

[Priyanshu Tiwari](https://hashnode.com/@priyanshudotsol)

@priyanshudotsol

  
[View profile](https://hashnode.com/@priyanshudotsol)

Engineer, who's building and breaking things Dm for collab

Engineer, who's building and breaking things Dm for collab

## Responses 1

Markdown supported · ⌘↵ to post

[Adam Lewis](https://hashnode.com/@nark3d)

[Nov 23](https://hashnode.com/posts/my-coding-agent-waited-2-hours-on-a-20-minute-job/6b016fc60becf0c99f0a5f9e/comment/6b04b3e1f0672e98a9043338)

Watch the logs for a run that takes twice its usual time and you've got a decent first pass. The 2× rule works when the usual time is stable, but a job whose typical duration is a guess from a couple of logs will either fire on healthy runs or miss a hang that creeps past twice a number nobody measured properly. Watching a signal the job emits on purpose is a better check, a counter or a heartbeat file, since that's a fact about progress.
