ClaudeMods
☰
KO
● 0 명 접속 중 · 조회 0 회
후원프로젝트 제출
GitHub 저장소 · 작성자 tsanva

cc-discord-presence

Claude Code 플러그인으로 현재 세션을 Discord Rich Presence에 표시합니다. 프로젝트, git 브랜치, 모델, 세션 시간, context token 및 비용을 Claude Code hooks modules, statusline 통합 또는 JSONL fallback으로 보여 줍니다.

번역 완료

이 mod 소개

Clawd Code는 실시간 세션 정보를 Discord Rich Presence에 표시하는 Claude Code 플러그인입니다. 현재 프로젝트, git 브랜치, 활성 Claude 모델(Opus/Sonnet/Haiku 4.5), 경과 세션 시간, 현재 context token 크기 및 실시간 비용을 표시합니다. 데이터는 Claude Code 자체 수치를 읽는 번들 Claude Code hooks module, 이전 버전을 위한 statusline 통합, 또는 ~/.claude/projects 세션 파일을 파싱하고 가격표로 비용을 추정하는 JSONL fallback 순서로 가져옵니다. 플러그인 마켓플레이스(claude plugin marketplace add tsanva/cc-discord-presence)에서 설치하거나 Go 소스에서 빌드합니다. daemon은 로컬에서 실행되고 presence에는 Discord IPC를 사용하며 Discord 데스크톱 앱이 필요합니다. 데이터를 수집하지 않습니다.

설치

먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.

claude plugin marketplace add tsanva/cc-discord-presence
claude plugin install cc-discord-presence
원문 / README

Clawd Code - Discord Rich Presence for Claude Code

Show your Claude Code session on Discord! Display your current project, git branch, model, session time, token usage, and cost in real-time.

Platform Support

| Platform | Status | |----------|--------| | macOS (Apple Silicon) | ✅ Tested | | macOS (Intel) | ⚠️ Untested | | Linux (x64) | ⚠️ Untested | | Linux (ARM64) | ⚠️ Untested | | Windows (x64) | ✅ Tested | | Windows (ARM64) | ⚠️ Untested |

Note: macOS Intel and Linux should work but haven't been verified. Please report problems.

Windows users: Requires Git Bash (included with Git for Windows) for automatic plugin hooks. Alternatively, run the PowerShell scripts manually (scripts/start.ps1 and scripts/stop.ps1). WSL won't work as Discord runs on the Windows host.

Features

  • Session Time - Shows how long you've been coding with Claude
  • Project Name - Displays the current project you're working on
  • Git Branch - Shows your current git branch
  • Model Name - Shows which Claude model you're using (Opus 4.5, Sonnet 4.5, Haiku 4.5)
  • Context Size - Tokens in Claude's context window right now (cached tokens included)
  • Total Cost - Real-time cost tracking for your session

Installation

As a Claude Code Plugin (Recommended)

# Add the marketplace
claude plugin marketplace add tsanva/cc-discord-presence

# Install the plugin
claude plugin install cc-discord-presence@cc-discord-presence

That's it! The plugin will automatically start when you begin a Claude Code session and stop when you exit.

Updating

claude plugin marketplace update cc-discord-presence
claude plugin update cc-discord-presence@cc-discord-presence

Then start a new Claude Code session. The plugin's start script notices that the daemon in ~/.claude/bin/ is from an older release, stops it, downloads the matching one and starts it.

Upgrading from 1.0.4 or earlier: claude plugin update only replaces the plugin's own files. The daemon binary lives in ~/.claude/bin/ and, before 1.0.5, was downloaded once and never updated, so you may still be running the daemon from your first install. Updating to 1.0.5 fixes this automatically on your next session start. If Discord still doesn't show your project afterwards, delete ~/.claude/bin/cc-discord-presence-* and start a new session. If you had set up the statusline integration, it keeps working, but on current Claude Code it's no longer needed.

Manual Installation

# Clone and build
git clone https://github.com/tsanva/cc-discord-presence.git
cd cc-discord-presence
go build -o cc-discord-presence .

# Run manually
./cc-discord-presence

How It Works

The app reads session data from three sources, using the first one available:

1. Hooks Module (Zero Config, Most Accurate)

The plugin ships a Claude Code hooks module (hooks/register.ts) that writes the session's project, model, context size and cost to ~/.claude/discord-presence-module.json using Claude Code's own figures. It runs in the terminal, the Claude desktop app and IDE extensions on Claude Code versions with hooks module support, and needs no setup. It updates when a session starts, when you send a prompt, after each tool call, after each response, and clears its data when the session ends.

