feat(phase-1): agent-ctl core + Claude Code adapter#1
Merged
Conversation
- Core types: AgentAdapter, AgentSession, LifecycleEvent interfaces - Claude Code adapter: reads session data directly from ~/.claude/ - list: discovers sessions from sessions-index.json + fallback JSONL scan - peek: extracts recent assistant messages from JSONL conversation logs - status: cross-references session data with running PIDs via ps/lsof - stop: sends SIGTERM (or SIGINT+SIGKILL with --force) to claude processes - launch: spawns claude with --print --stream-json flags - resume: uses claude --continue to resume sessions - events: polls for session lifecycle changes, emits NDJSON events - CLI: list, peek, stop, status, launch, resume, events commands - Human-friendly table output by default, --json for machine consumption - Prefix matching for session IDs (e.g. first 8 chars) - Zero file-based registry: all state derived from native Claude Code data + PIDs - 14 unit tests passing (vitest) Co-Authored-By: Charlie Hulcher <charlie.hulcher@gmail.com>
c-h-
added a commit
that referenced
this pull request
Feb 20, 2026
feat(phase-1): agent-ctl core + Claude Code adapter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.claude/projects/and cross-references with running PIDs viaps/lsof— zero file-based registrylist,peek,stop,status,launch,resume,eventscommandsKey Design Decisions
claudeDirandgetPidsoverrides for testabilitysessions-index.jsonwhen available, falls back to scanning.jsonlfiles for active sessions not yet indexedps auxforclaude --*processes, extracts cwd via/usr/sbin/lsofTest plan
npx tsc --noEmit— clean type-checknpx vitest run— 14/14 tests passagent-ctl list— shows running sessions with correct PID/model/cwdagent-ctl peek <id>— shows recent assistant outputagent-ctl status <id>— shows session details with token countsagent-ctl list --json— machine-readable outputagent-ctl list -a— includes stopped sessions🤖 Generated with Claude Code