setup
Use when the user asks to set up, repair, or verify the installed MemHub host integration, especially Codex automatic capture, PreToolUse team rules, hook installation, or capture health. Installs the Codex user-hooks compatibility bridge idempotently while preserving unrelated hooks, then checks plugin authentication and reports the one required trust step.
소스 정보
- 저장소
- XTraceAI/xtrace-claude-plugin
- 최근 소스 활동
- 2026년 10월 5일 16:51
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
SKILL.md 표시 중
SKILL.md
소스 지침 · 읽기 전용 미리보기- name
- setup
- description
- Use when the user asks to set up, repair, or verify the installed MemHub host integration, especially Codex automatic capture, PreToolUse team rules, hook installation, or capture health. Installs the Codex user-hooks compatibility bridge idempotently while preserving unrelated hooks, then checks plugin authentication and reports the one required trust step.
- allowed-tools
- Bash
Set up the installed MemHub plugin's host integration. This skill configures
the plugin install; `/memhub:onboard` separately connects the current repo to
its agent brain.
Resolve `ROOT` as the ancestor of this skill file containing `scripts/`. Codex
sets `PLUGIN_ROOT`; Claude Code sets `CLAUDE_PLUGIN_ROOT`. Prefer those values,
then derive it from the skill path if needed.
Arguments: `$ARGUMENTS`
## Codex
Codex hook support depends on the host version. Current desktop builds can load
bundled plugin hooks; older CLI releases need the user-level compatibility bridge.
This build, from the Claude plugin directory, ships no Codex manifest; Codex
installs the `XTraceAI/agent-plugins` build, whose manifest points at
`hooks/codex-hooks.json`. Claude compatibility handlers must skip Codex
payloads. When the user bridge is installed,
bundled Codex handlers defer to it for matching events; the user handlers still
need review and trust. Do not install both production and staging plugins.
A projectless task may receive shell hook payloads containing the session directory
instead of the command's explicit `workdir`. Use a shell-quoted absolute
`cd <repo> && ...` prefix for repository shell calls, or start the task in the
repository. The plugin cannot reconstruct an omitted working directory. This
workaround enables command rules; session-start rules still require starting in
the repository.
Install the bridge:
```bash
python3 "$ROOT/scripts/setup_codex_hooks.py" install
```
The installer is idempotent. It merges four MemHub handlers into
`$CODEX_HOME/hooks.json` (default `~/.codex/hooks.json`), preserves unrelated
events and handlers, backs up a changed existing file, and installs a stable
trampoline that follows plugin version upgrades. It enables:
- `SessionStart`: rulebook posture rules and any plugin-upgrade notice, the
repo brain brief, and a capture-health warning — the same three scripts
Claude Code runs at session start;
- `PreToolUse`: the rulebook hook (which can deny the call);
- `PostToolUse`: the rulebook hook, artifact-link reminders, and PR-link recording after GitHub-touching shell
calls (GitHub MCP calls only through the bundled plugin hooks — the bridge's
matcher stays narrow so upgrading it needs no re-trust);
- `PostToolUse` + `Stop`: incremental session capture.
After installation, report installation and trust as separate states. Codex
deliberately does not let a plugin approve command hooks, and the setup script
cannot inspect or change that approval. Do not claim capture or team rules
are active until the user confirms the review is done.
Give these precise review instructions:
1. Restart Codex, then choose **Review hooks** at startup or open `/hooks`.
2. Review the single MemHub handler under each of `SessionStart`,
`PreToolUse`, `PostToolUse`, and `Stop`.
3. Trust only handlers whose source is `User config - ~/.codex/hooks.json` and
whose command contains `memhub_hook_bridge.py`.
If Codex reports more than four handlers awaiting review, the extras are not
from this installer. A user who trusted the earlier three-handler bridge is
asked once more after upgrading: the new `SessionStart` handler is the only
addition. Warn the user not to choose **Trust all** in that case.
Never describe this manual approval as automatable by MemHub.
For `$ARGUMENTS == --status`, run this and make no changes:
```bash
python3 "$ROOT/scripts/setup_codex_hooks.py" status
```
For `$ARGUMENTS == --remove`, run this and stop:
```bash
python3 "$ROOT/scripts/setup_codex_hooks.py" remove
```
## Authentication and health
After an install, check the hook credential without opening a browser:
```bash
CLAUDE_PLUGIN_ROOT="$ROOT" python3 "$ROOT/scripts/login.py" --status
```
If it reports `NOT LOGGED IN`, explain that the hook credential is separate
from the MCP connector login and run `/memhub:login` before calling setup
complete. Do not silently start a browser login.
Then run the local health check. On Codex:
```bash
echo '{}' | python3 "$ROOT/scripts/capture_health.py" --host codex --plugin-root "$ROOT"
```
On Claude Code and Cursor:
```bash
echo '{}' | CLAUDE_PLUGIN_ROOT="$ROOT" python3 "$ROOT/scripts/capture_health.py"
```
(It reads a hook payload from stdin; without the pipe it blocks on the tty.
Without `--host codex` it judges Claude Code's capture state, which on Codex
reports the wrong host's health — the same flags the bridge passes.)
No output is healthy. Relay any warning exactly enough that the user knows the
remedy. Finish with a compact status: hook bridge installed/current, hook trust
unverified or user-confirmed, plugin credential healthy or missing, and whether
the current repo still needs MemHub onboarding.
## Other hosts
Claude Code and Cursor load their bundled MemHub hooks natively, so never write
Codex's bridge into their config. On those hosts, only run the authentication
and health checks above. Cursor Teams/Enterprise policy can block unofficial
marketplaces before this skill is available; that is an admin installation
policy, not something this plugin should attempt to bypass.
GitHub에서 보기