Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/en/docs/integrations/claude-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,12 @@ python3 "${CLAUDE_PLUGIN_ROOT}/scripts/workspace_scope.py" \
The resolver hashes the workspace path only as an external binding key. It never generates a Scope ID from a Git
remote or directory. Set an explicit Scope only when that separation or sharing is deliberate.

The workspace is the Git root, so the binding covers the checkout's subdirectories. A linked Git worktree that has no
workspace binding of its own uses its main checkout's binding, so a session started in such a worktree shares the
checkout's Scope. Bind inside the worktree to give it a separate Scope. Binding and clearing there change only the
worktree's own binding.
The workspace is the Git root, so the binding covers the checkout's subdirectories and uses the cross-host `shared`
workspace key (ahead of any legacy `claude-code` workspace key). Binding a checkout once therefore applies across every
PowerContext host on the machine, and clearing removes both the shared binding and Claude Code's legacy workspace
binding. A linked Git worktree that has no workspace binding of its own uses its main checkout's binding, so a session
started in such a worktree shares the checkout's Scope. Bind inside the worktree to give it a separate Scope. Binding
and clearing there change only the worktree's own binding.

## Use explicit Memory and Handoff operations

Expand Down
11 changes: 7 additions & 4 deletions docs/en/docs/integrations/codex.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,13 @@ uv run --frozen --quiet --project "$PLUGIN_ROOT" python "$PLUGIN_ROOT/scripts/sc

`$PLUGIN_ROOT` is the installed Codex plugin root, the same value the hooks use. In an ordinary terminal, replace it
with that directory, such as `powercontext/powercontext/<version>` in the plugin cache or
`integrations/codex/plugins/powercontext` in this repository. The command stores a binding with
`integration=codex` and `kind=workspace`. Its external id is the SHA-256 of the Git root path. It does not create a
Scope, and it does not derive a `scope_id` from the path, remote, or branch. Run the script again without
`--bind-scope` to print the Scope resolved for that directory. `--clear-scope` removes only that workspace binding.
`integrations/codex/plugins/powercontext` in this repository. The command stores a cross-host workspace binding with
`integration=shared` and `kind=workspace` (resolved ahead of any legacy `integration=codex` binding), so binding a
checkout once applies across every PowerContext host on the machine. Its external id is the SHA-256 of the real Git
root path. It does not create a Scope, and it does not derive a `scope_id` from the path, remote, or branch. Run the
script again without `--bind-scope` to print the Scope resolved for that directory, or pass `--diagnose` to inspect
which binding key matched. `--clear-scope` removes both the shared workspace binding and Codex's legacy workspace
binding for that checkout.

`POWERCONTEXT_CODEX_SCOPE_ID` still takes precedence. A Session that already started keeps the Session binding written
at startup. A new Session in that Git root uses the workspace binding when no explicit variable and no earlier Session
Expand Down
12 changes: 6 additions & 6 deletions docs/en/docs/integrations/dsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,12 @@ the complete `handoff` member, then pass that exact value to `mcp__powercontext_
`selection: "prepared"`. No preliminary Source capture is needed. In the separate low-level capture/activate/finalize
flow, pass activation's top-level `draft` to finalization and transfer the complete native finalization result unchanged.

The plugin resolves one Server-owned Scope in this order: `POWERCONTEXT_DSH_SCOPE_ID`, a durable binding for the
session workspace, then the Server default. The workspace path is hashed only as an external binding key. A missing
workspace therefore uses the Server default instead of the Harness process directory. In a linked Git worktree that
has no workspace binding of its own, the binding of the same directory in the main checkout applies, so a checkout's
binding also covers its linked worktrees. That fallback comes from the real path that Git reports, so it matches a
checkout binding made from a path without symlinks.
The plugin resolves one Server-owned Scope in this order: `POWERCONTEXT_DSH_SCOPE_ID`, the checkout's cross-host
`shared` workspace binding (real Git root path) ahead of DSH's legacy directory binding, then the Server default. The
workspace path is hashed only as an external binding key. A missing workspace therefore uses the Server default instead
of the Harness process directory. Binding a checkout once through `powercontext scope binding set <SCOPE_ID> --cwd <DIR>`
or another host's workspace helper applies in DSH across subdirectories and symlinks, and in a linked Git worktree that
has no workspace binding of its own, the main checkout's binding applies.

The plugin calls `POST /v1/context/prepare` once before the model analyzes the prompt, unless prompt recall is off.
Explicit `remember_memory` calls do not require a model.
Expand Down
12 changes: 7 additions & 5 deletions docs/en/docs/integrations/hermes.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ commands. Hermes 0.20.4 does not provide enough invocation context to route gate
companion rejects gateway invocations; use the provider's Hermes tools in gateway sessions.

The provider uses `http://127.0.0.1:8000` by default. The Server resolves an explicit Scope first, then durable session
and workspace bindings, and finally its default Scope. Hermes hashes the workspace path only as an external binding
key; it does not generate Scope IDs from profiles, users, repositories, or directories. In a linked Git worktree that
has no workspace binding of its own, resolution uses the binding of the same directory in the main checkout, so a
checkout's binding also covers its linked worktrees. A binding made in the worktree takes precedence, and binding or
clearing there changes only the worktree's own binding.
bindings, the checkout's cross-host `shared` workspace binding (real Git root path) ahead of Hermes's legacy directory
binding, and finally its default Scope. Hermes hashes the workspace path only as an external binding key; it does not
generate Scope IDs from profiles, users, repositories, or directories. Binding a checkout writes the `shared` workspace
key so every PowerContext host shares the Scope, while clearing removes both the shared binding and Hermes's legacy
binding. In a linked Git worktree that has no workspace binding of its own, resolution uses the main checkout's
binding; a binding made in the worktree takes precedence, and binding or clearing there changes only the worktree's own
binding.

## Configure the connection

Expand Down
4 changes: 2 additions & 2 deletions docs/en/docs/integrations/kimi-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ Open a new Kimi session after changing the installation mode. An explicit `--sco

The Hook, Scope script and doctor use the same Server resolution: explicit Scope, then the workspace binding, then the Server default. A missing or broken binding target fails resolution without client fallback or Scope creation. Explicit Scope resolution does not require a workspace key: `scope.mjs resolve` may omit `--cwd` in that mode. Workspace-mode resolution and all bind/unbind operations require an absolute working directory.

The binding key uses integration `kimi-code`, kind `workspace`, and SHA-256 of the absolute working directory after native real-path resolution; it contains no raw path. Existing directories share a binding across symlink/junction aliases and case variants recognized by the filesystem. On POSIX, symlinks are followed before interpreting subsequent `..` components; Windows uses its native path semantics. Use the Kimi session's working directory; subdirectories retain separate identities, without Git-root discovery. In a linked Git worktree, resolution tries the key of the same directory in the main checkout after the worktree's own key, so a checkout's binding also covers its linked worktrees until a worktree is bound itself; bind and unbind still write only the worktree's own key. If real-path resolution fails, the key uses the lexically normalized absolute path. Bind existing, accessible directories and bind again if their resolved identity changes. Session bindings are outside this integration's scope.
Workspace binding writes use the cross-host integration `shared`, kind `workspace`, and SHA-256 of the Git root's real path (or the working directory outside Git); resolution tries that `shared` key ahead of any legacy `kimi-code` directory key at both the current checkout and, in a linked Git worktree, its main checkout, while `unbind` removes both the `shared` key and Kimi's legacy key. It contains no raw path. Existing checkouts share a binding across subdirectories, symlink/junction aliases, and every PowerContext host on the machine; outside Git, subdirectories retain separate identities. On POSIX, symlinks are followed before interpreting subsequent `..` components; Windows normalizes drive-letter casing and extended-length prefixes after real-path resolution. In a linked Git worktree, a checkout's binding covers its linked worktrees until a worktree is bound itself; bind and unbind there change only the worktree's own keys. If real-path resolution fails on a missing trailing segment, symlinks on the deepest existing ancestor are resolved first. Bind existing, accessible directories and bind again if their resolved identity changes. Session bindings are outside this integration's scope.

Bind/unbind changes only that workspace's Server-owned binding. The JSON result keeps `binding` separate from subsequent resolution: a saved binding may be masked by an explicit Scope (`bound_scope_is_current: false`), or remain saved when resolution fails. An unconfirmed write stays `unknown` and is not retried automatically. Resolve again before claiming the active Scope changed.

For native MCP operations, use this request's Hook binding metadata or a successful read-only Scope-script result for the actual workspace; never infer a Scope from historical content. Doctor reports the current Scope ID and selection strategy (`explicit` or `workspace_or_default`); the latter does not assert which fallback matched.
For native MCP operations, use this request's Hook binding metadata or a successful read-only Scope-script result for the actual workspace; never infer a Scope from historical content. Doctor reports the current Scope ID, selection strategy (`explicit` or `workspace_or_default`), and `matched_key` (`shared:workspace`, `kimi-code:workspace`, or `default`).

## Select a workflow profile

Expand Down
11 changes: 6 additions & 5 deletions docs/en/docs/integrations/opencode.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ export POWERCONTEXT_OPENCODE_CAPTURE_PROMPTS=true
opencode
```

Each OpenCode session resolves an explicit `POWERCONTEXT_OPENCODE_SCOPE_ID`, its durable Session binding, its
workspace binding, then the Server default. The resolved Scope is fixed to the Session so resume keeps the same
boundary. In a linked Git worktree that has no workspace binding of its own, the binding of the same directory in the
main checkout applies, so a checkout's binding also covers its linked worktrees. That fallback comes from the real path
that Git reports, so it matches a checkout binding made from a path without symlinks. Set the explicit variable only to an existing Server-owned Scope.
Each OpenCode session resolves an explicit `POWERCONTEXT_OPENCODE_SCOPE_ID`, its durable Session binding, the
checkout's cross-host `shared` workspace binding (real Git root path) ahead of OpenCode's legacy directory binding,
then the Server default. The resolved Scope is fixed to the Session so resume keeps the same boundary. Binding a
checkout once through `powercontext scope binding set <SCOPE_ID> --cwd <DIR>` or another host's workspace helper
applies in OpenCode across subdirectories and symlinks, and in a linked Git worktree that has no workspace binding of
its own, the main checkout's binding applies. Set the explicit variable only to an existing Server-owned Scope.

