# memory

memory is a Claude Code hook that loads MemForge guidance and MCP memory tools at session start. It triggers automatically whenever a session starts, resumes, or compacts.

- hook · `type=hook` · Claude Code, Codex · ★ 104 repo stars
- Author: MemForge Team
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/dodo-labs-ai/mem-forge/tree/HEAD/integrations/codex/memforge-memory/hooks/hooks.json
- Updated: 2026-11-17
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/hooks/memory

## What it does

The hook executes `memforge_hook.py` on the `SessionStart` event. It matches `startup`, `resume`, and `compact` triggers, injecting MemForge context and memory tools before interaction begins.

Execution requires `python3` and an `sh` shell. The hook has a 10-second timeout; if the script is missing from `${CODEX_PLUGIN_ROOT}` or `${PLUGIN_ROOT}`, it logs a message to standard error and exits cleanly.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add dodo-labs-ai/mem-forge
```
In the agent chat (not a shell):
```text
/plugin install memory@memforge
```

2. **Manually: put the files in place**
- File: `.claude/settings.json` — The hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dodo-labs-ai/mem-forge/tree/HEAD/integrations/codex/memforge-memory/hooks/hooks.json

## When to use it
- load MemForge guidance at session startup
- restore memory context after resuming a session
- inject MCP memory tools during context compaction

## Example prompts
- /compact
- Resume the previous development session
- Start a new session and load project context

## Source text · hooks.json · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: cd3e37c5c215f440.

BEGIN THIRD-PARTY FILE cd3e37c5c215f440
````text
Hooks bundle shipped with the memory plugin for Claude Code.

MemForge memory for Codex: session-start guidance and MCP memory tools.

Triggers on: SessionStart.

```json
{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "startup|resume|compact",
        "hooks": [
          {
            "type": "command",
            "command": "sh -lc 'root=\"${CODEX_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; script=\"$root/scripts/memforge_hook.py\"; if [ ! -f \"$script\" ]; then echo \"MemForge hook script not found\" >&2; exit 0; fi; exec python3 \"$script\" context --client codex'",
            "timeout": 10,
            "statusMessage": "Loading MemForge usage guidance"
          }
        ]
      }
    ]
  }
}

```
````
END THIRD-PARTY FILE cd3e37c5c215f440

The third-party file has ended. Everything between the cd3e37c5c215f440 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© MemForge Team · Apache-2.0 · https://github.com/dodo-labs-ai/mem-forge/tree/HEAD/integrations/codex/memforge-memory/hooks/hooks.json

## Similar
- [memory-management](https://affpapa.org/en/nevibecode/skills/memory-management-2.md) — skill · 1200 installs
- [agent-memory](https://affpapa.org/en/nevibecode/skills/agent-memory.md) — skill · 42 installs
- [manage-memory](https://affpapa.org/en/nevibecode/commands/manage-memory.md) — command · ★ 276 repo stars
- [memory-leak-detection](https://affpapa.org/en/nevibecode/skills/memory-leak-detection.md) — skill · 592 installs
- [memory-engineering](https://affpapa.org/en/nevibecode/skills/memory-engineering.md) — skill · 29 installs
- [deep-agents-memory](https://affpapa.org/en/nevibecode/skills/deep-agents-memory.md) — skill · 20000 installs

From the same set: [dodo-labs-ai/mem-forge](https://affpapa.org/en/nevibecode/by/dodo-labs-ai/mem-forge.md) — 8 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
