paperq
paperq is a small, repository-local queue for the tiny problems coding agents encounter while doing real work. It writes transparent Markdown files and promotes resolved problems into a project-level solution journal; it does not run a model, collect transcripts, start a service, or send anything to a server.
The project targets .NET 10 and publishes as Native AOT executables.
Installation
Starting with paperq 1.0.2, x64 releases require an x86-64-v3 processor. This includes AVX2, BMI1, BMI2, F16C, FMA, LZCNT, and MOVBE. Their ZIP and tar.gz file names end in -x64-v3. ARM64 releases require Armv8-A.
Windows
paperq is available on WinGet:
winget install Vathivis.paperq
Linux
Download the .deb matching the machine architecture from GitHub Releases, then install it with APT:
sudo apt install ./paperq_*_amd64.deb # x86-64
sudo apt install ./paperq_*_arm64.deb # ARM64
The package installs the standalone executable as /usr/bin/paperq; it does not require a separate .NET runtime. The amd64 package checks for x86-64-v3 before installation and refuses to install on an unsupported CPU.
Queue layout
PAPERQ_RESOLUTIONS.md
.papercuts/
open/
working/
blocked/
resolved/
Each papercut is one Markdown file. Its directory is its current state. next --claim takes an exclusive handle and atomically moves the oldest open record into working, so concurrent local agents cannot claim the same item.
PAPERQ_RESOLUTIONS.md is created lazily by the first successful resolve. Every resolution adds the original problem, the resolution note, the journal recording time, and a link to the detailed record in .papercuts/resolved. The root-level journal is not covered by the optional .papercuts/ ignore rule, so it can be committed and shared as durable project knowledge. Existing v0.1 resolved records are not backfilled automatically because their free-form history has no unambiguous machine-readable resolution boundary.
The queue and resolution-journal concurrency guarantees cover processes sharing one local filesystem. Git merges and cloud-sync conflicts between separate computers are outside the guarantee.
Commands
paperq init [--append-agents] [--gitignore]
paperq add "message"
paperq add --stdin
paperq list [--all]
paperq show
paperq next [--claim]
paperq claim
paperq resolve --note "evidence"
paperq resolve --stdin
paperq block --reason "reason"
paperq block --stdin
paperq reopen
paperq prune ... --delete --reason "outdated" [--apply]
paperq prune ... --archive --reason "outdated" [--apply]
paperq consolidate ... --note "shared solution" [--apply]
Every command accepts these global options:
--root Use this exact directory instead of discovering a Git root.
--json Write the versioned JSON contract to stdout.
Global options may appear before or after a command.
Without --root, paperq walks upward from the current directory to find the nearest .git directory or file. If it finds none, it uses the current directory. An explicit --root is always used exactly as supplied.
Capture and maintenance workflows
Capture during normal work
PaperQ's default agent workflow is deliberately one-way: when an agent encounters small, non-blocking friction, it records the papercut with add, ends the papercut-capture side-track, and immediately returns to its original task. The papercut remains open. A normal working agent does not claim, investigate, resolve, block, reopen, or delegate it unless the user or project-specific instructions explicitly request that behavior.
This keeps incidental friction from expanding the current task and preserves the queue for a later focused maintenance pass.
Dedicated maintenance pass
When an agent is explicitly assigned papercut maintenance, it acts as the resolver:
- read
PAPERQ_RESOLUTIONS.md if it exists, so verified approaches are not repeated;
- run
paperq list to understand the active queue;
- claim the oldest open item with
paperq next --claim;
- inspect its full message and history with
paperq show ;
- investigate and fix the underlying friction;
- record verified evidence with
resolve, or use block with a concrete reason when work cannot proceed;
- repeat until no open papercuts remain.
Resolution notes and block reasons can be supplied inline or read from standard input with --stdin.
When the user explicitly selects a specific item from list, use paperq claim instead of next --claim. This opt-in path does not change the default oldest-first workflow.
Pruning and consolidation
Both maintenance commands preview their changes by default. They list the selected IDs, the reason or summary, and the journal size before and after the operation. Add --apply to save the change. They accept the global --root and --json options. Select at most 256 distinct IDs per command.
Pruning requires an explicit choice:
paperq prune ... --delete --reason "no longer applicable" --apply
paperq prune ... --archive --reason "superseded" --apply
Only open and resolved records can be pruned. Working and blocked records are rejected. All selected records are checked before any removal. Both modes remove the selected record files and every journal entry belonging to those IDs, including entries from earlier resolve/reopen cycles. --delete leaves no per-item backup or retry marker. A later show, resolve, or repeated prune for a removed ID returns not_found.
--archive first writes and verifies one compressed ZIP in .papercuts/.maintenance/. It publishes the ZIP under .papercuts/archives/ only after the recovery plan is prepared, then removes the source files. Preparation failures discard the staged ZIP; recovery can publish a prepared archive before removing its originals. The ZIP contains the original record bytes at their relative paths, the removed journal entries in PAPERQ_RESOLUTIONS.md, and a prune.txt file with the reason and time. Archived records are outside the active queue; extract the ZIP to inspect them. No uncompressed archive copies are retained. Archive mode only saves space when the compressed data is smaller than the source files.
Consolidation replaces selected resolutions with one summary supplied by the user or agent:
paperq consolidate ... --note "Shared problem and verified solution." --apply
Select at least two resolved IDs. PaperQ does not infer similarity or write the summary. It retains links to the source records, their full lifecycle histories, and compact markers that prevent resolve retries from restoring the old text. Select all source IDs when combining an existing consolidated group with other resolutions. Pruning part of a consolidated group removes those IDs and their markers; the shared summary remains until the final source ID is pruned.
Use --stdin instead of --reason or --note for multiline text. These commands are separate from the normal capture workflow and run only when maintenance is requested.
Journal rewrites preserve unrelated entries and text outside managed entries. Legacy entries have no end marker, so an ambiguous manual suffix causes the operation to fail without a rewrite. Consolidated groups have explicit end markers. Malformed journals are rejected.
Queue mutations share a local lock. Pruning uses temporary files under .papercuts/.maintenance so the next mutating command can complete an interrupted operation. A preview refuses to perform recovery. Successful pruning removes its temporary files. If recovery detects a changed record or journal, it stops with maintenance_conflict and preserves the temporary files for inspection. These guarantees cover cooperating PaperQ processes on one local filesystem.
Optional parallel resolution
PaperQ stores queue state; it does not launch models or agents. An environment that supports subagents may use separate user or project instructions to dispatch a resolver after add while the main agent continues its task. That external orchestration policy owns the resolver model, reasoning effort, permissions, concurrency, and write coordination.
| Command | State behavior |
|---|
add | Creates an open papercut. |
next | Previews the oldest open papercut without changing it. |
next --claim | Atomically moves the oldest open papercut to working. |
claim | Atomically moves the selected open papercut to working. |
show | Shows the full message and lifecycle history from any state. |
resolve | Moves a working papercut to resolved and updates the resolution journal. |
block | Moves a working papercut to blocked. |
reopen | Moves a working, blocked, or resolved papercut back to open. |
prune | Previews removal of selected open/resolved records and journal entries; --apply deletes them or first saves a verified ZIP. |
consolidate | Previews a shared summary for selected resolutions; --apply rewrites the journal and preserves detailed records. |
list shows open, working, and blocked records by default. list --all also includes resolved records. Selection is oldest-first using the UTC creation time and then the ID as a deterministic tie-breaker.
Initialization
paperq init creates only the queue directories automatically. Without --json, it always prints paste-ready AGENTS.md instructions and a short resolution-journal reference. In an interactive terminal it also:
- asks whether to create or append the root
AGENTS.md, defaulting to No;
- when the selected root is a Git repository, asks whether to add
.papercuts/ to .gitignore, defaulting to No.
When input or output is redirected, or --json is used, init does not prompt and does not modify AGENTS.md or .gitignore. Automation can request those changes explicitly with --append-agents and --gitignore. Both edits are idempotent, and --gitignore is rejected outside a Git repository. --append-agents preserves custom instructions and appends only PaperQ's managed blocks; running it against an older PaperQ block adds the missing journal reference without duplicating or rewriting existing content.
Copy-ready AGENTS.md instructions
Paste this block into the repository's root AGENTS.md, or let paperq init add it for you:
## Papercuts
During normal work, record small, non-blocking friction with `paperq add ""` or `paperq add --stdin` without resolving it; after the record is added, end the papercut-capture side-track and continue the main task. Examples include dead-end tool calls, broken links, flaky commands, stale caches, confusing errors, and undocumented setup.
Keep each papercut to one or two sentences. Include a suspected cause or fix only when useful. Never log secrets, credentials, full transcripts, or large raw output.
When explicitly assigned papercut maintenance, read `PAPERQ_RESOLUTIONS.md` if it exists, then process the queue one item at a time with `paperq list`, `paperq next --claim`, and `paperq show `. When the user explicitly selects a specific papercut ID, use `paperq claim ` instead of the oldest-first `next --claim`. Investigate the claimed item, use `paperq resolve --note ""` when fixed or `paperq block --reason ""` when it cannot proceed, then continue until no open papercuts remain.
If `PAPERQ_RESOLUTIONS.md` exists, read it before retrying recurring project-specific friction. PaperQ creates it after the first successful `resolve`.
IDs contain a sortable UTC timestamp plus random entropy:
20260805T142301123Z-a7f3c921de
A new record looks like this:
# Papercut
ID: 20260805T142301123Z-a7f3c921de
Created: 2026-08-05T14:23:01.1230000+00:00
## Message
The setup command fails until the stale cache is removed.
## History
Lifecycle commands append human-readable Blocked, Reopened, or Resolved entries below History. The state remains defined by the containing directory, not duplicated as mutable metadata.
Resolving the example creates or extends this separate project journal:
# PaperQ Resolutions
Project-specific solutions captured when papercuts are resolved.
## 20260805T142301123Z-a7f3c921de
Recorded: 2026-08-05T15:04:12.0000000+00:00
Papercut: [.papercuts/resolved/20260805T142301123Z-a7f3c921de.md](.papercuts/resolved/20260805T142301123Z-a7f3c921de.md)
### Problem
The setup command fails until the stale cache is removed.
### Resolution
Added a cache cleanup step to the setup script and verified it from a clean shell.
The resolved record remains the full audit trail. PAPERQ_RESOLUTIONS.md is the concise lookup future agents are told to read. Repeating the same resolution note after an interrupted journal update is safe and does not duplicate the entry.
- Messages, resolution notes, and block reasons must be non-empty valid Unicode.
- Each input is limited to 64 KiB after UTF-8 encoding.
- NUL characters and reserved `