Install
openclaw skills install @cutd/dongwoSet up, inspect, or maintain a local user-preference memory shared across coding agents such as Codex and Claude Code. Use only when the user explicitly asks to remember a preference, review or forget stored preferences, configure Dongwo lifecycle hooks, or maintain an existing Dongwo installation.
openclaw skills install @cutd/dongwoDongwo keeps one small, local preference memory that several coding agents can share. Lifecycle hooks screen each prompt in memory, keep only recognised preference statements as compact summaries, and inject a short context snapshot into later turns.
[!CAUTION] Enabling the hooks is an explicit opt-in. Once enabled, Dongwo screens every prompt automatically and records matching preference summaries without asking each time. It never stores the prompt itself: only a semantic key, an excerpt of at most 120 characters, a timestamp, the agent name, and a hashed session id. Prompts matching secret or sensitive-data rules are skipped entirely. Detection is rule-based and imperfect; review
档案.mdperiodically.
Everything lives in one user-level directory, $DONGWO_HOME
(default $XDG_DATA_HOME/dongwo, else ~/.local/share/dongwo):
ledger.jsonl — append-only preference summaries; the only source of truth.档案.md — generated readable view: status, active preferences, stable
observations, review queue, and recent evidence. Do not edit by hand.errors.log — created only if a hook fails.The injected context is computed on each turn and is not written to disk.
The engine refuses a data directory inside the project, so repository files
cannot inject memory. myprofile.md in the project root is optional and is
used only after explicit digest trust (below).
Current prompt > project instructions > trusted myprofile.md > active
preferences > stable observations.
myprofile.md, $DONGWO_HOME, or credentials.forget --apply, deleting files).$DONGWO_HOME (outside the project);myprofile.md in the project root, if present;~/.config/dongwo/profile-trust/, outside
the project);scripts/dongwo.py with python3 (3.9+, standard library
only, macOS/Linux);No network access, credentials, or elevated privileges are needed.
Before enabling, tell the user that preference summaries will be kept locally until they remove them. Do not enable hooks on the user's behalf.
Copy the engine to a stable location the user chooses, for example:
install -d -m 700 ~/.local/share/dongwo
install -m 755 scripts/dongwo.py ~/.local/share/dongwo/dongwo.py
Hooks run this copy, so later skill updates never change hook code silently. To upgrade, compare the files and copy again after review.
Show the user these snippets and let them merge and approve them.
Claude Code (.claude/settings.json):
{"hooks": {
"SessionStart": [{"matcher": "startup|resume|clear|compact", "hooks": [
{"type": "command", "command": "python3",
"args": ["/ABSOLUTE/PATH/dongwo.py", "hook", "--agent", "claude"], "timeout": 15}]}],
"UserPromptSubmit": [{"hooks": [
{"type": "command", "command": "python3",
"args": ["/ABSOLUTE/PATH/dongwo.py", "hook", "--agent", "claude"], "timeout": 15}]}]
}}
Codex (.codex/hooks.json): the same two events with
"command": "python3 /ABSOLUTE/PATH/dongwo.py hook --agent codex".
Replace /ABSOLUTE/PATH with the expanded engine location; hook arguments
are not shell-expanded.
Verify: python3 ~/.local/share/dongwo/dongwo.py doctor.
Hooks fail open: a memory error never blocks the user's task.
E=~/.local/share/dongwo/dongwo.py
python3 $E doctor # check layout, rebuild 档案.md
python3 $E load # print the context agents receive
python3 $E consolidate # rebuild 档案.md from the ledger
python3 $E capture --agent codex "以后默认使用中文回答。" # test capture
python3 $E forget output.language # preview rows for one key
python3 $E forget output.language --apply # delete them (ask first)
python3 $E migrate OLD_INBOX_DIR # preview import of a pre-1.1 inbox
python3 $E migrate OLD_INBOX_DIR --apply
migrate reads the old one-file-per-prompt inbox (<agent>/*.md), keeps only
recognised summaries, and never copies prompt text. Old files are left
untouched; deleting them is the user's decision.
Environment overrides: DONGWO_ROOT (project root), DONGWO_HOME (data
directory), DONGWO_PROFILE (profile path), DONGWO_TRUST_STORE.
Only after the user has reviewed the complete file:
python3 $E profile trust # preview
python3 $E profile trust --apply # bind trust to the current SHA-256
Only lines marked <!-- human:DATE --> are injected. Any later edit
invalidates trust until the user approves again.
When <dongwo-memory> is present, use confirmed and active items where
relevant, keep pending items out of answers, and follow the current prompt
when it conflicts with memory.