Skip to content

feat: move entity storage to .kaizen/ and add Kaizen Lite guide - #67

Merged
visahak merged 2 commits into
AgentToolkit:mainfrom
vinodmut:claudecodeplugin
Feb 23, 2026
Merged

feat: move entity storage to .kaizen/ and add Kaizen Lite guide#67
visahak merged 2 commits into
AgentToolkit:mainfrom
vinodmut:claudecodeplugin

Conversation

@vinodmut

@vinodmut vinodmut commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Move entity storage from .claude/entities.json to .kaizen/entities.json so the plugin has its own dedicated workspace directory.

Add KAIZEN_LITE.md documenting the lightweight plugin-only mode that requires no vector DB, MCP servers, or API keys. Includes a walkthrough example showing the learn-then-recall loop across two sessions and a tradeoffs section comparing Lite with Full Kaizen.

For #66

Summary by CodeRabbit

  • Documentation

    • Added Kaizen Lite docs describing lightweight plugin mode, Learn/Recall/Save workflows, verification steps, example walkthroughs, and a comparison with Full Kaizen.
    • Updated README and skill docs with links and storage path references.
  • Chores

    • Changed default entities storage location and discovery order to a new .kaizen path (project and workspace-aware).

Move entity storage from .claude/entities.json to .kaizen/entities.json
so the plugin has its own dedicated workspace directory.

Add KAIZEN_LITE.md documenting the lightweight plugin-only mode that
requires no vector DB, MCP servers, or API keys. Includes a walkthrough
example showing the learn-then-recall loop across two sessions and a
tradeoffs section comparing Lite with Full Kaizen.
@coderabbitai

coderabbitai Bot commented Feb 23, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds Kaizen Lite documentation and standardizes entity storage paths from .claude/entities.json to .kaizen/entities.json across plugin docs and the Kaizen learn/recall save/retrieve scripts.

Changes

Cohort / File(s) Summary
Kaizen Lite docs
KAIZEN_LITE.md, README.md
Adds KAIZEN_LITE.md describing Kaizen Lite (installation, workflow, skills, storage format, tradeoffs) and links it from README.md.
Plugin docs — path updates
plugins/kaizen/README.md, plugins/kaizen/skills/learn/SKILL.md, plugins/kaizen/skills/recall/SKILL.md
Replaces documentation references to .claude/entities.json with .kaizen/entities.json and adds walkthrough/link to KAIZEN_LITE.md.
Kaizen scripts — entity path resolution
plugins/kaizen/skills/learn/scripts/save_entities.py, plugins/kaizen/skills/recall/scripts/retrieve_entities.py
Changes default and fallback entity file locations to .kaizen/entities.json, adds project-root (CLAUDE_PROJECT_ROOT) precedence in lookup order; no public API changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • visahak
  • illeatmyhat

Poem

🐰 A new .kaizen burrow, tidy and bright,
Docs whisper secrets by lamplight,
Scripts hop to find entities where they hide,
Lite-mode lessons tucked safely inside. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately summarizes the main changes: moving entity storage to .kaizen/ and adding Kaizen Lite documentation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
plugins/kaizen/skills/learn/scripts/save_entities.py (1)

53-66: ⚠️ Potential issue | 🟠 Major

No backward-compatibility fallback for existing .claude/entities.json data

Users who ran the plugin before this PR have entities in .claude/entities.json. After upgrading, both find_entities_file() here and in retrieve_entities.py completely ignore that path — entities are silently inaccessible and the next /kaizen:learn creates a fresh .kaizen/entities.json. There is no runtime warning, no automatic migration, and no mention of a manual migration step in any of the updated docs.

🛡️ Suggested one-time migration fallback
     for loc in locations:
         if loc and Path(loc).exists():
             return Path(loc).resolve()

