Agent History Search Skill

Teach coding agents to search local ctx history, inspect cited hits, and carry the ctx ID into their answer.

The skill is the workflow you want an agent to follow when prior work may matter:

  1. Search local agent history with a focused query
  2. Inspect the cited event or session before relying on it
  3. Cite the ctx_event_id or ctx_session_id when 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@ctx

To 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 --json

Agent-specific setup

Each agent page keeps the provider-specific import command and the prompt shape for that harness.

AgentSetupFull guide
Claude Code/plugin install ctx-agent-history-search@ctxClaude Code
Codexctx import --provider codexCodex
Cursorctx import --provider cursorCursor
Pictx import --provider piPi
OpenCodectx import --provider opencodeOpenCode
Antigravity / Geminictx import --provider antigravity or ctx import --provider geminiAntigravity / Gemini
Copilot CLIctx import --provider copilot-cliCopilot CLI
Factory AI Droidctx import --provider factory-ai-droidFactory 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.