Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/assafkip/kipi-systemnpx agentmods add commands/assafkip/kipi-system/linear-drainWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/assafkip/kipi-system/linear-drain)<a href="https://agentmods.dev/commands/assafkip/kipi-system/linear-drain"><img src="https://agentmods.dev/badge/commands/assafkip/kipi-system/linear-drain/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/assafkip/kipi-system/linear-drain"><img src="https://agentmods.dev/badge/commands/assafkip/kipi-system/linear-drain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00013 | $0.01011 |
| Opus 5.5 | $0.00005 | $0.00404 |
| Sonnet 5.5 | $0.00003 | $0.00202 |
| Haiku 4.5 | $0.00001 | $0.00101 |
Grade A, and why
linear-drain scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Drain the local Linear queue into real Linear objects.
Why this command exists
There is no Linear API key in ~/.config/kipi/, so a shell script (kipi new,
kipi linear issue, any build hook) cannot reach the Linear MCP server. Those
scripts capture intents into a local append-only queue instead. You are the half
that has credentials. Capture is deterministic and offline; you do the network.
Before you create anything, read this
mcp__linear__*delete* and archive are blocked by
~/.claude/hooks/destructive-op-deny.sh, and you cannot set ALLOW_DESTRUCTIVE=1
for yourself. Every object you create is permanent. Duplicates cannot be
cleaned up, only marked Duplicate. So the dedup check below is not optional and
not a formality.
Step 1 — what is pending
python3 "${CLAUDE_PROJECT_DIR}/q-system/.q-system/scripts/linear-queue.py" pending --json
If the list is empty, say so and stop. Do not go looking for work to do.
Step 2 — the remote guard
For each distinct repo in the pending list, fetch what Linear already has. Never skip this step on the grounds that the queue "looks fresh": a parallel session, a wiped ledger, or a re-run all produce a queue that looks fresh and a Linear that already has the object.
mcp__linear__list_projectswithteam: a75b9b87-bfdf-4fb7-bff3-a5a1a2a6946f, to see whether the project exists.mcp__linear__list_issueswithproject: <project id>for the issues, then parse each description for its<!-- kipi-key: ... -->marker.
Write the result to a snapshot file shaped like
{"project": {...} | null, "issues": [{"id", "identifier", "title", "description"}]}.
Step 3 — plan, do not improvise
python3 "${CLAUDE_PROJECT_DIR}/q-system/.q-system/scripts/linear-sync.py" plan \
--map <capability-map.json> --remote <snapshot.json> --out <plan.json>
The planner applies both guards (local ledger, then the remote markers) and tells you exactly what to create. Create only what the plan lists. If the plan is empty, everything already exists; say so and stop.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed cb62a519d01c
- 1mo ago First seen · 93 lines · 13 tokens per session scan A 0bb4b7becb32
linear-drain is a command published in the GitHub repository assafkip/kipi-system (125 stars, last pushed today), licensed MIT. It adds 13 tokens to every session and 1,011 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
recall
Recall memories with filtering and search.
query
Structured frontmatter queries using yq.
search
Full-text search across all memories.
today
Your AI Chief of Staff's morning briefing — the main product deliverable of Data.
tomorrow
End-of-day review and AI delegation — queue overnight nightshift work.
diagnostic
Command "diagnostic" from datacore-one/datacore, covering diagnostic, command context, when to reference dip-0002, quick reference and agents this command invokes.