+    # One-time migration: check old .claude/ path and notify user
+    for old_base in [os.environ.get("CLAUDE_PROJECT_ROOT", ""), "."]:
+        old_path = Path(old_base) / ".claude" / "entities.json"
+        if old_path.exists():
+            print(
+                f"[kaizen] Found entities at deprecated path {old_path}. "
+                f"Move it to .kaizen/entities.json or set KAIZEN_ENTITIES_FILE.",
+                file=sys.stderr,
+            )
+            break
+
     return None
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/kaizen/skills/learn/scripts/save_entities.py` around lines 53 - 66,
The code currently ignores legacy ".claude/entities.json" causing silent data
loss; update find_entities_file() in save_entities.py to include the legacy path
(".claude/entities.json") in the locations list (and do the same lookup in
retrieve_entities.py), and when that legacy file is found perform a one-time
migration: copy/move it into the new location (e.g., ".kaizen/entities.json")
and emit a process/log warning that a migration occurred so users aren’t
surprised. Ensure you use Path.resolve(), handle IO exceptions, and preserve
file permissions and contents during the migration so both find_entities_file()
and retrieve_entities.py can transparently use the migrated file.
🧹 Nitpick comments (2)
plugins/kaizen/skills/learn/scripts/save_entities.py (1)

74-77: Stale variable name claude_dir now refers to .kaizen/

The variable was carried over from the old .claude/ path. Rename it to kaizen_dir to match the new directory.

♻️ Rename stale variable
-        claude_dir = Path(project_root) / ".kaizen"
+        kaizen_dir = Path(project_root) / ".kaizen"
     else:
         # Fall back to current directory's .kaizen/
-        claude_dir = Path(".kaizen")
+        kaizen_dir = Path(".kaizen")

-    claude_dir.mkdir(parents=True, exist_ok=True)
-    return (claude_dir / "entities.json").resolve()
+    kaizen_dir.mkdir(parents=True, exist_ok=True)
+    return (kaizen_dir / "entities.json").resolve()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/kaizen/skills/learn/scripts/save_entities.py` around lines 74 - 77,
The variable name claude_dir is stale and should be renamed to kaizen_dir
wherever it's defined and used (e.g., the assignment clauses that set
Path(project_root) / ".kaizen" and Path(".kaizen")), so update the variable name
in save_entities.py to kaizen_dir and adjust all subsequent references to use
kaizen_dir instead of claude_dir to match the new .kaizen directory name.
plugins/kaizen/skills/recall/scripts/retrieve_entities.py (1)

67-74: Duplicate fallback entry when CLAUDE_PROJECT_ROOT is unset

os.path.join("", ".kaizen/entities.json") evaluates to ".kaizen/entities.json", making entries at index 0 and 1 identical when the env var is absent. The same pattern exists in save_entities.py lines 53–57.

♻️ Filter out the empty-prefix entry
     locations = [
         # Project root from Claude Code
-        os.path.join(os.environ.get("CLAUDE_PROJECT_ROOT", ""), ".kaizen/entities.json"),
+        *(
+            [os.path.join(os.environ["CLAUDE_PROJECT_ROOT"], ".kaizen/entities.json")]
+            if os.environ.get("CLAUDE_PROJECT_ROOT")
+            else []
+        ),
         # Current working directory
         ".kaizen/entities.json",
         # Plugin-relative path (fallback)
         str(Path(__file__).parent.parent / "entities.json"),
     ]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/kaizen/skills/recall/scripts/retrieve_entities.py` around lines 67 -
74, The locations list includes
os.path.join(os.environ.get("CLAUDE_PROJECT_ROOT", ""), ".kaizen/entities.json")
which becomes ".kaizen/entities.json" when CLAUDE_PROJECT_ROOT is unset,
duplicating the second entry; update the code that builds the locations list in
retrieve_entities.py (and mirror the same change in save_entities.py) to only
include the joined path when os.environ.get("CLAUDE_PROJECT_ROOT") is truthy (or
alternatively build the list and remove duplicates while preserving order), so
the entries in variable locations are unique.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@KAIZEN_LITE.md`:
- Around line 46-79: Add the Markdown language specifier "text" to both fenced
conversation transcript blocks (the Session 1 and Session 2 code fences) so they
start with ```text instead of ```; update the first fenced block containing the
You/Claude transcript (the block beginning with "You: Tell me the distances...")
and the second transcript block later in the file to satisfy markdownlint MD040.

---

Outside diff comments:
In `@plugins/kaizen/skills/learn/scripts/save_entities.py`:
- Around line 53-66: The code currently ignores legacy ".claude/entities.json"
causing silent data loss; update find_entities_file() in save_entities.py to
include the legacy path (".claude/entities.json") in the locations list (and do
the same lookup in retrieve_entities.py), and when that legacy file is found
perform a one-time migration: copy/move it into the new location (e.g.,
".kaizen/entities.json") and emit a process/log warning that a migration
occurred so users aren’t surprised. Ensure you use Path.resolve(), handle IO
exceptions, and preserve file permissions and contents during the migration so
both find_entities_file() and retrieve_entities.py can transparently use the
migrated file.

