<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Task Queue | Henry Kou</title><link>https://kenryhou2.github.io/tags/task-queue/</link><atom:link href="https://kenryhou2.github.io/tags/task-queue/index.xml" rel="self" type="application/rss+xml"/><description>Task Queue</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Wed, 06 May 2026 00:00:00 +0000</lastBuildDate><image><url>https://kenryhou2.github.io/media/icon_hu_da05098ef60dc2e7.png</url><title>Task Queue</title><link>https://kenryhou2.github.io/tags/task-queue/</link></image><item><title>Queue up for Claude</title><link>https://kenryhou2.github.io/projects/queue-up-for-claude/</link><pubDate>Wed, 06 May 2026 00:00:00 +0000</pubDate><guid>https://kenryhou2.github.io/projects/queue-up-for-claude/</guid><description>&lt;p&gt;I wrote Queue up for Claude because I kept seeing useful coding tasks that were not urgent enough to spend interactive attention on. The tool stages those tasks locally and runs them near the end of a Claude.ai usage window when there is enough remaining plan capacity. A runner watches usage, stays in a default &amp;ldquo;chilling&amp;rdquo; state, and switches to &amp;ldquo;burning&amp;rdquo; near reset time. It then runs one queued task at a time through &lt;code&gt;claude -p&lt;/code&gt;, records the outcome, and advances the queue.&lt;/p&gt;
&lt;p&gt;The main design choice is context compilation. Each queued task gets a fresh &lt;code&gt;CLAUDE.md&lt;/code&gt; built from the target project&amp;rsquo;s &lt;code&gt;.agent/&lt;/code&gt; files: agent identity, project context, behavior rules, capability boundaries, rolling procedural/semantic/episodic memory, output conventions, and the task prompt. That makes each autonomous run explicit about what it is allowed to do and what it should report back. Tasks can be prioritized, tagged, dependency-gated, retried, removed, or run in dry-run mode.&lt;/p&gt;
&lt;p&gt;The CLI exposes the main workflow:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;queue-worker init &amp;lt;project_dir&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;queue-worker add &amp;lt;project_dir&amp;gt; &lt;span class="s2"&gt;&amp;#34;Add input validation&amp;#34;&lt;/span&gt; --level craftsman -p &lt;span class="m"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;queue-worker ls --status pending
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;queue-worker next --json-out
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;queue-worker context &amp;lt;task_id&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;queue-worker run --once
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;queue-worker retry &amp;lt;task_id&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;queue-worker logs --task &amp;lt;task_id&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It also includes manual lifecycle commands (&lt;code&gt;begin&lt;/code&gt;, &lt;code&gt;done&lt;/code&gt;, &lt;code&gt;fail&lt;/code&gt;, &lt;code&gt;stall&lt;/code&gt;), a &lt;code&gt;compile&lt;/code&gt; command for generating daytime interactive context, and task controls for &lt;code&gt;--depends-on&lt;/code&gt;, &lt;code&gt;--dry-run&lt;/code&gt;, &lt;code&gt;--tag&lt;/code&gt;, &lt;code&gt;--max-minutes&lt;/code&gt;, and automation levels from &lt;code&gt;observer&lt;/code&gt; through &lt;code&gt;deployer&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The repo also ships a local FastAPI + Alpine.js dashboard via &lt;code&gt;queue-worker-web&lt;/code&gt; with task CRUD, live terminal output, usage charts, log viewing, runner status, and a file browser. The queue records task YAML under lifecycle folders such as &lt;code&gt;pending/&lt;/code&gt;, &lt;code&gt;running/&lt;/code&gt;, &lt;code&gt;done/&lt;/code&gt;, &lt;code&gt;unfinished/&lt;/code&gt;, and &lt;code&gt;failed/&lt;/code&gt;, while the runner handles lock files, dead-PID recovery, &lt;code&gt;CLAUDE.md&lt;/code&gt; backup restoration, and reset-anchor state in &lt;code&gt;state/runner_state.json&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Security-wise, I keep the tradeoffs explicit. Usage checks rely on a Claude.ai &lt;code&gt;sessionKey&lt;/code&gt; cookie and unofficial Claude.ai web endpoints, and task execution uses &lt;code&gt;claude -p --dangerously-skip-permissions&lt;/code&gt;. The dashboard file browser is not path-scoped, so the repo recommends loopback or Tailscale access and password protection before any remote use.&lt;/p&gt;
&lt;p&gt;The lesson from building it is that autonomous coding is mostly a systems problem: durable task state, recoverable logs, bounded permissions, clear context, and boring lifecycle transitions matter as much as the model prompt.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sources I leaned on:&lt;/strong&gt; classic job-queue and worker-runner patterns from systems engineering; ReAct-style agent papers for action/observation loops; and software-agent evaluation ideas such as SWE-bench for thinking about task state and reproducible outcomes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Technical stack:&lt;/strong&gt; Python 3.11+, Click, PyYAML, FastAPI, Alpine.js, Claude Code CLI, editable &lt;code&gt;setuptools&lt;/code&gt; package, pytest.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Keywords:&lt;/strong&gt; Claude Code queue, usage-aware runner, autonomous coding agents, local task queue, &lt;code&gt;queue-worker&lt;/code&gt;, &lt;code&gt;queue-worker-web&lt;/code&gt;, &lt;code&gt;.agent&lt;/code&gt; context injection, &lt;code&gt;CLAUDE.md&lt;/code&gt; compiler, capability profiles, observer, craftsman, committer, deployer, dependency-aware scheduling, priority queue, dry-run tasks, task retry, manual lifecycle commands, live logs, FastAPI dashboard, Alpine.js SPA, usage history, reset-anchored scheduling, lock-file recovery, episodic memory, semantic memory, procedural memory.&lt;/p&gt;</description></item></channel></rss>