Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,33 @@ caveat that pre-1.0 minor bumps may include breaking changes
ADDED
* **Credentialed SessionEnd distiller (opt-in).** A second, deterministic
memory-harvest path alongside the v0.9.0 in-agent harvester. `kimetsu plugin
install claude-code` now runs an interactive wizard (on a TTY; skip with
`--no-setup`, force with `--setup-harvest`) that configures a cheap distiller
model — Anthropic (recommended `claude-haiku-4-5`) or any Anthropic-compatible
endpoint incl. **LiteLLM** via `ANTHROPIC_BASE_URL`. The key + base URL are
written to a gitignored `.env`; the selection lands in `[learning.distiller]`
in `project.toml`. A new `SessionEnd` hook then runs `kimetsu brain
session-end-hook`, which (when enabled + credentialed) distills the
install claude-code` and `kimetsu plugin install codex` now run an
interactive wizard (on a TTY; skip with `--no-setup`, force with
`--setup-harvest`) that configures a cheap distiller
model: Anthropic (recommended `claude-haiku-4-5`), OpenAI (recommended
`gpt-5.4-mini`), or compatible endpoints via `ANTHROPIC_BASE_URL` /
`OPENAI_BASE_URL`. The key + base URL are written to a gitignored `.env`;
the selection lands in `[learning.distiller]`
in `project.toml`. A new `SessionEnd` hook for Claude Code runs
`kimetsu brain session-end-hook`; Codex uses its supported `Stop` hook with
`--distill-on-stop`. When enabled + credentialed, the distiller reads the
transcript with that model and records lessons through the confidence-gated
`propose_or_merge_memory`. When the distiller is enabled, the Stop hook's
end-of-session cue is suppressed (the distiller owns end-of-session; the
mid-session PostToolUse resolved-failure cue stays). `AnthropicProvider`
gained an optional base URL for the LiteLLM case.
gained an optional base URL for the LiteLLM case, and the distiller gained
an OpenAI Responses API provider. With `--scope global` the
wizard configures the distiller once in `~/.kimetsu/` (config + `.env`); that
global distiller then runs in every project and records into the user brain
(`~/.kimetsu/brain.db`, available everywhere), with a per-project distiller
taking precedence when one is configured.
* **Auto-harvested memories (in-agent).** The hooks now drive memory
*generation*, not just retrieval. When a command that failed earlier in the
session succeeds (PostToolUse), or a non-trivial session ends with nothing
recorded (Stop), Kimetsu emits a `[kimetsu-harvest]` cue telling the agent to
dispatch a new background **`kimetsu-memory-harvester`** subagent (installed
at `.claude/agents/`, pinned to a cheap model). The subagent distills 0–3
at `.claude/agents/` for Claude Code and `.codex/agents/` for Codex, pinned
to a cheap model). The subagent distills 0–3
generalizable lessons and records them through the confidence-gated
`kimetsu_brain_record` path — no separate API key or kimetsu-side model
credentials, billed in-agent at the cheap model's rate, non-blocking. Cues
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ cover Claude Code and Codex:

```bash
kimetsu plugin install claude --workspace . # writes .mcp.json + .claude/settings.json
kimetsu plugin install codex --workspace . # writes .codex/config.toml + .codex/hooks.json + skill
kimetsu plugin install codex --workspace . # writes .codex/config.toml + .codex/hooks.json + skill + agent

# Install globally for every project (writes to ~/.claude, ~/.claude.json, ~/.codex):
kimetsu plugin install claude --scope global
Expand All @@ -205,11 +205,16 @@ in-agent distiller) that records the lesson for next time — no extra API key.
Turn it off with `[learning] auto_harvest = false` in `.kimetsu/project.toml`.

For a deterministic harvest that doesn't depend on the agent, `kimetsu plugin
install claude-code` offers to set up a **SessionEnd distiller**: a cheap
configured model (Anthropic `claude-haiku-4-5`, or a LiteLLM endpoint via
`ANTHROPIC_BASE_URL`) that distills each session itself at the end and records
the lessons. The wizard stores the key in a gitignored `.env`; skip it with
`--no-setup`.
install claude-code` and `kimetsu plugin install codex` offer to set up a
**SessionEnd distiller**: a cheap configured model (Anthropic
`claude-haiku-4-5`, OpenAI `gpt-5.4-mini`, or a compatible endpoint via
`ANTHROPIC_BASE_URL` / `OPENAI_BASE_URL`) that distills each session itself at
the end and records the lessons. Claude Code runs it from `SessionEnd`; Codex
runs it from the supported `Stop` hook with `--distill-on-stop`. The wizard
stores the key in a gitignored `.env`; skip it with `--no-setup`. Run it with
`--scope global` to configure the distiller once in
`~/.kimetsu/` — it then distills every project's sessions into your user brain
(available everywhere), unless that project has its own distiller.

```bash
kimetsu brain search "build failures"
Expand Down
4 changes: 2 additions & 2 deletions crates/kimetsu-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ homepage.workspace = true
documentation.workspace = true
readme.workspace = true
rust-version.workspace = true
description = "Transport-neutral agent runtime for kimetsu: tools, prompts, verify-loop, providers (claude_code, anthropic)."
keywords = ["kimetsu", "agent", "llm", "anthropic", "claude"]
description = "Transport-neutral agent runtime for kimetsu: tools, prompts, verify-loop, providers (claude_code, anthropic, openai)."
keywords = ["kimetsu", "agent", "llm", "anthropic", "openai"]
categories = ["development-tools"]

[features]
Expand Down
1 change: 1 addition & 0 deletions crates/kimetsu-agent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub mod bench;
pub mod claude_code;
pub mod harness;
pub mod model;
pub mod openai;
pub mod pipeline;
pub mod swe_bench;
pub mod tools;
Expand Down
Loading