Skip to content

logesh4v/context-keeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Context Keeper

A Kiro Power that preserves session context across chat windows. Never lose your decisions, progress, or reasoning when switching sessions.

Features

  • Auto-capture: Structured session summaries saved automatically when sessions end
  • Auto-restore: Prior context loaded automatically when new sessions start
  • Branch-aware: Summaries tagged with git branch — restores prefer same-branch context
  • Project memory: Persistent file accumulates long-term project knowledge across all sessions
  • Manual snapshots: Save context on demand at any point during a session
  • Compression: Consolidate older summaries to keep the store lean
  • Zero dependencies: Pure hooks + steering files, no MCP server needed

Installation

  1. Open Kiro IDE
  2. Go to the Powers panel
  3. Click "Add power from GitHub"
  4. Paste https://github.com/logesh4v/context-keeper
  5. Click Install

That's it. The power starts working immediately — no configuration needed.

Usage

Automatic capture (happens on every session end)

When you close a chat session or it ends, Context Keeper automatically:

  • Detects your current git branch
  • Generates a structured summary (decisions, files modified, patterns, preferences, questions, next steps)
  • Saves it to .kiro/context-keeper/sessions/
  • Updates the project memory with new learnings
  • Cleans up old files (keeps max 20)

Automatic restore (happens on every new session)

When you start a new chat session, Context Keeper automatically:

  • Finds the most recent summary for your current branch (falls back to any branch)
  • Loads the project memory file
  • Loads any compressed historical context
  • Presents everything in labeled sections

Manual snapshot

Trigger the "Snapshot Context" hook anytime to save a point-in-time snapshot. Useful before switching tasks or branches.

Compression

Trigger the "Compress Context" hook to consolidate older summaries. It:

  • Keeps the 3 most recent summaries untouched
  • Merges older ones into a single compressed file
  • Deduplicates decisions, patterns, and preferences
  • Discards session-specific metadata and resolved questions
  • Requires at least 4 session files to run

Session Store Structure

.kiro/context-keeper/
├── project-memory.md              # Persistent project knowledge
└── sessions/
    ├── 2025-01-15T14-30-00-feature-auth.md       # Auto-captured
    ├── 2025-01-15T16-00-00-main.md                # Auto-captured
    ├── 2025-01-15T17-45-00-feature-auth-manual.md # Manual snapshot
    └── compressed-2025-01-16T10-00-00.md           # Compressed history

How It Works

Context Keeper uses 4 hooks and 5 steering files — no MCP server, no external dependencies:

Hook Event What it does
Capture Context agentStop Saves session summary + updates project memory
Restore Context promptSubmit Loads prior context into new session
Snapshot Context userTriggered Manual point-in-time save
Compress Context userTriggered Consolidates older summaries

Contributing

Contributions welcome! This is an open-source Kiro Power.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-improvement)
  3. Make your changes
  4. Run tests: npm test
  5. Submit a pull request

Development Setup

git clone https://github.com/logesh4v/context-keeper.git
cd context-keeper
npm install
npm test

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors