/nemp-pro-export
Experimental: Export Nemp memories to Codex CLI, Cursor, and Windsurf rule files
> /plugin marketplace add SukinShetty/Nemp-memory > /plugin install nemp@nemp-memory
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/nemp-pro-export
Context preview
What this command does when you run it.
Experimental: Export Nemp memories to Codex CLI, Cursor, and Windsurf rule files
Command definition
nemp-pro-export.mddescription: "Experimental: Export Nemp memories to Codex CLI, Cursor, and Windsurf rule files"
argument-hint: "[--codex | --cursor | --windsurf | --all | --status]"
/nemp:nemp-pro-export
> Experimental provider-export instructions, not a released Pro integration. This filename maps to `/nemp:nemp-pro-export` in the `nemp` plugin. Validate outputs in a disposable project and preserve existing rules. Cross-tool import is not implemented here.
Export project memories to AI tool rule files used by Codex CLI (AGENTS.md), Cursor (.cursor/rules/nemp-memory.mdc), and Windsurf (.windsurfrules). Uses `.nemp/memories.json` as the source for generated files. Verify that each host loads the resulting context; writing a file does not establish an end-to-end integration.
Usage
/nemp:nemp-pro-export --codex # Generate AGENTS.md for Codex CLI
/nemp:nemp-pro-export --cursor # Generate .cursor/rules/nemp-memory.mdc for Cursor
/nemp:nemp-pro-export --windsurf # Generate .windsurfrules for Windsurf
/nemp:nemp-pro-export --all # Generate all three + sync CLAUDE.md
/nemp:nemp-pro-export --status # Check which export files exist
Arguments
- `--codex` (optional): Export to `AGENTS.md` in project root (Codex CLI format)
- `--cursor` (optional): Export to `.cursor/rules/nemp-memory.mdc` (MDC frontmatter format)
- `--windsurf` (optional): Export to `.windsurfrules` in project root (plain markdown)
- `--all` (optional): Run all three exports and trigger CLAUDE.md sync
- `--status` (optional): Report which export files exist and their last modified timestamps
Instructions
When the user invokes `/nemp:nemp-pro-export`, follow these steps:
Step 1: Parse Arguments
Extract the subcommand from the user's input:
--codex → Export to AGENTS.md
--cursor → Export to .cursor/rules/nemp-memory.mdc
--windsurf → Export to .windsurfrules
--all → Run all three exports + CLAUDE.md sync
--status → Show export file status
(no args) → Show Usage block above and stop
If no argument is provided or the argument is unrecognised, display the Usage block above and stop.
---
Required write-safety preflight
These safeguards apply to **every** provider target and take precedence over the write steps below. An export request alone is not permission to replace existing user-authored rules.
1. Generate the proposed content in memory, then read each target before changing it. If an existing file cannot be read, stop for that target. Do not treat a read error as a missing file. 2. If a target is absent, it may be created. If it already contains exactly the proposed content, leave it unchanged. 3. If an existing target differs, show its exact path and a diff/summary of the content that would be removed or replaced. Ask for explicit overwrite approval. For `--all`, prepare all outputs and bundle the approval request for every existing target before making any writes. If approval is declined or unavailable, leave those files unchanged and report them as skipped. 4. Before any approved replacement, create a byte-for-byte backup at `<target>.nemp-backup-<UTC timestamp>` with a unique suffix if needed. Never overwrite a backup. Verify the backup matches the original; if creation or verification fails, leave the target unchanged and report the error. Backups can contain private rules and should not be committed by default. 5. Immediately before creating an initially absent target, check that it is still absent. If another process created it, stop and review it as an existing target instead of overwriting it. Re-read an existing target immediately before replacement. If it changed after review, stop and request review of the new diff rather than overwriting a concurrent edit. Then write only the approved content and verify the result. 6. Report files created, replaced (with backup paths), unchanged, skipped and failed separately. Do not announce that all exports completed if any target was skipped or failed. `/nemp:nemp-pro-export --status` remains read-only.
`CLAUDE.md` sync in `--all` continues to use the default Nemp-section update. Never add `--replace` implicitly. A background hook must stop when overwrite approval is needed; it may not bypass this preflight.
Memory Reading Logic (used by all export subcommands)
Before generating any export file, perform these steps to load and prepare memories. This logic is shared by `--codex`, `--cursor`, `--windsurf`, and `--all`.
Step 2: Read memories.json
Read `.nemp/memories.json` using the Read tool:
[ -f ".nemp/memories.json" ] && cat .nemp/memories.json
If the file does not exist, stop and show:
❌ No Nemp memories found. Run /nemp:init first.
To initialize: /nemp:init
To save a memory: /nemp:save <key> <value>
Step 3: Parse the Memories Array
The file uses the new array format:
{
"memories": [
{
"key": "version",
"value": "0.3.0",
"created": "2026-02-26T16:00:00.000Z",
"updated": "2026-02-26T16:00:00.000Z",
"projectPath": "C:/Users/...",
"agent_id": "nemp-init",
"tags": ["auto-detected"]
}
]
}**Backward compatibility:** Some older files store memories as a flat object (keys at the top level):
{
"stack": { "value": "Next.js", "created": "...", "updated": "..." },
"auth": { "value": "NextAuth", "created": "...", "updated": "..." }
}If the parsed JSON does not have a `memories` array, treat each top-level key as a memory entry, converting it to the array format internally:
key = the JSON key name
value = entry.value
created = entry.created
updated = entry.updated
type = entry.type (if present, else undefined)
vitality = entry.vitality (if present, else undefined)
confidence = entry.confidence (if present, else undefined)
Step 4: Filter Out Extinct Memories
Skip any memory where `vitality.state === "extinct"`. These memories are considered dead and must not app
Read more
description: "Experimental: Export Nemp memories to Codex CLI, Cursor, and Windsurf rule files" argument-hint: "[--codex | --cursor | --windsurf | --all | --status]"
/nemp:nemp-pro-export
> Experimental provider-export instructions, not a released Pro integration. This filename maps to `/nemp:nemp-pro-export` in the `nemp` plugin. Validate outputs in a disposable project and preserve existing rules. Cross-tool import is not implemented here.
Export project memories to AI tool rule files used by Codex CLI (AGENTS.md), Cursor (.cursor/rules/nemp-memory.mdc), and Windsurf (.windsurfrules). Uses `.nemp/memories.json` as the source for generated files. Verify that each host loads the resulting context; writing a file does not establish an end-to-end integration.
Usage
/nemp:nemp-pro-export --codex # Generate AGENTS.md for Codex CLI /nemp:nemp-pro-export --cursor # Generate .cursor/rules/nemp-memory.mdc for Cursor /nemp:nemp-pro-export --windsurf # Generate .windsurfrules for Windsurf /nemp:nemp-pro-export --all # Generate all three + sync CLAUDE.md /nemp:nemp-pro-export --status # Check which export files exist
Arguments
- `--codex` (optional): Export to `AGENTS.md` in project root (Codex CLI format)
- `--cursor` (optional): Export to `.cursor/rules/nemp-memory.mdc` (MDC frontmatter format)
- `--windsurf` (optional): Export to `.windsurfrules` in project root (plain markdown)
- `--all` (optional): Run all three exports and trigger CLAUDE.md sync
- `--status` (optional): Report which export files exist and their last modified timestamps
Instructions
When the user invokes `/nemp:nemp-pro-export`, follow these steps:
Step 1: Parse Arguments
Extract the subcommand from the user's input:
--codex → Export to AGENTS.md --cursor → Export to .cursor/rules/nemp-memory.mdc --windsurf → Export to .windsurfrules --all → Run all three exports + CLAUDE.md sync --status → Show export file status (no args) → Show Usage block above and stop
If no argument is provided or the argument is unrecognised, display the Usage block above and stop.
---
Required write-safety preflight
These safeguards apply to **every** provider target and take precedence over the write steps below. An export request alone is not permission to replace existing user-authored rules.
1. Generate the proposed content in memory, then read each target before changing it. If an existing file cannot be read, stop for that target. Do not treat a read error as a missing file. 2. If a target is absent, it may be created. If it already contains exactly the proposed content, leave it unchanged. 3. If an existing target differs, show its exact path and a diff/summary of the content that would be removed or replaced. Ask for explicit overwrite approval. For `--all`, prepare all outputs and bundle the approval request for every existing target before making any writes. If approval is declined or unavailable, leave those files unchanged and report them as skipped. 4. Before any approved replacement, create a byte-for-byte backup at `<target>.nemp-backup-<UTC timestamp>` with a unique suffix if needed. Never overwrite a backup. Verify the backup matches the original; if creation or verification fails, leave the target unchanged and report the error. Backups can contain private rules and should not be committed by default. 5. Immediately before creating an initially absent target, check that it is still absent. If another process created it, stop and review it as an existing target instead of overwriting it. Re-read an existing target immediately before replacement. If it changed after review, stop and request review of the new diff rather than overwriting a concurrent edit. Then write only the approved content and verify the result. 6. Report files created, replaced (with backup paths), unchanged, skipped and failed separately. Do not announce that all exports completed if any target was skipped or failed. `/nemp:nemp-pro-export --status` remains read-only.
`CLAUDE.md` sync in `--all` continues to use the default Nemp-section update. Never add `--replace` implicitly. A background hook must stop when overwrite approval is needed; it may not bypass this preflight.
Memory Reading Logic (used by all export subcommands)
Before generating any export file, perform these steps to load and prepare memories. This logic is shared by `--codex`, `--cursor`, `--windsurf`, and `--all`.
Step 2: Read memories.json
Read `.nemp/memories.json` using the Read tool:
[ -f ".nemp/memories.json" ] && cat .nemp/memories.json
If the file does not exist, stop and show:
❌ No Nemp memories found. Run /nemp:init first. To initialize: /nemp:init To save a memory: /nemp:save <key> <value>
Step 3: Parse the Memories Array
The file uses the new array format:
{
"memories": [
{
"key": "version",
"value": "0.3.0",
"created": "2026-02-26T16:00:00.000Z",
"updated": "2026-02-26T16:00:00.000Z",
"projectPath": "C:/Users/...",
"agent_id": "nemp-init",
"tags": ["auto-detected"]
}
]
}**Backward compatibility:** Some older files store memories as a flat object (keys at the top level):
{
"stack": { "value": "Next.js", "created": "...", "updated": "..." },
"auth": { "value": "NextAuth", "created": "...", "updated": "..." }
}If the parsed JSON does not have a `memories` array, treat each top-level key as a memory entry, converting it to the array format internally:
key = the JSON key name value = entry.value created = entry.created updated = entry.updated type = entry.type (if present, else undefined) vitality = entry.vitality (if present, else undefined) confidence = entry.confidence (if present, else undefined)
Step 4: Filter Out Extinct Memories
Skip any memory where `vitality.state === "extinct"`. These memories are considered dead and must not app
Nemp - The memory plugin for Claude Code that remembers everything.
Other commands on nemp.
auto-export
Experimental: Enable or disable automatic cross-provider memory export

