Skip to content

osbornecox/challenger-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

challenger-agent

An adversarial agent that challenges your AI agent session's reasoning.

The Problem

LLMs take the path of least resistance by design. They optimize for coherence, not correctness. Once an LLM picks a framing early in a conversation — "this is a performance problem", "we need to refactor this module" — it will defend and reinforce that framing for the rest of the session, even when the evidence points elsewhere.

This isn't a bug. It's how autoregressive generation works: each token is conditioned on everything before it. The longer the conversation, the deeper the rut. The agent builds a narrative, and then every new input gets absorbed into that narrative — confirming it, never breaking it.

You won't notice because the agent sounds confident. It gives you structured plans, clean code, reasonable explanations. Everything looks right. But the framing was set in turn 3, and by turn 40 you've built the wrong thing well.

The Challenger breaks the frame. It reads the full conversation history of another session, finds the point where the agent's narrative cracks under a context it cannot contain, and injects one precise challenge — not advice, not a review, but a fact or question that forces the agent to re-examine its assumptions.

How It Works

  ┌──────────────────────────┬──────────────────────────────┐
  │  Session A                │  Session B                   │
  │  Your AI agent            │  /challenge                  │
  │                           │                              │
  │  Working on task X...     │  "The agent frames this as   │
  │                           │   simple/complex. But the    │
  │                           │   real axis is reversible/    │
  │                           │   irreversible — and this    │
  │                           │   choice is irreversible."   │
  │                           │                              │
  │  📨 Challenge received:  │  You: inject it              │
  │  "Is this reversible?"   │                              │
  └──────────────────────────┴──────────────────────────────┘
  1. Work with your AI agent normally in Session A
  2. Open a second session (Session B)
  3. Type /challenge
  4. Pick the session you want to challenge from the list
  5. The Challenger reads the full history and generates a challenge
  6. You review it, then say "inject" to send it to Session A
  7. Session A receives the challenge and responds

Install

git clone https://github.com/osbornecox/challenger-agent.git
cd challenger-agent
./install.sh

The installer does everything:

  • Builds the TypeScript code
  • Links the challenger and challenger-dump CLI commands
  • Installs the /challenge skill for Claude Code
  • Sets up claude-peers-mcp for cross-session messaging

Requirements: Node.js 18+, Claude Code CLI, git.

After install: Restart any open Claude Code sessions to pick up the new MCP server.

Usage

Inside Claude Code (recommended)

Open a second Claude Code session and type:

/challenge

That's it. The skill will:

  1. Show you a list of recent sessions with the last agent message
  2. You pick one by number
  3. It reads the full conversation history
  4. Generates a challenge using the EXTRACT → DISPLACE → CHALLENGE method
  5. Asks if you want to inject it into the target session

From the terminal (standalone)

# List sessions
challenger-dump --list

# Dump full session history
challenger-dump <session-id>

# Interactive challenge loop (uses claude -p under the hood)
challenger

Note: The standalone CLI cannot inject into running Claude Code sessions. Use the /challenge skill for that.

The Challenge Method

EXTRACT   → What distinctions is the agent using?
            "It sees this as performance vs readability"

DISPLACE  → What distinctions is it BLIND to?
            "It's not seeing correctness vs speed-of-iteration"

CHALLENGE → One stone in the river
            "This optimization locks you into a schema that's
             impossible to migrate later. Is the 50ms worth it?"

The Challenger doesn't write reviews. It identifies the hidden framing axis the agent is stuck on, finds an alternative axis that reveals a blind spot, and throws one stone.

How injection works

The /challenge skill uses claude-peers-mcp to send messages between Claude Code sessions:

  1. Both sessions register as "peers" via the MCP server
  2. The Challenger calls list_peers to find the target session
  3. It calls send_message to deliver the challenge
  4. The target session receives it instantly

Supported Agents

Agent Status Notes
Claude Code Supported Full support: read history, inject via MCP
Codex Planned Adapter interface ready
Gemini CLI Planned Adapter interface ready
Cursor Planned
Aider Planned

Architecture

challenger-agent/
├── skill/
│   └── challenge.md        ← /challenge skill for Claude Code
├── src/
│   ├── cli.ts              ← Standalone CLI entry point
│   ├── dump.ts             ← Session list + history dump
│   ├── index.ts            ← Public API
│   ├── core/
│   │   ├── types.ts        ← Adapter interface
│   │   ├── challenger.ts   ← Interactive challenge loop (standalone)
│   │   ├── watcher.ts      ← Real-time session file watcher
│   │   └── formatter.ts    ← Terminal output formatting
│   └── adapters/
│       ├── index.ts        ← Adapter registry
│       └── claude.ts       ← Claude Code JSONL adapter
├── install.sh              ← One-command setup
├── package.json
├── tsconfig.json
└── LICENSE                 ← MIT

Adding an adapter

  1. Create src/adapters/your-agent.ts implementing the Adapter interface
  2. Register it in src/adapters/index.ts
  3. All commands work automatically

Manual install

If you prefer not to use the install script:

# Build
npm install
npm run build
npm link

# Install skill
cp skill/challenge.md ~/.claude/commands/challenge.md

# Install claude-peers-mcp
git clone https://github.com/louislva/claude-peers-mcp.git ~/claude-peers-mcp
cd ~/claude-peers-mcp && bun install
claude mcp add --scope user --transport stdio claude-peers -- \
  $(which bun) ~/claude-peers-mcp/server.ts

License

MIT

About

An adversarial agent that challenges your AI agent session's reasoning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors