codex-agentmemory-windows

SKILL运维和基础设施
运维和基础设施 未标注权限 许可证不明确
安装这个技能

Configure, repair, and validate agentmemory integration for Codex App on Windows. Use when Codex needs to set up agentmemory hooks, fix Windows PowerShell hook failures, create an agentmemory-hook.cmd wrapper, update ~/.codex/hooks.json and trusted_hash entries, fix missing Codex additionalContext memory injection, repair stale/frozen agentmemory knowledge graph updates, backfill graph nodes/edges, or troubleshoot Codex App agentmemory MCP/hook configuration.

一句话选型结论

按资料字段整理

codex-agentmemory-windows是运维和基础设施类的 Agent Skill,安装方式未标注,权限级别未标注,许可证不明确,有可直接复制的安装命令。技能本质是给模型读的说明书,效果取决于模型与客户端;装完先用一个小任务验证,再放进正式流程。

分类运维和基础设施 安装方式未标注 权限级别未标注权限 许可证许可证不明确
累计安装 未标注 本周 未标注
GitHub 星标 未标注 仓库 未标注
下载量 未标注 技能市场下载数
权限级别 未标注权限 安装前请确认风险范围
许可证 许可证不明确 未说明

安装

未标注
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
skillhub install user_15292d5a/yjkj-codex-agentmemory-windows
  1. 1
    确认客户端支持

    确认你的客户端支持 Skills(Claude、Codex、Cursor 等),并升级到较新的版本。

  2. 2
    拿到技能文件

    执行上面的命令安装;也可以把仓库里的 SKILL.md 手动放进客户端的 skills 目录。

  3. 3
    刷新技能列表

    重新打开客户端,或刷新技能列表,让新放进来的技能被加载。

  4. 4
    验证是否生效

    问一句「你有哪些技能」,确认列表里出现它,再拿一个小任务试跑。

技能档案

运维和基础设施
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方user_15292d5a仓库 未标注 · 版本 未标注
宿主客户端未标注技能可被这些客户端加载
安装方式未标注安装包 community
权限级别未标注权限安装前请确认风险范围
许可证未说明许可证不明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验未标注上游最后核验时间 · 数据更新 1791714404
正文体量12.3 KBSKILL.md 原文大小,越大说明说明书写得越细

典型使用场景

3 类
按分类整理的常见用法,具体以 SKILL.md 为准
查服务与日志

按现象定位服务状态与日志线索。

写部署与巡检脚本

把重复的部署、巡检写成脚本。

故障排查

按步骤排查网络、依赖与配置。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有可直接复制的安装命令,不用自己翻文档找入口。

先想清楚的地方

  • 没有标注权限级别,实际能做什么要装好后确认。
  • 许可证不明确,商用或二次分发前先到仓库确认条款。
  • 没有做站内核验,内容以作者仓库为准。
  • 技能只是说明书,实际效果取决于模型与客户端,装完先用小任务试一遍。

更适合

  • 需要在运维和基础设施场景里给模型补一套做法的人。
  • 愿意先读一遍 SKILL.md、确认它会让模型做什么的人。

不太适合

  • 对许可证要求很严、必须明确可商用的人。
  • 只想装完就自动变强、不打算看说明书的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
codex-agentmemory-windows当前 未标注权限 未标注 未标注 未标注 有
Azure 部署 调用外部服务 GitHub 仓库 664.2 万 Codex、Claude、Cursor 有
Azure diagnostics 问题管理 调用外部服务 GitHub 仓库 657.6 万 Codex、Claude、Cursor 有
Azure aigateway 部署 调用外部服务 GitHub 仓库 655.3 万 Codex、Claude、Cursor 有
Azure AI 搜索 调用外部服务 GitHub 仓库 651.4 万 Codex、Claude、Cursor 有
Azure Cloud migrate 部署 调用外部服务 GitHub 仓库 650.7 万 Codex、Claude、Cursor 有

SKILL.md 全文

12.3 KB
模型实际读到的说明书原文,来自技能仓库

Codex Agentmemory Windows

Goal

