From agent-twin
Consult the user's persona twin from inside a working session without polluting this session's context. Pass any free-form question; the twin reads the behavior brief and the recent session transcript in its own sub-context, then responds in the user's first-person voice. Unlike /load_persona, the brief never enters this session's prompt.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-twin:consult_twinThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A sub-context twin you can ask anything without dragging persona shaping into the current working session. The skill dispatches the `twin-advisor` agent via the Task tool; the agent reads the brief and the recent transcript in its own context, replies in the user's voice, and the response comes back to the orchestrator as plain text. **The brief never enters this session's prompt.**
A sub-context twin you can ask anything without dragging persona shaping into the current working session. The skill dispatches the twin-advisor agent via the Task tool; the agent reads the brief and the recent transcript in its own context, replies in the user's voice, and the response comes back to the orchestrator as plain text. The brief never enters this session's prompt.
This is the deliberate complement to /load_persona:
/load_persona | /consult_twin | |
|---|---|---|
| Scope | persists for the whole session | one Task dispatch, then gone |
| Side effect | every reply afterward is persona-shaped | nothing in this session changes |
| When to use | starting a working session you want to be persona-aware end-to-end | you only need the twin's take at one moment |
The two are orthogonal. The user can have neither, either, or (in principle) both — /consult_twin does not call /load_persona internally and never will.
/consult_twin <free-form question>
A single free-form string. No flags, no modes. The owner explicitly chose the simplest possible interface ("越無腦越好"). Mode (advisor vs. curious) is inferred from the question shape — see Step 4.
Run a single Bash command to expand $HOME and derive the brief path:
DATA_ROOT="$(bash -c 'echo $HOME')/.claude/agent-twin/personalized"
BRIEF_PATH="$DATA_ROOT/results/profile/behavior_brief.md"
All subsequent operations use the resolved absolute paths.
If the file at BRIEF_PATH does not exist, surface exactly one line and stop:
No persona profile found. Run
/run_pipelineon a captured session first.
Do not attempt to dispatch the agent without a brief — the agent has nothing to read.
Claude Code writes the active session's JSONL under ~/.claude/projects/<encoded-project-path>/. The encoding rule is: every path separator becomes - (so D:\agent-twin → D--agent-twin, /home/user/proj → -home-user-proj). Verify on this machine before assuming:
ls "$(bash -c 'echo $HOME')/.claude/projects/" | head
Pick the directory entry that matches the current working directory under that encoding.
Then glob *.jsonl inside that directory and pick the newest by mtime — the active session writes to its file continuously, so the most recently modified JSONL is almost always the current session:
ENCODED="$(pwd | sed 's#[/\\:]#-#g')"
PROJECTS_DIR="$(bash -c 'echo $HOME')/.claude/projects/$ENCODED"
TRANSCRIPT="$(ls -t "$PROJECTS_DIR"/*.jsonl 2>/dev/null | head -n1)"
If no transcript is found (unusual configuration, brand-new session before first turn flushes), proceed with SESSION_TRANSCRIPT_PATH empty. Advisor mode still works on the brief alone.
This is a soft heuristic. If the result is wrong, the cost is small (the user just rephrases). Future agents editing this SKILL: feel free to refine the prefix list as patterns emerge.
Set MODE=curious if the question (case-insensitive, after stripping leading whitespace and punctuation) starts with one of:
research, explore, let's look at, let's research, help me understand, i want to learn about, i want to understand, what should i research, what should i learn about, tell me about (when paired with an unfamiliar-domain noun phrase — soft signal only)研究, 探索, 了解, 學習, 想了解, 想學, 幫我了解, 想研究Otherwise set MODE=advisor. Default is advisor. When uncertain, choose advisor — it's the more useful failure mode.
Use the Task tool with subagent_type="twin-advisor". Build the prompt as a structured key-value block so the agent can parse it robustly:
BRIEF_PATH=<absolute path from Step 1>
SESSION_TRANSCRIPT_PATH=<absolute path from Step 3, or empty>
MODE=<advisor|curious from Step 4>
QUESTION=<the user's question verbatim>
The description parameter for the Task call should be a short label like Twin consultation: <first 50 chars of question>. The agent's tools are Read only — it cannot write or run commands; it just reads, thinks, and responds.
When the agent returns, print its response to the user without any preamble. Do not say "Here's what your twin says:" or "The twin responded:". The agent already speaks in first-person; let it land directly.
After the response, on a new line, append exactly:
(Consulted via twin-advisor — response did not enter this session's prompt context.)
This is the integrity confirmation: the user wanted assurance that contamination did not happen. Always include it.
/load_persona. The two are orthogonal; the whole point is sub-context isolation.behavior_brief.md itself. The agent reads it; the SKILL only checks existence./run_pipeline./load_persona./show_persona./run_meta_critic.$HOME resolved via Bash; all paths used were absolutebehavior_brief.md was reported with the standard one-line message and execution stopped~/.claude/projects/<encoded-cwd>/ was located, or empty was passed if not foundtwin-advisor was dispatched via the Task tool with the four-key prompt block/load_persona was madeCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub ctongh/agent-twin --plugin agent-twin