Repository navigation
feat(kairos): /kairos switches proactive mode on mid-session, and it holds - #118
Merged
Merged
Conversation
…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.
This was referenced Oct 22, 2026
SSFSKIM
added a commit
that referenced
this pull request
Oct 22, 2026
devcloud 0.9.0: a kept or adopted host's tailnet node is removed when it leaves for good (board #118)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.