---

Nitpick comments:
In `@plugins/kaizen/skills/learn/scripts/save_entities.py`:
- Around line 74-77: The variable name claude_dir is stale and should be renamed
to kaizen_dir wherever it's defined and used (e.g., the assignment clauses that
set Path(project_root) / ".kaizen" and Path(".kaizen")), so update the variable
name in save_entities.py to kaizen_dir and adjust all subsequent references to
use kaizen_dir instead of claude_dir to match the new .kaizen directory name.

In `@plugins/kaizen/skills/recall/scripts/retrieve_entities.py`:
- Around line 67-74: The locations list includes
os.path.join(os.environ.get("CLAUDE_PROJECT_ROOT", ""), ".kaizen/entities.json")
which becomes ".kaizen/entities.json" when CLAUDE_PROJECT_ROOT is unset,
duplicating the second entry; update the code that builds the locations list in
retrieve_entities.py (and mirror the same change in save_entities.py) to only
include the joined path when os.environ.get("CLAUDE_PROJECT_ROOT") is truthy (or
alternatively build the list and remove duplicates while preserving order), so
the entries in variable locations are unique.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce1ead3 and 0ea7fb7.

📒 Files selected for processing (7)
  • KAIZEN_LITE.md
  • README.md
  • plugins/kaizen/README.md
  • plugins/kaizen/skills/learn/SKILL.md
  • plugins/kaizen/skills/learn/scripts/save_entities.py
  • plugins/kaizen/skills/recall/SKILL.md
  • plugins/kaizen/skills/recall/scripts/retrieve_entities.py

Comment thread KAIZEN_LITE.md Outdated
Rename claude_dir to kaizen_dir in save_entities.py to match the .kaizen
directory, add text language specifier to KAIZEN_LITE.md fenced blocks,
and guard CLAUDE_PROJECT_ROOT locations entry so it is only included when
the env var is set (preventing a duplicate .kaizen/entities.json path).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
plugins/kaizen/skills/recall/scripts/retrieve_entities.py (1)

74-76: Use Path for consistency with the rest of find_entities_file.

Line 72 already builds paths with pathlib, and every entry is wrapped in Path() at line 78. Mixing os.path.join with an embedded forward slash here is a minor style inconsistency, even though Path(loc).exists() normalises separators on all platforms.

♻️ Proposed refactor
     if project_root:
         # Project root from Claude Code (prepend so it's checked first)
-        locations.insert(0, os.path.join(project_root, ".kaizen/entities.json"))
+        locations.insert(0, str(Path(project_root) / ".kaizen" / "entities.json"))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/kaizen/skills/recall/scripts/retrieve_entities.py` around lines 74 -
76, The code mixes os.path.join with pathlib in find_entities_file: replace the
os.path.join usage so the project-root path is constructed with Path—e.g., build
a Path from project_root and append ".kaizen/entities.json" (or using / to join)
before inserting into locations—so the inserted item is a Path instance
consistent with the other entries referenced later (look for locations.insert(0,
...) and project_root).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@plugins/kaizen/skills/recall/scripts/retrieve_entities.py`:
- Around line 74-76: The code mixes os.path.join with pathlib in
find_entities_file: replace the os.path.join usage so the project-root path is
constructed with Path—e.g., build a Path from project_root and append
".kaizen/entities.json" (or using / to join) before inserting into locations—so
the inserted item is a Path instance consistent with the other entries
referenced later (look for locations.insert(0, ...) and project_root).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ea7fb7 and 226a080.

📒 Files selected for processing (3)
  • KAIZEN_LITE.md
  • plugins/kaizen/skills/learn/scripts/save_entities.py
  • plugins/kaizen/skills/recall/scripts/retrieve_entities.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • plugins/kaizen/skills/learn/scripts/save_entities.py
  • KAIZEN_LITE.md

@visahak
visahak merged commit 9dcdc54 into AgentToolkit:main Feb 23, 2026
15 checks passed
@vinodmut
vinodmut deleted the claudecodeplugin branch February 23, 2026 21:31
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.

3 participants