# Session memory

> Session memory is an open-source agent skill for knowledge and memory. Keeps a project's session history, decisions and patterns in .claude/memory across. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/maxwell2732/claudecode-research-harness-workflow/tree/main/skills/session-memory
- **Repository:** https://github.com/maxwell2732/claudecode-research-harness-workflow
- **GitHub stars:** 42
- **License:** MIT
- **Skill name:** session-memory
- **Collection:** https://github.com/maxwell2732/claudecode-research-harness-workflow
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-12-03

## About

This skill keeps work history for a project in a .claude/memory folder so that a new session can pick up where the last one stopped. It maintains a per-session log with completed tasks, files generated and handoff items, a decisions file with a table of technology choices and reasons, a patterns file for recurring conventions, and a context.json holding project name, stack and current phase.

At session start the agent loads the context file, reads the previous session log, pulls recently edited file paths from an agent trace file using shell commands with jq, and summarizes open work. During the session it records decisions and patterns, and at the end it writes a summary and updates the context file. The skill also distinguishes shared entries (decisions and patterns, meant for Git) from local-only logs, and suggests a Stop hook for automatic summaries.

It expects Claude Code or Codex, with the session ID taken from the runtime environment or a session.json file. It is an internal sub-skill, so it is meant to be invoked by the parent session and memory workflows of the harness rather than for implementation or review tasks.

## When your agent uses it

> Internal sub-skill for cross-session handoff, durable learning, and memory persistence. Invoked by session/memory workflows only. Do NOT load for: implementation, review, ad-hoc notes, or SSOT editing.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/maxwell2732/claudecode-research-harness-workflow/tree/HEAD/skills/session-memory)
- [Asks for: Read, Write, Edit, Bash](https://github.com/maxwell2732/claudecode-research-harness-workflow/blob/HEAD/skills/session-memory/SKILL.md)
- [License: MIT](https://github.com/maxwell2732/claudecode-research-harness-workflow/tree/HEAD/skills/session-memory)

## Features

- **Session handoff log:** Records completed tasks, generated files and open items so the next session starts with context.
- **Decision records:** Keeps a table of technology choices with dates and reasons for later reference.
- **Learned pattern notes:** Stores project conventions such as naming, endpoint style and error handling.
- **Project context file:** Tracks project name, stack, current phase and last session time in a JSON file.
- **Agent trace lookup:** Uses shell commands to list files edited in recent agent activity.
- **Shared versus local split:** Separates entries meant for version control from logs better kept local.

## Good for

- Pick up yesterday's work and list the unfinished tasks
- Summarize what the project's stack and current phase are
- Record why a database or framework was chosen
- Write a handoff summary before ending a long session
- Look up past architectural decisions for this project

## Install

### Claude Code

This skill ships in the `claudecode-research-harness-workflow` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add maxwell2732/claudecode-research-harness-workflow
/plugin install claudecode-research-harness-workflow@claudecode-research-harness-workflow
```

Or copy only this skill to `~/.claude/skills/session-memory`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/maxwell2732/claudecode-research-harness-workflow.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/session-memory &&
cp -R "$tmp/skills/session-memory" ~/.claude/skills/session-memory &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/session-memory` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/session-memory` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/maxwell2732/claudecode-research-harness-workflow.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/session-memory &&
cp -R "$tmp/skills/session-memory" ~/.agents/skills/session-memory &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/session-memory` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/session-memory` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/maxwell2732/claudecode-research-harness-workflow.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/session-memory &&
cp -R "$tmp/skills/session-memory" ~/.cursor/skills/session-memory &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/session-memory` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/maxwell2732/claudecode-research-harness-workflow.git --path skills/session-memory
```

Or copy the folder to `~/.gemini/skills/session-memory` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/session-memory`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/maxwell2732/claudecode-research-harness-workflow.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/session-memory &&
cp -R "$tmp/skills/session-memory" ~/.copilot/skills/session-memory &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/session-memory` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/maxwell2732/claudecode-research-harness-workflow.git
```

Then copy `claudecode-research-harness-workflow/skills/session-memory` into your agent's skills folder as `session-memory`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It is allowed to use Read, Write, Edit and Bash, and it relies on the .claude/memory folder and an agent trace file in .claude/state. It has no bundled scripts.

### When does Session memory trigger?

It is marked as internal and invoked only by session or memory workflows, with phrases such as asking what was done last time or to continue from before. It should not be used for implementation, review, ad-hoc notes or SSOT editing.

### Which files does Session memory write?

It writes session-log.md, decisions.md, patterns.md and context.json under .claude/memory, and it reads agent-trace.jsonl from .claude/state.

### Which session ID does Session memory use?

In Claude Code it prefers the CLAUDE_SESSION_ID variable, in Codex the runtime session or thread ID, and otherwise a value from .claude/state/session.json or a datetime fallback.

### How do I install Session memory in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/session-memory to use it in all your projects, or to .claude/skills/session-memory in one project. Or install the claudecode-research-harness-workflow plugin, which includes it: /plugin marketplace add maxwell2732/claudecode-research-harness-workflow, then /plugin install claudecode-research-harness-workflow@claudecode-research-harness-workflow.

### Does Session memory run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Session memory?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Session memory?

The closest alternatives to Session memory are Memory sync, Claude mem, Memory, Close session and Remember.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Memory sync](https://ai-powered.com/skills/memory-sync): Memory sync is an open-source agent skill for knowledge and memory.
- [Claude mem](https://ai-powered.com/skills/claude-mem-smartworldarafath): Claude mem is an open-source agent skill for knowledge and memory.
- [Memory](https://ai-powered.com/skills/memory-maxwell2732): Memory is an open-source agent skill for knowledge and memory.
- [Close session](https://ai-powered.com/skills/close-session): Close session is an open-source agent skill for knowledge and memory.
- [Remember](https://ai-powered.com/skills/remember-ajyadav013-2): Remember is an open-source agent skill for knowledge and memory.
- [Compound memory](https://ai-powered.com/skills/compound-memory-protocol-zero-0): Compound memory is an open-source agent skill for knowledge and memory.
- [Persistent memory](https://ai-powered.com/skills/persistent-memory-aws-solutions): Persistent memory is an open-source agent skill for knowledge and memory.
- [Memory](https://ai-powered.com/skills/memory-chachamaru127-2): Memory is an open-source agent skill for knowledge and memory.

---
Source: https://ai-powered.com/skills/session-memory
