Skip to content

require-task-in-progress hook: session-dir task lookup misses tasks stored in henry/ namespace #191

Description

@henry-nsheaps

Summary

The `require-task-in-progress` hook looks for in-progress tasks in the session-scoped directory (`$CLAUDE_DIR/tasks/$SESSION_ID/`), but Henry's tasks (created via `TaskCreate`/`TaskUpdate`) are stored in a different path: `$CLAUDE_DIR/tasks/henry/`. This mismatch causes the hook to always report `IN_PROGRESS_COUNT=0` for Henry, blocking all Edit/Write operations even when a legitimate task is in_progress.

Affected File

`plugins/claude-code/task-utils/hooks/require-task-in-progress.sh`

Root Cause

The hook constructs the task lookup path using `$CLAUDE_DIR/tasks/$SESSION_ID/` (e.g., `/.agents/henry/.claude/tasks/b44291fa-.../`). However, Henry's tasks are persisted under `/.agents/henry/.claude/tasks/henry/`. Because the hook looks in the session-ID subdirectory and finds nothing there, it concludes no task is in_progress and blocks the tool call.

Symptoms

  • Every Edit and Write tool call is blocked by the hook, even when a task with status `in_progress` exists in Henry's task namespace.
  • The hook logs `IN_PROGRESS_COUNT=0` regardless of actual task state.
  • Henry cannot perform any file-editing work without the workaround described below.

Workaround

Manually write a JSON stub file to the session-scoped directory that mimics an in_progress task:

```bash
mkdir -p ~/.agents/henry/.claude/tasks/<SESSION_ID>/
echo '{"status":"in_progress","subject":"stub"}' > ~/.agents/henry/.claude/tasks/<SESSION_ID>/stub.json
```

This is fragile and must be repeated each session restart.

Proposed Fix

The hook should be updated to also search agent-namespaced task directories (e.g., `$CLAUDE_DIR/tasks/henry/`) in addition to (or instead of) the session-ID path. One approach:

  1. Detect whether an agent-specific namespace directory exists (e.g., `$CLAUDE_DIR/tasks/henry/`).
  2. If it does, scan that directory for tasks with `"status": "in_progress"`.
  3. Fall back to the session-ID directory for non-namespaced agents.

Alternatively, expose a canonical environment variable (e.g., `$CLAUDE_TASK_DIR`) that each agent can set to point the hook at the correct task storage location.

Environment

  • Agent: Henry (`nsheaps/.ai-agent-henry`)
  • Hook: `plugins/claude-code/task-utils/hooks/require-task-in-progress.sh`
  • Task storage path (actual): `~/.agents/henry/.claude/tasks/henry/`
  • Task storage path (hook expects): `~/.agents/henry/.claude/tasks/<SESSION_ID>/`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions