Skip to content

feat(kairos): /kairos switches proactive mode on mid-session, and it holds - #118

Merged
SSFSKIM merged 1 commit into
mainfrom
kairos-flag
Sep 6, 2026
Merged

SSFSKIM merged 1 commit into
mainfrom
kairos-flag

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Sep 6, 2026

Copy link
Copy Markdown
Owner

feat(kairos): /kairos switches proactive mode on mid-session, and it holds

Proactive mode could only be set at launch, through KAIROS=1. Typing /kairos
put the skill body into one turn, and the next compaction dropped it. Now a
UserPromptExpansion hook matched on the kairos command records the mode as a
flag file named by the session id under ~/.claude/kairos, and the SessionStart
hook injects the body when it finds that flag as well as when KAIROS=1 is
set — at startup, resume, clear and compact. /kairos off removes the flag and
the skill body tells the session the mode has ended.

Why a file and why the expansion event: hooks are separate processes sharing
nothing but the filesystem and the session id on stdin (CLAUDE_ENV_FILE is
not offered on prompt events and reaches only later Bash commands), and the
session id survives compaction and --resume. UserPromptExpansion fires only
when the human types a slash command and matches on its name, so the hook
never scans prompts.

Flags older than a week are swept whenever a body is injected; a finished
session leaves its flag behind and this is cheaper than a SessionEnd hook.

Tests: 16 (was 6) — the flag path on compact and resume, another session
untouched, off, off as a no-op, the sweep, and the wiring. Version 7.72.4.

…holds

Proactive mode could only be set at launch, through KAIROS=1. Typing /kairos
put the skill body into one turn, and the next compaction dropped it. Now a
UserPromptExpansion hook matched on the kairos command records the mode as a
flag file named by the session id under ~/.claude/kairos, and the SessionStart
hook injects the body when it finds that flag as well as when KAIROS=1 is
set — at startup, resume, clear and compact. /kairos off removes the flag and
the skill body tells the session the mode has ended.

Why a file and why the expansion event: hooks are separate processes sharing
nothing but the filesystem and the session id on stdin (CLAUDE_ENV_FILE is
not offered on prompt events and reaches only later Bash commands), and the
session id survives compaction and --resume. UserPromptExpansion fires only
when the human types a slash command and matches on its name, so the hook
never scans prompts.

Flags older than a week are swept whenever a body is injected; a finished
session leaves its flag behind and this is cheaper than a SessionEnd hook.

Tests: 16 (was 6) — the flag path on compact and resume, another session
untouched, off, off as a no-op, the sweep, and the wiring. Version 7.72.4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant