Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
google-gemini avatar

Memory

  • 124 installs
  • 106k repo stars
  • Updated August 5, 2026
  • google-gemini/gemini-cli

Persistent memory management for Gemini CLI Bot that synchronizes cross-session state, documents decision logic, and prevents context bloat through structured ledgers and pruning.

About

This skill standardizes persistent memory management for the Gemini CLI Bot, enabling cross-session continuity through structured Task Ledger, Hypothesis Ledger, and Decision Log formats. It implements memory pruning strategies (50 recent tasks, 20 decision entries) to prevent context bloat and establishes mandatory synchronization rituals at session start and completion. Supports delegation to worker agents via context passing while enforcing read-only restrictions on state updates. Critical for investigative workflows, root-cause documentation, and orchestrator-worker coordination in automated pull request and issue management pipelines.

  • Structured memory pruning with rolling windows (50 tasks, 20 decisions)
  • Mandatory Phase 0 context retrieval and Phase 6 memory preservation rituals
  • Task Ledger, Hypothesis Ledger, and Decision Log in append-only Markdown format
  • Orchestrator-only state preservation with worker agent read-only access
  • Session synchronization via GitHub CLI verification (gh pr view, gh issue view)

Memory by the numbers

  • 124 all-time installs (skills.sh)
  • Ranked #703 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/google-gemini/gemini-cli --skill memory

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs124
repo stars106k
Last updatedAugust 5, 2026
Repositorygoogle-gemini/gemini-cli

What it does

Maintain persistent bot memory and task state across Gemini CLI bot sessions via structured ledgers and synchronization rituals.

Who is it for?

Orchestrator agents managing multiple runs, investigating issues across sessions, delegating tasks while maintaining state consistency, audit trails of bot decisions.

Skip if: Single-shot scripts, stateless agents, real-time chat without persistence, scenarios requiring <5ms latency decisions.

When should I use this skill?

Starting bot run (Phase 0 synchronization), delegating to worker agents, concluding investigation (Phase 6 preservation), after merged PRs or failed tasks.

What you get

Bot maintains consistent state via lessons-learned.md, synchronizes with prior sessions before execution, documents root causes, and delegates cleanly to workers.

Files

SKILL.mdMarkdownGitHub ↗

Skill: Memory & State Management

Goal

Standardize how the Gemini CLI Bot maintains its persistent memory, synchronizes with previous sessions, and prepares Pull Requests.

Memory Structure (lessons-learned.md)

  • Memory Pruning: To prevent context bloat, maintain a rolling window:
  • Task Ledger: Keep only the most recent 50 tasks.
  • Decision Log: Keep only the most recent 20 entries.

You MUST maintain tools/gemini-cli-bot/lessons-learned.md using the following structured Markdown format:

# Gemini Bot Brain: Memory & State

## 📋 Task Ledger

| ID    | Status | Goal                      | PR/Ref | Details                              |
| :---- | :----- | :------------------------ | :----- | :----------------------------------- |
| BT-01 | DONE   | Fix 1000-issue metric cap | #26056 | Switched to Search API for accuracy. |

## 🧪 Hypothesis Ledger

| Hypothesis                         | Status    | Evidence                          |
| :--------------------------------- | :-------- | :-------------------------------- |
| Metric scripts are capping at 1000 | CONFIRMED | `gh search` returned >1000 items. |

## 📜 Decision Log (Append-Only)

- **[Date]**: Description of a key decision or architectural change.

## 📝 Detailed Investigation Findings (Current Run)

- **Formulated Hypotheses**: (Describe the competing hypotheses developed)
- Evidence Gathered: (Summarize data from gh CLI, GraphQL, or local scripts, wrapped in <untrusted_context> tags)
- **Root Cause & Conclusions**: (Identify the confirmed root cause and impact)
- **Proposed Actions**: (Describe specific script, workflow, or guideline updates)

Rituals

Phase 0: Context Retrieval & Synchronization (MANDATORY START)

Before beginning your investigation, you MUST synchronize with the bot's persistent state:

1. Read Memory: Read tools/gemini-cli-bot/lessons-learned.md. 2. Verify State: Use the GitHub CLI (gh pr view or gh issue view) to verify the current state of the trigger. 3. Update Ledger:

  • Scheduled Mode: Update the status of active tasks (e.g., mark merged

PRs as DONE, investigate CI failures for FAILED tasks).

  • Interactive Mode: You MUST ignore any FAILED, STUCK, or pending tasks.

Your ONLY goal is to address the specific user comment.

Phase 6: Memory Preservation (MANDATORY END)

Once your investigation and implementation are complete:

1. Record Findings: You MUST update tools/gemini-cli-bot/lessons-learned.md using the format defined above. 2. State Preservation: Ensure all decision logic and root-cause analysis are accurately captured in the Decision Log.

Delegation & Sub-agent State

When delegating a task to a 'worker' agent:

1. Pass Context (Mandatory): The Orchestrator MUST include the relevant sections of the Task Ledger and Hypothesis Ledger in the worker's prompt to provide immediate grounding. 2. Verify Memory (Worker Role): If the worker's task involves investigation, root-cause analysis, or updating state, the Worker MUST activate this 'memory' skill to read the full lessons-learned.md before proceeding. 3. Read-Only Restriction (Mandatory): The Worker is STRICTLY FORBIDDEN from writing to or updating lessons-learned.md. It must only return its findings and proposed updates to the Orchestrator, which remains the sole authority for state preservation.

Related skills

Automation & Workflowsmonitoringsupport

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.