Set up agentmemory for Codex App on Windows with PowerShell-safe hook commands, Codex-native memory injection, stable data paths, working Stop finalizers, healthy knowledge graph updates, and repeatable validation. Prefer the bundled scripts for deterministic repair.

Quick Repair

Run the helper when the user wants an automatic fix:

python scripts/configure_agentmemory_windows.py --codex-home "$env:USERPROFILE\.codex"

Use these options when needed:

python scripts/configure_agentmemory_windows.py --secret "<agentmemory-secret>"
python scripts/configure_agentmemory_windows.py --url "http://localhost:3111" --secret "<agentmemory-secret>"
python scripts/configure_agentmemory_windows.py --preserve-other-hooks
python scripts/configure_agentmemory_windows.py --absolute-data-dir "$env:USERPROFILE\data"
python scripts/configure_agentmemory_windows.py --patch-codex-scratch-context
python scripts/configure_agentmemory_windows.py --skip-injection-patch
python scripts/configure_agentmemory_windows.py --dry-run

The script backs up changed files, creates agentmemory-hook.cmd, writes Windows-safe hook commands, updates Codex hook trust hashes, configures the agentmemory MCP section, patches hook scripts to emit Codex additionalContext JSON, filters Codex Desktop background suggestion sessions, optionally pins agentmemory's data store to an absolute path, and validates the hook commands.

After repair, rerun with --dry-run; it should print only environment/path information and no would update: lines. If hooks.json was edited manually, treat any trusted-hash drift as a configuration repair, not a one-line hash tweak: rerun the helper so hooks.json, config.toml, wrapper paths, and patched hook scripts stay aligned.

Knowledge Graph Repair

Use this when the viewer graph is tiny, stale, or frozen even though observations/summaries keep growing.

First inspect without changing files:

python scripts/repair_agentmemory_graph_windows.py --dry-run

Then apply the full repair:

python scripts/repair_agentmemory_graph_windows.py --all --restart-service

The graph repair script:

  • patches every discovered stop.mjs so Codex Stop finalizes the session, checks server-side GRAPH_EXTRACTION_ENABLED, and posts graph/extract in small batches;
  • patches installed dist\index.mjs so graph-extract remaps edges from temporary extracted node IDs to persisted node IDs after node deduplication;
  • backs up mem%3Agraph%3Anodes.bin and mem%3Agraph%3Aedges.bin before writing backfill data;
  • backfills a deterministic graph from existing compressed observations using file/concept/title metadata instead of expensive full LLM extraction;
  • validates via /agentmemory/graph/stats after import.

Default backfill settings are intentionally conservative: --min-importance 5 --max-files 2 --max-concepts 3. Raise or lower them only when the user explicitly wants a denser or smaller graph.

Manual Workflow

  1. Inspect %USERPROFILE%\.codex\hooks.json, %USERPROFILE%\.codex\config.toml, and %USERPROFILE%\.codex\agentmemory-hook.cmd.
  2. Locate the installed agentmemory plugin root, usually %USERPROFILE%\.codex\plugins\cache\agentmemory\agentmemory\<version>.
  3. Locate node.exe; prefer an absolute path from Get-Command node.exe, C:\Program Files\nodejs\node.exe, or Codex bundled node.exe.
  4. Read AGENTMEMORY_SECRET and AGENTMEMORY_URL from existing config or environment. Do not hardcode another user's secret.
  5. Create a wrapper at %USERPROFILE%\.codex\agentmemory-hook.cmd:
@echo off
set "AGENTMEMORY_URL=http://localhost:3111"
set "AGENTMEMORY_SECRET=<secret>"
set "AGENTMEMORY_INJECT_CONTEXT=true"
if "%~1"=="" exit /b 2
"C:\Path\To\node.exe" "C:\Path\To\agentmemory\scripts\%~1"
exit /b %ERRORLEVEL%
  1. Write hook commands through cmd.exe, not direct quoted PowerShell invocation:
cmd.exe /d /s /c ""C:\Users\<user>\.codex\agentmemory-hook.cmd" session-start.mjs"
  1. Use this event-to-script map:
Codex hook event Script
PreToolUse pre-tool-use.mjs
PostToolUse post-tool-use.mjs
SessionStart session-start.mjs
UserPromptSubmit prompt-submit.mjs
Stop stop.mjs
PreCompact pre-compact.mjs
  1. Update config.toml [hooks.state.'...\hooks.json:<event_key>:0:0'] entries with enabled = true and trusted_hash = "sha256:<sha256 of exact command string>".
  2. Disable duplicated plugin-provided hooks under agentmemory@agentmemory:hooks/hooks.codex.json if the global hooks.json wrapper is used.
  3. Patch session-start.mjs, prompt-submit.mjs, and pre-tool-use.mjs so any injected memory is returned as Codex hook JSON:
{
  "hookSpecificOutput": {
    "hookEventName": "SessionStart",
    "additionalContext": "<agentmemory-context>...</agentmemory-context>"
  },
  "suppressOutput": true
}

Use hookEventName: "UserPromptSubmit" for prompt-submit.mjs and hookEventName: "PreToolUse" for pre-tool-use.mjs. Raw <agentmemory-context> text on stdout is not enough for reliable Codex App injection.
11. If starting agentmemory from different working directories can create multiple ./data stores, edit each installed dist\iii-config.yaml so state_store.db and stream_store use absolute paths such as %USERPROFILE%\data\state_store.db and %USERPROFILE%\data\stream_store.
12. For graph updates, patch stop.mjs to query /agentmemory/config/flags instead of trusting Codex process env vars, then call /agentmemory/graph/extract in batches after /agentmemory/session/end.
13. Patch service-side graph-extract if needed so merged nodes update edge source/target IDs before edge persistence.
14. Validate by piping sample hook JSON into every command through PowerShell and requiring exit code 0.

Missing Injection Checklist

Use this when capture and summaries work but new conversations do not receive memory:

  1. Confirm agentmemory status shows nonzero observations or memories and AGENTMEMORY_INJECT_CONTEXT is enabled.
  2. Call the context endpoint or session-start.mjs manually. If it returns a non-empty <agentmemory-context>, agentmemory has data and the remaining issue is Codex hook delivery.
  3. Inspect the newest %USERPROFILE%\.codex\sessions\YYYY\MM\DD\*.jsonl. A successful injection appears as a developer message containing <agentmemory-context ...>.
  4. If manual hook output is raw XML/text but the JSONL has no developer context message, patch the hook scripts to use hookSpecificOutput.additionalContext.
  5. If a new Codex scratch folder like %USERPROFILE%\Documents\Codex\YYYY-MM-DD\hi-3 gets empty context while hi-2 has memory, patch the agentmemory service bundle so mem::context matches the daily Codex scratch root instead of exact session.project === data.project.
  6. If agentmemory status suddenly shows 0 observations or memories after restart, check for accidental data stores under the current workspace or package directory and pin iii-config.yaml to an absolute data directory.

Duplicate Session Checklist

Use this when Codex App shows one visible conversation but agentmemory shows many sessions with the same title:

  1. Inspect recent sessions. If repeated firstPrompt starts with # Overview Generate 0 to 3 hyperpersonalized suggestions..., these are Codex Desktop background recommendation jobs, not duplicate user chats.
  2. Treat this as capture noise: the hook is recording every Codex session-like run, including hidden background jobs.
  3. Patch prompt-submit.mjs to detect that exact prompt prefix, record the session id in a temp ignore file, call /agentmemory/forget for the pre-created background session, and return without observing.
  4. Patch pre-tool-use.mjs, post-tool-use.mjs, stop.mjs, and pre-compact.mjs to skip any session id in that temp ignore file.
  5. Add a service-side fallback in installed @agentmemory/agentmemory/dist/src-*.mjs and dist/index.mjs: mem::observe should ignore this prompt pattern and delete the pre-created session; /agentmemory/session/start should also ignore the pattern if it arrives as a title.
  6. Restart agentmemory after service-bundle changes.
  7. Do not delete old repeated sessions automatically. Ask the user first, then use /agentmemory/forget for sessions whose prompt clearly matches the background suggestion pattern.

Codex Scratch Project Matching

agentmemory v0.9.x may match session context by exact project path. Codex App often creates per-chat scratch folders under:

%USERPROFILE%\Documents\Codex\YYYY-MM-DD\<chat-folder>

