npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@mrtkrcm/acp-claude-code

v0.21.1

Published

ACP (Agent Client Protocol) bridge for Claude Code

Readme

ACP-Claude-Code Bridge

npm version Node.js Version Quality Score

Production-ready bridge connecting Claude Code to Zed editor via the Agent Client Protocol (ACP)

Quick Start

1. Setup

# Check system compatibility & get Zed configuration
npx @mrtkrcm/acp-claude-code --setup

# Test connection
npx @mrtkrcm/acp-claude-code --test

2. Authenticate Claude Code

claude setup-token

3. Add to Zed settings.json

{
  "agent_servers": {
    "claude-code": {
      "command": "npx",
      "args": ["@mrtkrcm/acp-claude-code"],
      "env": { "ACP_PERMISSION_MODE": "acceptEdits" }
    }
  }
}

Features

  • 🎯 Production Ready - 94/100 quality score, 60/60 tests passing, comprehensive error handling
  • ⚡ Enhanced ACP Compliance - 90% of full ACP specification implemented
  • 📍 Real-time File Tracking - Tool call locations enable "follow-along" in Zed editor
  • 📋 Execution Plans - Dynamic task plans with progress tracking for complex operations
  • 🔄 Rich Tool Output - File diffs, enhanced titles, and contextual formatting
  • 🧠 Agent Thoughts - Streaming internal reasoning for transparency
  • 🛡️ Advanced Permissions - Smart auto-approval with full ACP permission integration
  • 📊 Context Management - 200K token window with intelligent monitoring and warnings
  • 🔧 Enhanced UX - Setup wizard, connection testing, comprehensive diagnostics

Configuration

Permission Modes

| Mode | Description | Use Case | |------|-------------|----------| | default | Ask for every operation | Maximum safety | | acceptEdits | Auto-accept file edits | Recommended workflow |
| bypassPermissions | Allow all operations | Trusted environments |

Environment Variables

| Variable | Default | Description | |----------|---------|-------------| | ACP_PERMISSION_MODE | default | Permission behavior | | ACP_MAX_TURNS | 100 | Session limit (0 = unlimited) | | ACP_DEBUG | false | Enable debug logging | | ACP_LOG_FILE | none | Log to file | | ACP_PATH_TO_CLAUDE_CODE_EXECUTABLE | auto-detect | Custom Claude path |

Runtime Permission Switching

Change permissions mid-conversation with markers:

[ACP:PERMISSION:ACCEPT_EDITS]
Please refactor the authentication module

Troubleshooting

Common Commands

# System diagnostics (compatibility score)
npx @mrtkrcm/acp-claude-code --diagnose

# Permission help
npx @mrtkrcm/acp-claude-code --reset-permissions

# Debug mode
ACP_DEBUG=true npx @mrtkrcm/acp-claude-code

Common Issues

Authentication Error

claude setup-token

Non-TTY Environment

{ "env": { "ACP_PERMISSION_MODE": "acceptEdits" } }

Custom Claude Path

{ "env": { "ACP_PATH_TO_CLAUDE_CODE_EXECUTABLE": "/path/to/claude" } }

Context Window Warnings

  • At 80%: Consider shorter prompts or start new session
  • At 95%: Create new session to avoid truncation
  • Full context: Session automatically cleaned up

Advanced Configuration

Complete Zed Configuration

{
  "agent_servers": {
    "claude-code": {
      "command": "npx", 
      "args": ["@mrtkrcm/acp-claude-code"],
      "env": {
        "ACP_PERMISSION_MODE": "acceptEdits",
        "ACP_MAX_TURNS": "0",
        "ACP_DEBUG": "false"
      }
    }
  }
}

Using pnpm

{
  "agent_servers": {
    "claude-code": {
      "command": "pnpx",
      "args": ["@mrtkrcm/acp-claude-code"]
    }
  }
}

Development

Build from Source

git clone https://github.com/mrtkrcm/acp-claude-code-bridge.git
cd acp-claude-code-bridge
pnpm install && pnpm run build

Commands

pnpm run dev        # Hot reload development
pnpm run test       # Run test suite  
pnpm run validate   # Full validation (typecheck + lint + test)
pnpm run diagnose   # System diagnostics

Architecture

Zed Editor ←→ ACP Protocol ←→ Bridge ←→ Claude SDK ←→ Claude API

Enhanced Components (with advanced ACP features):

  • Agent (~850 lines) - Full ACP bridge with plans, locations, permissions
  • Diagnostics (361 lines) - System health and compatibility checking
  • Performance Monitor (314 lines) - Metrics collection and resource monitoring
  • Error Handler (216 lines) - Centralized error management
  • Types (180 lines) - Extended ACP type definitions with validation
  • Logger (156 lines) - Structured logging with buffer management

New Advanced Features:

  • Tool Location Tracking - Real-time file operations visible in IDE
  • 📋 Dynamic Execution Plans - Step-by-step progress for complex tasks
  • 🔄 Rich Tool Content - File diffs and enhanced formatting
  • 🧠 Agent Thought Streaming - Internal reasoning transparency
  • 🛡️ Smart Permission System - Context-aware security decisions

Quality Metrics

| Metric | Value | Status | |--------|-------|--------| | Quality Score | 94/100 | ✅ Excellent | | Test Coverage | 60/60 tests | ✅ 100% | | Type Safety | Strict TypeScript + Guards | ✅ Complete | | ACP Compliance | 90% of specification | ✅ Advanced | | Memory Management | Auto-cleanup + limits | ✅ Optimized | | Security | Enhanced permissions | ✅ Secure |

Session Management

  • Memory-Only Sessions - ACP-compliant session handling (no persistence)
  • Context Tracking - 200K token window with warnings at 80%/95%
  • Resource Management - Circuit breakers, memory monitoring, cleanup
  • Graceful Shutdown - Process signal handling and resource cleanup

License

MIT

Credits

Originally inspired by Xuanwo's foundational work. This project extends that vision with production-ready features, comprehensive testing, and streamlined architecture for the ACP-Claude-Code bridge ecosystem.


Need Help? Run npx @mrtkrcm/acp-claude-code --setup for guided configuration.