2. Statusline Integration (Older Claude Code Versions)

On Claude Code versions without hooks modules, you can configure the statusline integration for the same accuracy. On current versions it isn't needed.

3. JSONL Fallback

As a last resort, the app parses Claude Code's session files from ~/.claude/projects/. Cost is estimated from the model pricing table.

<a name="statusline-setup"></a>

Statusline Setup (Optional)

Only needed on Claude Code versions without hooks module support.

Automatic Setup (Recommended):

Run the setup script (requires jq):

# Find your plugin directory and run setup
~/.claude/plugins/cache/*/cc-discord-presence/*/scripts/setup-statusline.sh

Or if you have the repo cloned:

./scripts/setup-statusline.sh

The setup script will:

  • Copy statusline-wrapper.sh to ~/.claude/
  • Update your ~/.claude/settings.json automatically
  • Back up any existing statusline to ~/.claude/statusline.sh

Manual Setup: If you prefer, edit ~/.claude/settings.json:

{
  "statusLine": {
    "command": "~/.claude/statusline-wrapper.sh",
    "type": "command"
  }
}

Then copy scripts/statusline-wrapper.sh to ~/.claude/statusline-wrapper.sh.

Note: Restart Claude Code after setup for changes to take effect.

Verifying Your Setup

Check which data source is being used by viewing the daemon log:

cat ~/.claude/discord-presence.log

You'll see one of:

  • ✓ Found active session: project-name (using hooks module) - Best accuracy, no setup
  • ✓ Found active session: project-name (using statusline data) - Same accuracy, for older Claude Code versions
  • ✓ Found active session: project-name (using JSONL fallback) - Working, but cost is estimated; update Claude Code or set up the statusline

Discord Presence Display

┌─────────────────────────────────┐
│ Clawd Code                      │
│ Working on: my-project (main)   │
│ Opus 4.5 | 1.5M tokens | $0.1234│
│ 00:45:30 elapsed                │
└─────────────────────────────────┘

Requirements

  • Discord desktop app running
  • Claude Code installed
  • Go 1.25+ (only for building from source)

Building from Source

# Build for current platform
go build -o cc-discord-presence .

# Cross-compile for all platforms
mkdir -p bin
GOOS=darwin GOARCH=arm64 go build -o bin/cc-discord-presence-darwin-arm64 .
GOOS=darwin GOARCH=amd64 go build -o bin/cc-discord-presence-darwin-amd64 .
GOOS=linux GOARCH=amd64 go build -o bin/cc-discord-presence-linux-amd64 .
GOOS=linux GOARCH=arm64 go build -o bin/cc-discord-presence-linux-arm64 .
GOOS=windows GOARCH=amd64 go build -o bin/cc-discord-presence-windows-amd64.exe .

Token Pricing

Cost is calculated using current Claude API pricing (Dec 2025):

| Model | Input (per 1M tokens) | Output (per 1M tokens) | |-------|----------------------|------------------------| | Opus 4.5 | $15.00 | $75.00 | | Sonnet 4.5 | $3.00 | $15.00 | | Sonnet 4 | $3.00 | $15.00 | | Haiku 4.5 | $1.00 | $5.00 |

Advanced: Custom Discord App

By default, this uses a shared Discord application ("Clawd Code"). If you want to use your own:

  1. Go to Discord Developer Portal
  2. Click "New Application" and name it

    ⚠️ Note: Discord blocks trademarked names like "Claude Code"

  3. Set an app icon in "General Information" (this appears in Rich Presence)
  4. Copy the Application ID and update ClientID in main.go
  5. Rebuild the binary

Uninstallation

Plugin Removal

claude plugin uninstall cc-discord-presence@cc-discord-presence

Statusline Cleanup (if configured)

If you set up statusline integration, restore your original settings:

# Remove the wrapper script
rm ~/.claude/statusline-wrapper.sh

# Restore your original statusline in settings.json:
# Option 1: Point back to the default statusline.sh
jq '.statusLine.command = "~/.claude/statusline.sh"' ~/.claude/settings.json > ~/.claude/settings.json.tmp \
  && mv ~/.claude/settings.json.tmp ~/.claude/settings.json

# Option 2: Remove statusline config entirely
jq 'del(.statusLine)' ~/.claude/settings.json > ~/.claude/settings.json.tmp \
  && mv ~/.claude/settings.json.tmp ~/.claude/settings.json

Restart Claude Code after making changes.

Privacy

This application runs entirely locally and does not collect any data. See PRIVACY.md for details.

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Before submitting a PR, make sure to run the test suite:

go test -v ./...

Acknowledgments

비슷한 프로젝트