For shared daily scratch context, patch mem::context in the installed agentmemory service bundle (dist\src-*.mjs and dist\index.mjs) to:

  • normalize Windows paths case-insensitively and slash-insensitively;
  • treat the same %USERPROFILE%\Documents\Codex\YYYY-MM-DD parent as one context root;
  • include semantic memories only when their fact text contains the current project leaf hint, to avoid injecting unrelated project facts.

The helper applies this with --patch-codex-scratch-context when the installed bundle still has the original exact-project matcher.

Why This Fixes Windows Hook Errors

PowerShell treats "C:\path\agentmemory-hook.cmd" as a string. If arguments follow it directly, PowerShell can fail with Unexpected token 'session-start.mjs'. The stable Windows form is either:

& "C:\path\agentmemory-hook.cmd" session-start.mjs

or, more robust for Codex hook runners:

cmd.exe /d /s /c ""C:\path\agentmemory-hook.cmd" session-start.mjs"

Use the cmd.exe form in hooks.json.

Validation Commands

Use this after manual edits:

$payload = '{"session_id":"test","cwd":"C:\\Temp","prompt":"test"}'
$hooks = Get-Content "$env:USERPROFILE\.codex\hooks.json" -Raw | ConvertFrom-Json
foreach ($event in $hooks.hooks.PSObject.Properties.Name) {
  $cmd = $hooks.hooks.$event[0].hooks[0].command
  $payload | powershell.exe -NoProfile -Command $cmd
  Write-Host "$event exit=$LASTEXITCODE"
}

All events should return exit=0.

For injection-specific verification, parse hook stdout as JSON and check:

$payload = '{"session_id":"test","cwd":"C:\\Temp","hook_event_name":"SessionStart"}'
$out = $payload | & "$env:USERPROFILE\.codex\agentmemory-hook.cmd" session-start.mjs
$json = $out | ConvertFrom-Json
$json.hookSpecificOutput.additionalContext

If this contains <agentmemory-context, open a fresh Codex conversation and confirm the newest session JSONL has a developer message containing the same tag.

For graph-specific verification:

Invoke-WebRequest -Uri "http://localhost:3111/agentmemory/graph/stats" -UseBasicParsing |
  Select-Object -ExpandProperty Content

If totalNodes and totalEdges stay unchanged across multiple content-rich sessions, run:

python scripts/repair_agentmemory_graph_windows.py --dry-run

Then apply with --all --restart-service only after checking the dry-run delta.

Common Non-Blocking Warnings

Do not confuse these with hook command failures:

  • Shell snapshot not supported yet for PowerShell: Codex shell snapshot limitation, not an agentmemory hook failure.
  • chatgpt authentication required for remote plugin catalog: remote plugin sync warning, not local hook execution.
  • GitHub API rate limit exceeded: curated plugin sync warning, not agentmemory hook execution.
  • resources/list or resources/templates/list unknown for agentmemory MCP: MCP capability warning, not hook capture failure.

Upgrade Warning

Upgrading or reinstalling @agentmemory/agentmemory can overwrite patched stop.mjs and dist\index.mjs. After an upgrade, rerun:

python scripts/repair_agentmemory_graph_windows.py --dry-run --patch-hooks --patch-service

If it reports pending patches, run the same command without --dry-run and restart agentmemory.

常见问题

5 问
答案由本站依据条目字段整理
codex-agentmemory-windows怎么安装?

在支持 Skills 的客户端里执行:skillhub install user_15292d5a/yjkj-codex-agentmemory-windows。安装方式为未标注。装完刷新技能列表或重开客户端。

codex-agentmemory-windows支持哪些客户端?

资料没有标注宿主客户端,但只要客户端支持 Skills(Claude、Codex、Cursor 等),一般都能加载。

codex-agentmemory-windows权限高吗,安全吗?

权限级别为未标注权限。安装前先看它会读取或写入哪些内容。

codex-agentmemory-windows收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于技能本身和所用的模型或客户端,正式使用前按作者说明确认。

codex-agentmemory-windows用什么许可证?

许可证标注为 未说明(许可证不明确)。商用或二次分发前请到仓库确认条款原文。

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 未标注。