The skill is the workflow you want an agent to follow when prior work may matter:
- Search local agent history with a focused query
- Inspect the cited event or session before relying on it
- Cite the
ctx_event_idorctx_session_idwhen retrieved history affects the answer
That behavior can be installed directly in Claude Code today. For other agents, use the prompt pattern below or the agent-specific setup page.
Claude Code
Add the ctx plugin marketplace, then install the skill:
/plugin marketplace add ctxrs/ctx
/plugin install ctx-agent-history-search@ctxTo verify it, open /plugins in Claude Code and confirm ctx-agent-history-search is installed. In a new task, ask Claude Code to “use the ctx agent history search skill”; it should begin by checking ctx status --json before searching.
See Claude Code for the full setup and handoff guidance.
Prompt pattern for other agents
Use this with any shell-capable coding agent:
Use ctx to search prior local coding-agent sessions before you answer or edit.
Run:
ctx search "<focused query>" --json
Inspect the best result:
ctx show event <ctx-event-id> --window 3
or:
ctx show session <ctx-session-id> --mode lite
If retrieved history affects your answer, cite the `ctx_event_id` or
`ctx_session_id` and include the ctx command you ran.Use a provider filter when you know where the prior work happened:
ctx search "release checklist" --provider codex --json
ctx search "auth redirect flow" --provider cursor --json
ctx search "migration failure" --provider pi --jsonAgent-specific setup
Each agent page keeps the provider-specific import command and the prompt shape for that harness.
| Agent | Setup | Full guide |
|---|---|---|
| Claude Code | /plugin install ctx-agent-history-search@ctx | Claude Code |
| Codex | ctx import --provider codex | Codex |
| Cursor | ctx import --provider cursor | Cursor |
| Pi | ctx import --provider pi | Pi |
| OpenCode | ctx import --provider opencode | OpenCode |
| Antigravity / Gemini | ctx import --provider antigravity or ctx import --provider gemini | Antigravity / Gemini |
| Copilot CLI | ctx import --provider copilot-cli | Copilot CLI |
| Factory AI Droid | ctx import --provider factory-ai-droid | Factory AI Droid |
What to ask for
Ask the agent for a short cited finding before it edits:
Search ctx for prior work on this area. Inspect the best event or session, tell
me which ctx ID you used, and explain whether that history changes your plan.If ctx does not return a useful result, the agent should say that and continue from the current repository state.