/refocus, end-to-end — co-located context → a speed dial → de-duplicated GitLab cards on the owning project's board → work handled inside each project's own mind.
Every project directory carries co-located knowledge — a local CLAUDE.md, .claude/skills, .claude/agents, lifecycle hooks, and docs/context/*. That specialization is the whole point: the harness, tuned per project, is what lets an AI do good work there.
~/projects/CLAUDE.md#co-location
Everything downstream follows from this one invariant. The session-spawn people associate with /refocus is just the delivery vehicle that gets work into the right mind — not the point itself.
The /refocus skill is invoked when a change is needed in a different project. It packages the understanding and intent as a curated brief — recorded on the target project's GitLab board, to be worked on there. Three things fall out of that one move:
The work lands in the project that owns it — where its CLAUDE.md, skills, agents, and hooks are already loaded. The right mind, by construction.
The reasoning and outcome persist where the work lives. Future sessions inherit the full history just by cd-ing into the project.
Every cross-project ask becomes a tracked, human-reviewable work item on the target's board — not a chat message that dies with the session.
| Speed | Handler | Authority | Mechanism & closure | State |
|---|---|---|---|---|
--now(warm, default) | a fresh session spawned now, in this flow | subordinate — you orchestrate; returns a Result | spawn claude in the dest dir; does the work now | exists |
--later(cold) | the owning project's board, on its clock | sovereign — may accept / triage / reject | writes a de-duplicated GitLab issue on the target board — no spawn, no push | built |
--live(hot) | the target's already-running agent | sovereign peer | real-time agent-to-agent ask — admin→dev / dev→dev only, never dev→admin | reserved |
Example — mid-session in ib-gateway, you find a bug owned by mcp-ib-paper. --now spawns a fresh session in mcp-ib-paper and fixes it in-flow. --later files it on the mcp board for its owner's clock — no spawn. --live (reserved) would hand it to mcp's already-running agent to act immediately.
--later — cross-project findings, proven live.The motivating incident: a session in ib-gateway found a real order-placement bug owned by mcp-ib-paper — a different project. A is the wrong context to fix it. --later routes the finding to B's board and lets B triage on its own clock.
/refocus --later ~/projects/mcp/ib-paper \ --slug dual-listed-option-qualify \ --severity high \ --title "..." --body-file bug.md
No board id, no labels, no B-internals. Resolves B's GitLab project from its git remote.
inbox — labels enhancement::inbox, dedup::<hash>, severity::highFiled and verified end-to-end on 2026-07-08. This is the first real payload — the bug that started the whole design flowed through the thing the design built.
The consumer must run the work in the target project's directory, with a clean context. A Task/Agent sub-agent looks tempting but fails two disqualifying tests:
| Capability | Task sub-agent | Fresh spawned session |
|---|---|---|
| Skills · sub-sub-agents | ✓ full · ✓ (depth 5) | ✓ full · ✓ |
| Working directory | ✗ stuck in parent's cwd — can't run in the target project | ✓ runs in the target dir |
| Transcript storage | ✗ under the parent's session — reasoning orphaned | ✓ cwd-keyed → lands at the destination |
| SessionStart hooks | ✗ do not fire | ✓ fire — incl. project context auto-load |
Skills and recursion are non-differentiators — both have them. The decision turns on cwd + transcript + hooks, all of which the fresh session wins. refocus's existing lib/spawn-worker.sh already launches exactly this — the consumer reuses it.
An autonomous worker on the host can wander the whole filesystem. The same worker in a container can only touch what you mounted — the container is the blast-radius bound. Precedent exists (reviewboard, code-executor run claude-cli in Docker). But one rule decides whether the spawn is real or only looks clean:
| Mount | At path | Or else |
|---|---|---|
| Target project dir | exact host path | co-located context (CLAUDE.md, skills, docs/context) doesn't auto-load — worker is context-blind |
~/.claude/projects/<key> session store | host-backed, same path | transcript dies with the container — the reasoning-at-destination property breaks |
| skills · hooks (ro) · scoped secrets | same paths | no skills / no SessionStart / can't close the issue |
The elegant part: mount the project dir at its host path and cd there → that project's whole mind loads for free. "Passing in correct context" is mostly "mount the right directory." The trap is a container that spawns a "clean" session which is actually blind and orphaned.
Each task runs in a fresh session — no context bleed from unrelated work, no 200k-token transcript to wade through. The worker starts sharp, focused only on this item.
Because the worker runs in the project's cwd, it auto-loads that project's CLAUDE.md, docs/context/*, and conventions. The right mind is loaded by construction, not by hand.
A fresh session gets that project's skills, its hooks (SessionStart context-load, guards), its agents, and can spawn its own sub-sub-agents to depth 5. The specialized tooling is available where it belongs.
Containment cuts both ways: the worker is bounded (container = blast radius) and equipped (the project's whole harness). That pairing — isolated yet fully-tooled — is the payoff of routing work to co-located context instead of doing everything in one sprawling session.
Working in project A, you find a change that belongs to project B.
/refocus curates the intent into a brief. No B-internals needed.
--now spawns a fresh session in B; --later files a de-duplicated card on B's board.
B's own context does the work — its CLAUDE.md, skills, agents and hooks already loaded.
The card closes. The reasoning persists at the destination.
No message bus in the core path. The GitLab card is both the record and the queue — B's owner pulls it from their board on their own clock. Real-time push is Part 2, not a dependency.
The core works today with zero message bus: --later writes a card, B's owner picks it up. Part 2 buys latency, not capability — an always-on agent that reacts the moment a card lands.
The GitLab card is the single source of truth for state. Nothing in Part 2 replaces it.
A Matrix message announces "card X is ready." Push, not poll. It carries a reference, never state.
An always-on listener, or a manual local-pull drain when it's down. Both reconcile against GitLab.
Why Part 2, not core: the queue must outlive any consumer. A broken listener degrades to "pull the board by hand" — never a hard stop. Build the fallback first; the doorbell is an optimisation.
The design isn't speculative — the core already runs. The build order is dependency-first: the resilient manual path before the automation it backs up.
--later in refocus (branch)
filed + dedup verified live
manual consumer, spawns worker
bounded autonomous worker
Matrix-triggered, same drain
--nowonto the conduit, last
Building the fallback first means work already flows without the (historically fragile) listener — diagnosing and fixing the agents becomes optional, not blocking.
The GitLab-only record model — state on the card, the brief riding along as an attached artifact, no local file — erased a whole class of drift concerns (reconcile loops, stale records, GC). What remains:
| Concern / gap | Why it matters — explanation | Posture |
|---|---|---|
| Opt-in authz | Filing to another project's board needs Reporter there. And the one trust rule: block dev→admin --live (a lower tier commanding a higher-tier running agent). Same-tier and downward are fine. | build |
| Secret scrubbing | The brief is attached to the card for the worker to ingest — and it derives from the source transcript. It must be scrubbed of tokens/secrets before it lands on a shared board. | build |
| Mount discipline | A containerized worker preserves co-located context + reasoning-at-destination only if the project dir and the ~/.claude session store are mounted at host-identical paths. Easy to get subtly wrong — a "clean" spawn that's actually context-blind. | spec |
| Automated pickup (future) | A real-time Matrix listener is optional — --later works today by the owner pulling their board. If/when a listener is built, add a lightweight claim marker (race is low: it's listener or manual, not both). | future |
--live unbuilt | Token reserved for forward-compat; real agent-to-agent semantics deferred until the friction is real. | deferred |
None block the proven core. They are the tail of a single coherent design — to be tightened, and likely tweaked, as we deploy.