kg-threads

kg-threads is a skill for Claude Code, Codex from kagan-sh/kagan. It costs 55 tokens per session (2,062 once invoked), scanned A, original, Apache-2.0.

A guide for creating and operating Kagan threads, where a thread is a separate work conversation that can act as a helper, reviewer, or parallel worker. It explains when work should stay in the current thread and when to start another one.

In plain words
What is it for?
Use it to delegate separate tasks, start parallel work, ask a thread a question, or monitor a helper's progress.
Why use it?
It prevents unnecessary subagents and keeps delegated work connected to the right project and environment. It also covers waiting for, asking, stopping, and reading thread results.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; mentions Codex; mentions OpenCode.

Good fit Use it to delegate separate tasks, start parallel work, ask a thread a question, or monitor a helper's progress.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kagan-sh/kagan/kg-threads
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kagan-sh/kagan --skill kg-threads
Clone the repo
git clone --depth 1 https://github.com/kagan-sh/kagan

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for kg-threads

README.md
[![agentmods](https://agentmods.dev/badge/skills/kagan-sh/kagan/kg-threads/github.svg)](https://agentmods.dev/skills/kagan-sh/kagan/kg-threads)
Your own site
<a href="https://agentmods.dev/skills/kagan-sh/kagan/kg-threads"><img src="https://agentmods.dev/badge/skills/kagan-sh/kagan/kg-threads/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.

agentmods 80×15 button for kg-threads

Your own site · 80×15
<a href="https://agentmods.dev/skills/kagan-sh/kagan/kg-threads"><img src="https://agentmods.dev/badge/skills/kagan-sh/kagan/kg-threads.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,062 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.02062
Opus 5.5 $0.00022 $0.00825
Sonnet 5.5 $0.00011 $0.00412
Haiku 4.5 $0.00006 $0.00206

Measured today against content hash 2fdea7cbdce9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kg-threads 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 today.

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.

crates/core/skills/kg-threads/SKILL.md · 98 lines

How it starts

The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Threads

kg is how you use kagan. kg status --json is this thread. KG_THREAD_ID, KG_PROJECT_ID, and KG_ENVIRONMENT_ID fill the matching arguments when you leave them out. cli in that status is the binary that talks to the open app.

Read kg guide threads for the flag list and for what waiting, idle, and busy mean. Read kg thread <command> --help for the live flags. This skill says when a job is another thread, and the commands that do it. Pass --json when the output decides the next command. A nonzero exit is a failure.

A helper, reviewer, or parallel worker is a kagan thread. Task, Agent, and this program's subagent tool are the wrong tool. One task stays in this thread.

When the job stays here

Keep the work here when it is one task, the person is talking to you, or you are running a command in this folder. Do not start a thread to hold a note, to retry the same edit, or to ask something you can ask here.

kg thread ask raises a question in this thread. The answer arrives as answered.

When it becomes another thread

Start another thread when the work is a separate helper, reviewer, or parallel worker, or when the person asked for one. A thread is one program in one folder. The child does not inherit this conversation. Give it a prompt that names the outcome, the constraints, what to check, and what to report back.

A parent is told by a line typed into its terminal when the child's turn ends, the child asks the person a question, its program exits, or it fails. The line names the child and says kg thread screen <id> to read it. A stop the person asked for stays quiet. Pass --quiet to kg thread run to turn the line off for that child. kg thread wait is still there when this thread has to block until the child's reply ends. A wait that returns the child's end replaces its line, so the parent is not told twice.

Report the new thread id. Do not build a URL for it.

A chat thread

A thread whose link is acp (started with --link acp, or by the window's own agent picker) draws a chat instead of a terminal: its transcript is its events, and the prompt box is the way in. --link acp takes claude, codex, gemini, kimi or opencode, and kagan runs that agent's ACP command itself; any other program is refused. kg thread events <id> reads what the agent said; a terminal thread has no chat and screen, resize and paste are refused for one. A plugin with the chat area reads the same transcript with kagan/chat, and the person may let a plugin draw it. Tell the person kg thread run --link acp, not screen.

Read the full file on GitHub · 98 lines

Changes

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.

  1. today Changed · +11 lines 2fdea7cbdce9
  2. 20d ago First seen · 87 lines · 55 tokens per session scan A 1bd906871824

Subscribe to this mod's changes

kg-threads is a skill published in the GitHub repository kagan-sh/kagan (5 stars, last pushed today), licensed Apache-2.0. It adds 55 tokens to every session and 2,062 once invoked, about $0.0002 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-11-11.

Related

kg-threads compared with skills from other repositories

kg-threads next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
kg-threadskagan-sh/kaganSkill5todayApache-2.0A55Claude Code, Codex
architecture-auditorg2AI/ORG2Skill2.5k28d agoAGPL-3.0A70Claude Code, Codex
concord-relayGet-Concord-AI/concord-mcpSkill1.7kyesterdayMITA18Claude Code, Codex
idea-teammajiayu000/spellbookSkill301yesterdayMITA182Claude Code
codex-agentmajiayu000/spellbookSkill301yesterdayMITA45Claude Code
project-health-auditormajiayu000/spellbookSkill301yesterdayMITA31Claude Code
review-gatemajiayu000/spellbookSkill301yesterdayMITA95Claude Code, Codex