Skip to content

Qwen Code

ff hook qwen installs snapshot hooks and session briefings for Qwen Code.

Install

ff hook qwen

Activate

Restart Qwen Code to load the configuration. Ensure ff is on the client's PATH.

Verify

ff hook -l
ff doctor --no-fetch

These inspect installed files only. Confirm real capture with the capture-and-recovery check.

Files changed

The installer merges five nested hook events into ~/.qwen/settings.json. Unrelated settings and commands survive under the shared ownership rules. This installer supplies no skill.

$ ff hook qwen
qwen wired into ~/.qwen/settings.json

$ cat ~/.qwen/settings.json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "run_shell_command|write_file|replace|edit",
        "hooks": [
          {
            "type": "command",
            "command": "ff trigger qwen"
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "ff trigger qwen"
          }
        ]
      }
    ],
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "ff trigger qwen"
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "ff trigger qwen"
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "ff trigger qwen"
          }
        ]
      }
    ]
  }
}

PreToolUse attempts capture before run_shell_command, write_file, replace, or edit calls; UserPromptSubmit captures and delivers the briefing; SessionStart rebriefs after a new or resumed session; Stop captures the final edit of a turn; SessionEnd captures once more at the end. Qwen Code reads injected context from hookSpecificOutput.additionalContext, which is how the briefing arrives. It captures and tallies recognized Git writes but returns no pre-tool coaching or denial reply, including under strict policy.

Remove

ff unhook qwen removes the managed commands. Restart Qwen Code afterward.

$ ff unhook qwen
qwen removed from ~/.qwen/settings.json

$ cat ~/.qwen/settings.json
{}

Troubleshooting and migration

If capture is absent, check PATH, restart Qwen Code, and run the verification recipe. ff doctor --fix repairs partial or stale managed entries.

This adapter replaced Gemini CLI's. ff hook gemini and ff unhook gemini are unknown slugs now, and ~/.gemini/settings.json is never touched; entries an earlier fufu wrote there keep capturing, because ff trigger gemini still answers under the source gemini. Remove them by hand when Gemini CLI goes.