Persistent session continuity for the Gemini CLI.
Gemini Workspace History is a Gemini CLI extension designed to provide continuity between AI-assisted coding sessions within a specific workspace. It solves "context amnesia" by automatically restoring the latest technical summary at the start of every session and archiving transcripts at the end.
- Context Restoration: Automatic injection of the latest session summary (
active-context.md) into the current context. - Session Archiving: Automatic Gzip compression of session transcripts for long-term history.
- Controlled Exit: Custom
close-workspacecommand ensures a high-quality summary is generated before closing. - Workspace Summarizer Skill: A dedicated skill to assist in generating and managing session summaries.
- Local Storage: All history (summaries, compressed transcripts, and active context) is kept within the project's
.gemini-workspace-history/directory.
To use this extension in your project, link it to your Gemini CLI:
gemini extension link .- Start: When you start a new session (
gemini), theon-start.jshook identifies the latest summary and preparesactive-context.md. - Work: The Gemini CLI automatically loads
active-context.mdinto your session context. - End: Use the
/close-workspace(or your custom command name) to summarize your work and exit cleanly.
/close-workspace: Prompts the agent to write a structured technical summary of the current session and then saves it to.gemini-workspace-history/using standard tools before exiting. This is the recommended way to end a session to ensure continuity.
The extension maintains all its data in the .gemini-workspace-history/ directory:
active-context.md: The summary currently being injected into the session.session-YYYY-MM-DD-HH-mm.json.gz: Compressed session transcripts.summary-YYYY-MM-DD-HH-mm.md: Individual session summaries.
- Lifecycle Hooks:
SessionStart: Executeshooks/on-start.jsto prepare the active context from the most recent session summary and history.SessionEnd: Executeshooks/on-end.jsto archive the session transcript as a compressed Gzipped JSON file.
- Context Injection: The
gemini-extension.jsonmanifest is configured withcontextFileName: ".gemini-workspace-history/active-context.md", which the CLI uses to automatically include the file in every session. - Hooks Configuration: Lifecycle hooks are managed via
hooks/hooks.json. - Skills: Includes the
workspace-summarizerskill to help maintain session continuity.
To verify the extension's functionality and path resolution:
npm testThe project uses a strict versioning policy. Every PR must include a version bump, which is verified by the automated test suite.
To increment the patch version based on the latest git tag:
npm run bumpThis command will update both package.json and gemini-extension.json to the next patch version (e.g., 0.1.2 -> 0.1.3).