Nemp Memory — Prompt Files (Verbatim Excerpts)
Excerpt 1: /nemp:init Command — Project Stack Detection
Source: commands/init.md
Prompting technique: Tool-constrained automation with explicit token budget rules. The command instructs Claude to perform the entire detection in a single bash call and read only package.json, preventing the common anti-pattern of reading many files.
# /nemp:init
Intelligently scan your project and auto-save context as memories.
## Instructions
You are an intelligent project analyzer. Scan the current project to detect its stack, then save the findings as Nemp memories.
### Step 1: Lightweight Scan (Token Optimized)
**IMPORTANT: Use minimal token consumption. Only read essential files. Run ONE combined check.**
```bash
echo "=== FILES ===" && ls package.json tsconfig.json next.config.* vite.config.* nuxt.config.* astro.config.* svelte.config.* angular.json requirements.txt pyproject.toml Cargo.toml go.mod Gemfile docker-compose.* Dockerfile .env .env.local .env.example 2>/dev/null && echo "=== LOCKFILE ===" && ls package-lock.json yarn.lock pnpm-lock.yaml bun.lockb 2>/dev/null && echo "=== DIRS ===" && ls -d app pages src/app components/ui 2>/dev/null
DO NOT run multiple separate file-existence checks. One command, all checks.
Step 2: Read package.json ONLY (if exists)
IMPORTANT: This is the ONLY file you need to read for detection. DO NOT read README.md, .env files, or scan directories.
[ -f "package.json" ] && cat package.json
## Excerpt 2: `/nemp:save` Command — Token Compression Rules
Source: `commands/save.md`
**Prompting technique**: Compression contract — the LLM must compress stored values before writing, with explicit examples of before/after. This reduces stored token footprint by ~70% while preserving technical terms.
```markdown
### 2. Compress Value (Token Optimization)
**IMPORTANT: Always compress the value before storing to minimize token usage.**
Apply these compression rules:
- Remove filler words: "basically", "essentially", "the thing is", "it's worth noting"
- Remove redundant phrases: "in order to" → "to", "due to the fact that" → "because"
- Collapse whitespace and trim
- Keep under 200 characters when possible — summarize longer values to their essential facts
- Preserve all technical terms, file paths, package names, and version numbers exactly
**Example compressions:**
BEFORE: "We decided to use NextAuth.js for authentication because it integrates well with Next.js and supports multiple providers including Google and GitHub OAuth"
AFTER: "NextAuth.js auth with Google + GitHub OAuth providers"
BEFORE: "The database is PostgreSQL and we access it through the Prisma ORM which handles all our migrations and schema management"
AFTER: "PostgreSQL via Prisma ORM (migrations + schema)"
Excerpt 3: /nemp:save — Agent Identity Detection
Source: commands/save.md
Prompting technique: Runtime identity injection — the command instructs Claude to read its own agent name from an environment variable, enabling multi-agent attribution in memory records.
### 5. Detect Agent Identity
Determine who is saving this memory:
```bash
echo "${CLAUDE_AGENT_NAME:-main}"