Only responsible for, at AI session end, theminimal change snapshot. Does not save full prompts, conversations, or reasoning, and does not decide where content should be archived.
Customer-readable description
What this skill can do
- For Claude Code
SessionEndor Codexnotify, generate lightweight logs. - Deduplicate using git status, tracked diff, and untracked content hashes; continuously editing the same file still produces new snapshots.
- Preserve the customer's existing Codex notify command, and provide dry-run, installation check, and uninstall steps.
- Report old log count/size; by default does not automatically delete or rotate.
How customers use it
Provide the vault path, AI name, and desired log directory. The Agent first shows the user configuration snippets that will be modified; only after explicit customer consent does it merge and write. First do a manual dry-run, then trigger one real small change to verify.
Dependencies and installation
- Python 3 and Git are core dependencies; the shell wrapper requires POSIX bash.
- Recommended to install the entire
soia-pkm-vault@soiaplugin.
Private configuration:
~/.config/soia-skills/soia-pkm-log-agent-sessions/config.yml
SOIA_PKM_AGENT_SESSION_CONFIG_FILE=<custom-config-path>
Install the entire domain (Claude Code and Codex share the same domain plugin):
claude plugin marketplace add soia-team/soia-open-skills
claude plugin install soia-pkm-vault@soia
Install only this one skill:
npx skills add soia-team/soia-open-pkm-vault-skills -g -a '*' -s soia-pkm-log-agent-sessions -y
WorkBuddy 's loading unit is role-based experts rather than plugins,npx skills add -a '*' does not cover it, and it needs to be installed separately, see docs/install/workbuddy.md。
Private information and intermediate data
- By default logs only write time, agent, change count, statistics by top-level partition, and verification results; does not write diff, body text, prompt, event JSON, or environment variables.
- Deduplication state is in
$XDG_STATE_HOME/soia-pkm-log-agent-sessions/(or~/.local/state/...if absent), does not write.git, and is compatible with git worktree. - By default does not list individual file paths; only when the customer explicitly chooses
--include-pathsdoes it write git status paths.
Logs and completion receipt
The receipt includes whether configuration changed, whether the snapshot was written/deduplicated and skipped, the relative log directory, change count, status directory category, verification, and uninstall method.
Manual verification
python3 scripts/session_log.py --vault <vault-path> --agent Codex --dry-run
python3 scripts/session_log.py --vault <vault-path> --agent Codex
Default log directory:30_日志与思考/20_Agent工作日志/10_自动快照/<年>/<agent>/. Can be overridden with --log-dir or SOIA_SESSION_LOG_DIR ; the path must be inside the vault. The agent allows only safe slugs.--vault must be the Git worktree root; a subdirectory nested inside a larger repository will refuse to run, to avoid recording changes outside the vault.
Integration flow
For complete configuration snippets, merging, and uninstall rules, see references/session-log-setup.md. Hard gates:
- Modifying
.claude/settings.jsonor Codexconfig.tomlrequires explicit customer consent first. - Back up the original configuration first, and merge structurally; do not overwrite existing hook/notify.
- Paths use the real script absolute path after installation; do not write maintainer paths into the skill.
- Trigger twice: the first time should write a snapshot; the second time with no substantive changes should
deduplicated。 - Then edit the same tracked file; a new snapshot must be produced, proving deduplication includes content and not just filenames.
Boundaries and retention
- Does not do workbench/Inbox triage; turn to
soia-pkm-manage-vault-lifecycle。 - Does not do vault health checks or knowledge retrieval.
- Do not execute add/commit/push, and do not read git object contents into logs.
- Do not automatically delete old logs. When cleanup is needed, first output a preview of counts/sizes by month, then have the customer confirm separately.
- Fail explicitly when configuration is missing, vault is not a git repository, a path is out of bounds, or the agent is not a safe slug; hook calls may optionally swallow failures to avoid blocking the main tool, but installation acceptance must not ignore failures.
Acceptance
- Log frontmatter uses
tags: [Agent日志, 自动快照]。 - Status is not in
.git, and the worktree fixture can run. - Editing the content of the same path consecutively can produce different digests; no changes will be deduplicated.
- Logs contain no complete prompt/diff/body/event JSON/secret values.
- After configuration uninstallation, the original hook/notify remains intact.