{"draft":null,"from":2,"to":318,"files":[{"path":"client/src/hook.ts","added":17,"removed":4,"diff":"--- a/client/src/hook.ts\n+++ b/client/src/hook.ts\n@@ -16,11 +16,13 @@\n import { homedir } from \"node:os\";\n import { dirname, isAbsolute, join, resolve } from \"node:path\";\n import { Api, type News, newsLines } from \"./api.ts\";\n-import { AVCS_DIR, findRoot, isReader, readConfig } from \"./config.ts\";\n+import { findRoot, isReader, isVisitor, readConfig } from \"./config.ts\";\n import { editBody, newsContext, normalize, spellingText, uncomposedText } from \"./core.ts\";\n+import { fromEnv } from \"./env-names.ts\";\n import { forgetKnown, isPaused, loadIgnore, logNews, readKnown, readText, relativeTo, writeKnown } from \"./folder.ts\";\n import { tryFolderLock } from \"./lock.ts\";\n import { readKnownModes } from \"./modes.ts\";\n+import { stateDir } from \"./state-dir.ts\";\n \n /** The fields of Claude Code's PostToolUse input that the hook reads. */\n interface HookInput {\n@@ -42,6 +44,11 @@\n \n /** Where install-mod.ts puts the mod: Claude Code's skills folder, which every session loads. */\n export function modDir(env: Readonly<Record<string, string | undefined>> = process.env): string {\n+\treturn join(env.CLAUDE_CONFIG_DIR || join(homedir(), \".claude\"), \"skills\", \"abso-hooks\");\n+}\n+\n+/** Where the same mod lived before the rename. */\n+export function oldModDir(env: Readonly<Record<string, string | undefined>> = process.env): string {\n \treturn join(env.CLAUDE_CONFIG_DIR || join(homedir(), \".claude\"), \"skills\", \"avcs\");\n }\n \n@@ -58,7 +65,11 @@\n \t}\n \t// With the abso mod installed, every Claude Code session on this machine sends\n \t// its edits in-process, so this hook stands down rather than send them twice.\n-\tif (env.AVCS_HOOK_FORCE !== \"1\" && existsSync(join(modDir(env), \".claude-plugin\", \"plugin.json\"))) {\n+\tif (\n+\t\tfromEnv(env, \"HOOK_FORCE\") !== \"1\" &&\n+\t\t(existsSync(join(modDir(env), \".claude-plugin\", \"plugin.json\")) ||\n+\t\t\texistsSync(join(oldModDir(env), \".claude-plugin\", \"plugin.json\")))\n+\t) {\n \t\treturn { stdout: \"\", outcome: \"skipped: the abso mod sends edits\" };\n \t}\n \tconst tool = input.tool_name ?? \"\";\n@@ -80,13 +91,15 @@\n \t\t\toutcome = \"skipped: recording is paused (abso resume)\";\n \t\t} else if (isReader(root)) {\n \t\t\toutcome = \"skipped: this folder is a reader\";\n+\t\t} else if (isVisitor(root)) {\n+\t\t\toutcome = \"skipped: this folder reads signed out\";\n \t\t} else if (rel === undefined || loadIgnore(root)(rel, false)) {\n \t\t\toutcome = \"skipped: ignored path\";\n \t\t} else if (readKnownModes(root).get(rel)?.link != null) {\n \t\t\toutcome = \"skipped: a link (a file standing in for one); abso record sends links\";\n \t\t} else {\n \t\t\tconst config = readConfig(root, env);\n-\t\t\tconst timeout = Number(env.AVCS_HOOK_TIMEOUT_MS) || DEFAULT_TIMEOUT_MS;\n+\t\t\tconst timeout = Number(fromEnv(env, \"HOOK_TIMEOUT_MS\")) || DEFAULT_TIMEOUT_MS;\n \t\t\tconst api = new Api(config, timeout);\n \t\t\tconst who = {\n \t\t\t\t...(input.session_id ? { session: input.session_id } : {}),\n@@ -189,7 +202,7 @@\n \n function log(root: string, line: string): void {\n \ttry {\n-\t\tappendFileSync(join(root, AVCS_DIR, \"hook.log\"), `${line}\\n`);\n+\t\tappendFileSync(join(stateDir(root), \"hook.log\"), `${line}\\n`);\n \t} catch {\n \t\t// Logging is best effort.\n \t}"}],"unmatched":[]}