@sochdb/flowtrace-claude-code
v0.1.0
Published
Flowtrace observability plugin for Claude Code - automatic tracing of all tool calls and sessions
Downloads
6
Maintainers
Readme
@sochdb/flowtrace-claude-code
Flowtrace observability plugin for Claude Code - automatic tracing of all tool calls and sessions.
Features
- 📊 Automatic Tracing: Traces every tool call (Bash, Edit, Write, Read, etc.)
- 🔗 Session Tracking: Links all tool calls within a session
- ⏱️ Duration Tracking: Measures time spent on each tool execution
- 🚫 Non-blocking: Never interrupts or slows down Claude Code
- 📈 Dashboard Integration: View traces in Flowtrace UI
Installation
npm install -g @sochdb/flowtrace-claude-codeThis will automatically install the plugin to ~/.claude/plugins/flowtrace.
Manual Installation
If auto-install doesn't work, run:
npx @sochdb/flowtrace-claude-codeOr copy manually:
cp -r node_modules/@sochdb/flowtrace-claude-code/plugin ~/.claude/plugins/flowtraceConfiguration
The plugin is configured via environment variables:
| Variable | Default | Description |
|----------|---------|-------------|
| FLOWTRACE_ENABLED | true | Enable/disable tracing |
| FLOWTRACE_URL | http://localhost:9600 | Flowtrace server URL |
| FLOWTRACE_TENANT_ID | 1 | Tenant identifier |
| FLOWTRACE_PROJECT_ID | 1 | Project identifier |
Example
# Set Flowtrace URL
export FLOWTRACE_URL="http://localhost:9600"
# Run Claude Code
claudeWhat Gets Traced
Session Events
- SessionStart: When a Claude Code session begins
- Stop: When a session ends
Tool Calls
Every tool invocation is traced with:
| Tool | Traced Data |
|------|-------------|
| Bash | Command, output, exit code, duration |
| Edit | File path, changes, duration |
| Write | File path, content length, duration |
| Read | File path, lines read, duration |
| Glob | Pattern, matches, duration |
| Grep | Pattern, file, matches, duration |
| LS | Directory, entries, duration |
| Task | Subtask description, result, duration |
Viewing Traces
Start Flowtrace:
open /Applications/Flowtrace.app # or flowtrace serveOpen the Flowtrace UI at
http://localhost:9600Navigate to Traces to see all Claude Code activity
Filter by:
- Project
- Session
- Tool name
- Time range
Plugin Structure
flowtrace/
├── .claude-plugin/
│ └── plugin.json # Plugin metadata
├── core/
│ ├── __init__.py
│ └── client.py # Flowtrace API client
├── hooks/
│ ├── __init__.py
│ ├── hooks.json # Hook definitions
│ ├── sessionstart.py # Session start handler
│ ├── pretooluse.py # Pre-tool execution handler
│ ├── posttooluse.py # Post-tool execution handler
│ └── stop.py # Session end handler
└── README.mdTroubleshooting
Traces not appearing
Check Flowtrace is running:
curl http://localhost:9600/api/v1/healthVerify environment variable:
echo $FLOWTRACE_URLCheck plugin is loaded:
claude /plugin list
Disable temporarily
export FLOWTRACE_ENABLED=false
claudeDevelopment
To modify the plugin:
- Edit hooks in
hooks/directory - Modify the client in
core/client.py - Test with Claude Code:
claude
License
MIT
