{"slug": "nudge-a-collaborative-memory-layer-for-claude-code-and-codex-cli-hooks", "title": "Nudge – a collaborative memory layer for Claude Code and Codex CLI hooks", "summary": "Nudge, a collaborative memory layer for Claude Code and Codex CLI hooks, has been released to help AI agents remember coding conventions, workflow preferences, and debugging lessons. The tool intercepts agent operations to enforce rules, rewrite commands, and inject context, improving agent focus and consistency. Nudge is available for macOS, Linux, and Windows, with installation via curl or PowerShell.", "body_md": "Nudge is a collaborative memory layer for Claude Code and Codex CLI hooks. It remembers the coding conventions, workflow preferences, and repo-local debugging lessons that agents should use while they work.\n\nWrite the reminder once. Let Nudge deliver it at the moment an agent is about to write a file, run a command, fetch a URL, or start a turn.\n\nAgents do better work when they can focus on the actual task instead of holding every project preference in working memory. Nudge moves those preferences into small, testable rules and learned notes:\n\n- Rules catch deterministic conventions before an operation lands.\n- Bash substitutions rewrite simple command mistakes automatically.\n- Prompt reminders add project context when a user asks for something specific.\n- Learned incident notes keep future agents from rediscovering old debugging fixes.\n`nudge check`\n\nbrings the same file-rule enforcement to CI and scripts.\n\nNudge is direct by design. A good message says what is wrong, how to fix it, and that the agent should retry.\n\nInstall:\n\n```\ncurl -sSfL https://raw.githubusercontent.com/attunehq/nudge/main/scripts/install.sh | bash\n```\n\nRelease binaries support macOS, Linux, and Windows x64. BM25 learned-note search is always available. Local semantic embeddings are included on Apple Silicon macOS and x64 GNU Linux; Intel macOS, musl Linux, arm64 GNU Linux, and Windows GNU builds omit local semantic embeddings.\n\nWindows PowerShell:\n\n```\nirm https://raw.githubusercontent.com/attunehq/nudge/main/scripts/install.ps1 | iex\n```\n\nSet up hooks in a project. Run the setup command for the agent you use, or both commands if you use both agents:\n\n```\nnudge claude setup\nnudge codex setup\n```\n\nAdd a `.nudge.yaml`\n\n:\n\n```\nversion: 1\nrules:\n  - name: no-unwrap\n    message: 'Use `.expect(\"descriptive error message\")` instead of `.unwrap()`, then retry.'\n    on:\n      - hook: PreToolUse\n        tool: Write\n        file: \"**/*.rs\"\n        content:\n          - kind: Regex\n            pattern: \"\\\\.unwrap\\\\(\\\\)\"\n      - hook: PreToolUse\n        tool: Edit\n        file: \"**/*.rs\"\n        new_content:\n          - kind: Regex\n            pattern: \"\\\\.unwrap\\\\(\\\\)\"\n```\n\nRestart open agent sessions, then use Claude Code or Codex CLI normally. Run\n`/hooks`\n\nin the agent to verify setup. After a useful debugging session, ask the\nagent to use `nudge-learnings`\n\nto record durable repo-local learnings for future\nwork; Claude setup also installs a `nudge:learn`\n\nslash command for this\nworkflow.\n\n[User Guide](/attunehq/nudge/blob/main/docs/user-guide.md): install, setup, rule examples, learned notes, agent behavior, and troubleshooting.[Developer Guide](/attunehq/nudge/blob/main/docs/developer-guide.md): architecture, local development, tests, dogfooding, live-agent testing, and PR expectations.[CI and Programmatic Checks](/attunehq/nudge/blob/main/docs/ci.md): using`nudge check`\n\nin CI, pre-commit hooks, and scripts.\n\nThe bundled `nudge`\n\nskill is the agent-facing rule reference. The bundled\n`nudge-learnings`\n\nskill is the proactive debugging-memory workflow for searching,\napplying, and recording repo-local learned incident notes.\n\nCopyable starter rules live in [examples/rules](/attunehq/nudge/blob/main/examples/rules).\n\nNudge watches supported hook surfaces:\n\n`PreToolUse`\n\nfor file writes/edits, Bash, and WebFetch where the provider exposes them.`UserPromptSubmit`\n\nfor prompt-time context.- Codex\n`apply_patch`\n\ninputs, normalized into Write/Edit/Delete where possible.\n\nWhen a rule or learned note matches, Nudge returns one of these outcomes:\n\n| Outcome | Meaning |\n|---|---|\n| Passthrough | Nothing matched, so the agent continues silently. |\n| Continue | Prompt-time context is injected into the conversation, including prompt-matched learned notes. |\n| Interrupt | A tool call is blocked with a rule message and snippet. |\n| Substitute | A deterministic Bash command is rewritten and allowed. |\n| Warning | An operation is allowed with model-visible context, such as PreToolUse learned-note context or an uninspectable Codex patch warning. |\n\nRules are loaded from user-level config, `.nudge.yaml`\n\n, `.nudge.yml`\n\n, and YAML\nfiles under `.nudge/`\n\n. Learned notes are plain Markdown files under\n`.nudge/learned/`\n\n.\n\nRules are best for deterministic conventions. Learned notes are for incidents: what went wrong, how it was fixed, and how the fix was verified.\n\n```\nnudge learn add --title \"Expo Metro resolver cache\" --body \"What went wrong: Expo could not resolve modules after a dependency update.\n\nFix: clear the Metro cache and restart the dev server.\n\nVerification: expo start completed and the app loaded.\"\n\nnudge learn search expo metro cannot resolve module\nnudge learn list\n```\n\nBM25 search is always available. Projects can opt into local semantic retrieval:\n\n```\nnudge learn embeddings enable\nnudge learn embeddings status\n```\n\nSetup installs the bundled `nudge`\n\nand `nudge-learnings`\n\nskills so agents know\nhow to respond to hook messages, write or debug rules, wire CI checks, and\nsearch, apply, or record repo-local learnings. Setup does not edit project\n`CLAUDE.md`\n\nor `AGENTS.md`\n\nfiles.\n\nBuild and test:\n\n```\ncargo build -p nudge\ncargo test -p nudge\ncargo clippy -p nudge --all-targets --all-features -- -D warnings\n```\n\nSee the [Developer Guide](/attunehq/nudge/blob/main/docs/developer-guide.md) for the full development and\nlive-agent dogfood workflow.", "url": "https://wpnews.pro/news/nudge-a-collaborative-memory-layer-for-claude-code-and-codex-cli-hooks", "canonical_source": "https://github.com/attunehq/nudge", "published_at": "2026-06-14 18:50:12+00:00", "updated_at": "2026-06-14 19:12:00.660563+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "ai-tools", "large-language-models", "ai-infrastructure"], "entities": ["Nudge", "Claude Code", "Codex CLI", "attunehq", "macOS", "Linux", "Windows"], "alternates": {"html": "https://wpnews.pro/news/nudge-a-collaborative-memory-layer-for-claude-code-and-codex-cli-hooks", "markdown": "https://wpnews.pro/news/nudge-a-collaborative-memory-layer-for-claude-code-and-codex-cli-hooks.md", "text": "https://wpnews.pro/news/nudge-a-collaborative-memory-layer-for-claude-code-and-codex-cli-hooks.txt", "jsonld": "https://wpnews.pro/news/nudge-a-collaborative-memory-layer-for-claude-code-and-codex-cli-hooks.jsonld"}}