kk-sessions
Automatically organizes new agent sessions in Claude Code and Codex desktop apps. It uses a workspace map to give each session a standard-format title, put it in a sidebar section, and write its output files to a matching directory. A one-step rollback is included.
What it can touch
| files | write, including ~/.claude/settings.json, ~/.codex/hooks.json, ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md, ~/.claude/skills/, ~/.codex/skills/, ~/.codex/state_*.sqlite, ~/.agent-rules/workspace-map.md, ~/.agent-rules/kk-sessions/ |
|---|---|
| network | none found |
| shell | runs commands |
| secrets | none found |
What it actually does
The plugin installs four skills and three hooks per agent. Claude Code hooks: - SessionStart echoes routing instructions into the agent context. - UserPromptSubmit (turn_hint.py) reads the session transcript for the latest custom title and injects a reminder about the ⏳ suffix. - Stop (stop_check.py) blocks the first turn once if the session has not been titled yet, so the model finishes routing. Codex hooks: - SessionStart injects a context hint. - UserPromptSubmit reads ~/.codex/state_*.sqlite read-only to get the thread title. - Stop (codex_route.py) spawns a detached background Python worker. The worker: - starts `codex app-server`; - reads the thread; - sends the workspace map plus the first ≤3 turns (user text up to 1200 chars, assistant tail up to 800 chars) to a separate model via `codex exec --ephemeral` with tools disabled and a read-only sandbox; - writes the title and section back through Codex's internal desktop named pipe, or the experimental app-server API as a fallback. State kept under ~/.agent-rules/kk-sessions/: snapshots, logs, done/tries/pending markers, and a copied restore kit. install.py (optional, used instead of the plugin system): - copies the skills into ~/.claude/skills and ~/.codex/skills; - merges hooks into ~/.claude/settings.json and ~/.codex/hooks.json, with a .bak backup; - strips an old marked rules block from CLAUDE.md and AGENTS.md; - refuses to uninstall while snapshots exist unless --force is given. restore.py uses the snapshot to revert titles and sections and to delete sections the plugin created. No credential access, no external hosts beyond the user's own Codex model calls, and no obfuscation.
What the check found
mediumStop hook spawns a detached background worker that outlives the hook
On Codex, every Stop event in a new session can launch a detached Python process, broken away from the job object on Windows. That process starts `codex app-server` and `codex exec`, and retries after 60s on error. This is how the tool does its job, and the README documents it. The process is capped at MAX_TRIES per thread. Users should still know that background processes run after each turn of a new session.
skills/kk-session-route/scripts/codex_route.py:563 flags = subprocess.DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP | NO_WINDOW
skills/kk-session-route/scripts/codex_route.py:566 for extra in ((subprocess.CREATE_BREAKAWAY_FROM_JOB,) if sys.platform == "win32" else ()) + (0,):
skills/kk-session-route/scripts/codex_route.py:151 self.proc = subprocess.Popen([self.binary, "app-server", "--disable", "hooks"],
mediumConversation excerpts sent to a separate model call
The background worker sends the workspace map and parts of the first three user and assistant turns to a model through the user's own Codex account. This is disclosed and limited in size. The data goes to the same provider the user already uses, but it adds model calls and token cost beyond the user's own requests.
skills/kk-session-route/scripts/codex_route.py:468 "conversation": [{"user": r["user"][:1200], "assistant": r["answer"][-800:]} for r in rounds],
README.md:97 - **会发给模型的内容**:工作区地图,加上新会话前三轮内每轮的用户消息(最多 1200 字)和助手回答的结尾(最多 800 字)。走的是你自己的 Codex 账号,和平时对话的去处一样。每次的结果记在同目录的 `codex/log.jsonl`。
mediumRelies on undocumented internal Codex desktop pipe and experimental app-server API
The worker finds any named pipe called `codex-app-tools-*` and calls desktop tools directly. It fabricates callId and turnId values and attaches to the target thread. The author acknowledges these are not public APIs, so they may break or behave unexpectedly after Codex updates. This is not malicious, but it is fragile and touches internal interfaces.
skills/kk-session-route/scripts/codex_route.py:223 if p.startswith("codex-app-tools-")]
README.md:98 - **依赖未公开接口**:结果是通过 Codex 桌面端的内部工具通道写回侧栏的,侧栏会立即刷新;这个通道不可用时,退回 Codex app-server 的实验接口,侧栏要等桌面端重新加载后才显示。这两个接口都不是公开 API,Codex 升级后可能失效,失效时日志里会出现 `error`。这时在会话里说「路由一下
mediumInstaller edits global agent hook configs and instruction files
install.py merges hooks into ~/.claude/settings.json and ~/.codex/hooks.json, and removes a marked block from CLAUDE.md and AGENTS.md. It backs up the original file and only removes entries it owns, identified by a marker string. This is expected for a hook-based plugin, but users should know about it.
install.py:32 "hooks_file": HOME / ".claude" / "settings.json",
install.py:40 "hooks_file": HOME / ".codex" / "hooks.json",
install.py:130 write(f, (head.rstrip("\n") + rest.split(RULES_END, 1)[1]).lstrip("\n"))
mediumCodex Stop hook spawns a detached background worker that breaks away from the job object
After each early turn the hook launches a separate Python process that outlives the hook. On Windows it is detached and breaks away from the host's job object. The process is bounded: at most two attempts with a 60-second sleep between them, at most 5 spawns per thread, and only the first 3 turns. It does only routing work. It is still a background process the user doesn't see.
skills/kk-session-route/scripts/codex_route.py:566 for extra in ((subprocess.CREATE_BREAKAWAY_FROM_JOB,) if sys.platform == "win32" else ()) + (0,):
skills/kk-session-route/scripts/codex_route.py:563 flags = subprocess.DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP | NO_WINDOW
Keep an eye on it
This check is of one commit. Watch kk-sessions and we'll email you if a later commit changes what it can touch.
Made this? Add the badge
[](https://plugsday.com/tools/kkfor30-kk-sessions)About this check
Checked November 16, 2026 at commit 8c34f7efa52b, 26 files. Rules for known red flags, then two Claude reviews, one of them told to assume the author is malicious. A later commit hasn't been checked. How checks work.