For a Server using bearer authentication, supply its token while running setup, through the complete header in
`POWERCONTEXT_OPENCODE_AUTHORIZATION` or the token in `POWERCONTEXT_CLIENT_API_TOKEN`:
Expand Down
11 changes: 6 additions & 5 deletions docs/en/docs/integrations/pi.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ Eligible user prompts are captured separately as Content Sources. The package ne
transcript. Recall, capture, and boundary flushing fail open: an unavailable Server, timeout, redirect, or invalid
response leaves Pi's prompt unchanged and never blocks ordinary work.

The package resolves one Server-owned Scope in this order: `POWERCONTEXT_PI_SCOPE_ID`, a durable binding for the
workspace, then the Server default. The workspace path is hashed only as an external binding key; it never becomes a
Scope ID. In a linked Git worktree that has no workspace binding of its own, the binding of the same directory in the
main checkout applies, so a checkout's binding also covers its linked worktrees. That fallback comes from the real path
that Git reports, so it matches a checkout binding made from a path without symlinks. Keep the explicit variable unset unless the host must force one existing Scope.
The package resolves one Server-owned Scope in this order: `POWERCONTEXT_PI_SCOPE_ID`, the checkout's cross-host
`shared` workspace binding (real Git root path) ahead of Pi's legacy directory binding, then the Server default. The
workspace path is hashed only as an external binding key; it never becomes a Scope ID. Binding a checkout once through
`powercontext scope binding set <SCOPE_ID> --cwd <DIR>` or another host's workspace helper applies in Pi across
subdirectories and symlinks, and in a linked Git worktree that has no workspace binding of its own, the main checkout's
binding applies. Keep the explicit variable unset unless the host must force one existing Scope.

With these capabilities enabled, Pi satisfies the repository's Full core integration profile.

Expand Down
8 changes: 5 additions & 3 deletions docs/en/docs/integrations/workbuddy.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,11 @@ Later WorkBuddy sessions in the same workspace reuse that Scope. The `powerconte
operation persists the workspace binding in PowerContext. The workspace path is hashed only as an external binding
key; the plugin never derives a Scope ID from it.

The workspace is the Git root. A linked Git worktree that has no workspace binding of its own uses its main checkout's
binding, so a checkout's binding also covers its linked worktrees. Bind inside the worktree to give it a separate
Scope; binding and clearing there change only the worktree's own binding.
The workspace is the Git root and writes the cross-host `shared` workspace key (resolved ahead of any legacy `workbuddy`
workspace key), so binding a checkout once applies across every PowerContext host on the machine and clearing removes
both the shared binding and WorkBuddy's legacy binding. A linked Git worktree that has no workspace binding of its own
uses its main checkout's binding, so a checkout's binding also covers its linked worktrees. Bind inside the worktree to
give it a separate Scope; binding and clearing there change only the worktree's own binding.

## Connect to an authenticated local Server

Expand Down
12 changes: 7 additions & 5 deletions docs/en/docs/integrations/zcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,13 @@ The plugin reaches the same PowerContext Server through two paths:
`PreparedHandoff` to follow-up tools exactly, without omitting or inventing fields. Resolved content is marked
`untrusted_history` and should be checked against the current project state.

The Hook selects a Scope through `POWERCONTEXT_ZCODE_SCOPE_ID`, then current session binding, workspace binding, and
finally the Server default. A canonical Git-root or workspace path is hashed into an external binding key; the path
itself is not a Scope ID. A linked Git worktree that has no workspace binding of its own uses its main checkout's
binding, so a checkout's binding also covers its linked worktrees. Bind inside the worktree to give it a separate
Scope; `bind` and `unbind` there change only the worktree's own binding. For a remote workspace, set `POWERCONTEXT_ZCODE_REMOTE_WORKSPACE=true` and an existing
The Hook selects a Scope through `POWERCONTEXT_ZCODE_SCOPE_ID`, then current session binding, the checkout's cross-host
`shared` workspace binding (ahead of any legacy `zcode` workspace binding), and finally the Server default. A canonical
Git-root or workspace path is hashed into an external binding key; the path itself is not a Scope ID. Binding a checkout
writes the `shared` key so every PowerContext host shares the Scope, while `unbind` removes both the `shared` key and
ZCode's legacy key. A linked Git worktree that has no workspace binding of its own uses its main checkout's binding, so
a checkout's binding also covers its linked worktrees. Bind inside the worktree to give it a separate Scope; `bind` and
`unbind` there change only the worktree's own binding. For a remote workspace, set `POWERCONTEXT_ZCODE_REMOTE_WORKSPACE=true` and an existing
`POWERCONTEXT_ZCODE_SCOPE_ID` before launching ZCode, so the Hook skips local path inference. MCP tools still need
the correct Scope when called.

Expand Down
Loading