Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions config/agents/skills-personal/update-config/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ Cobb host/profile repo, when editing Cobb integration:

## Always use `traitor` for this repo

Daniel's config operations CLI is `traitor`. Prefer it over raw `nix`, `nixos-rebuild`, `darwin-rebuild`, and `home-manager` commands.
Daniel's config operations CLI is `traitor`. Prefer it over raw `nix`, `nixos-rebuild`, `darwin-rebuild`, and `home-manager` commands. Invoke `traitor` directly when it is available on `PATH`; use `./bin/traitor` only as a fallback when PATH is not loaded yet.

Use the repo-local binary if PATH is not loaded yet:
Preferred:

```bash
cd ~/.config/dotfiles
./bin/traitor path
./bin/traitor check
./bin/traitor re
traitor path
traitor check
traitor re
```

Common commands:
Expand Down
51 changes: 24 additions & 27 deletions config/claude/hooks/herdr-agent-state.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# managed by herdr; reinstalling or updating the integration overwrites this file.
# add custom hooks beside this file instead of editing it.
# HERDR_INTEGRATION_ID=claude
# HERDR_INTEGRATION_VERSION=4
# HERDR_INTEGRATION_VERSION=7

set -eu

Expand All @@ -13,7 +13,7 @@ trap 'rm -f "$hook_input_file"' EXIT HUP INT TERM
cat >"$hook_input_file" 2>/dev/null || true

case "$action" in
working|idle|blocked|release) ;;
session) ;;
*) exit 0 ;;
esac

Expand Down Expand Up @@ -50,44 +50,41 @@ if hook_input_file:

hook_event_name = str(hook_input.get("hook_event_name") or "")
is_subagent = bool(hook_input.get("agent_id"))
if is_subagent:
raise SystemExit(0)
if hook_event_name == "SubagentStop":
# SubagentStop is a completion event. Older Herdr integrations mapped it
# to durable working, but Claude recap/away-summary can emit it after the
# main turn has already stopped. Never let it revive an idle pane.
raise SystemExit(0)
if is_subagent and action in ("idle", "release"):
# Subagent completion must not make the parent pane look done early.
raise SystemExit(0)

request_id = f"{source}:{int(time.time() * 1000)}:{random.randrange(1_000_000):06d}"
report_seq = time.time_ns()
session_id = hook_input.get("session_id")
agent_session_id = session_id if isinstance(session_id, str) and session_id else None
if action == "release":
request = {
"id": request_id,
"method": "pane.release_agent",
"params": {
"pane_id": pane_id,
"source": source,
"agent": "claude",
"seq": report_seq,
},
transcript_path = hook_input.get("transcript_path")
agent_session_path = transcript_path if isinstance(transcript_path, str) and transcript_path else None
session_start_source = hook_input.get("source") if hook_event_name == "SessionStart" else None
if not isinstance(session_start_source, str) or not session_start_source:
session_start_source = None
if agent_session_id:
params = {
"pane_id": pane_id,
"source": source,
"agent": "claude",
"seq": report_seq,
"agent_session_id": agent_session_id,
}
else:
if agent_session_path:
params["agent_session_path"] = agent_session_path
if session_start_source:
params["session_start_source"] = session_start_source
request = {
"id": request_id,
"method": "pane.report_agent",
"params": {
"pane_id": pane_id,
"source": source,
"agent": "claude",
"state": action,
"seq": report_seq,
},
"method": "pane.report_agent_session",
"params": params,
}
if agent_session_id:
request["params"]["agent_session_id"] = agent_session_id
else:
raise SystemExit(0)

try:
client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
Expand Down
52 changes: 1 addition & 51 deletions config/claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@
}
],
"matcher": "*"
},
{
"hooks": [
{
"command": "bash '/Users/danielkumlin/.claude/hooks/herdr-agent-state.sh' blocked",
"timeout": 10,
"type": "command"
}
],
"matcher": "*"
}
],
"PostToolUse": [
Expand Down Expand Up @@ -71,16 +61,6 @@
}
],
"matcher": "*"
},
{
"hooks": [
{
"command": "bash '/Users/danielkumlin/.claude/hooks/herdr-agent-state.sh' working",
"timeout": 10,
"type": "command"
}
],
"matcher": "*"
}
],
"SessionEnd": [
Expand All @@ -101,16 +81,6 @@
}
],
"matcher": "*"
},
{
"hooks": [
{
"command": "bash '/Users/danielkumlin/.claude/hooks/herdr-agent-state.sh' release",
"timeout": 10,
"type": "command"
}
],
"matcher": "*"
}
],
"SessionStart": [
Expand All @@ -125,7 +95,7 @@
{
"hooks": [
{
"command": "bash '/Users/danielkumlin/.claude/hooks/herdr-agent-state.sh' idle",
"command": "bash '/Users/danielkumlin/.claude/hooks/herdr-agent-state.sh' session",
"timeout": 10,
"type": "command"
}
Expand All @@ -151,16 +121,6 @@
}
],
"matcher": "*"
},
{
"hooks": [
{
"command": "bash '/Users/danielkumlin/.claude/hooks/herdr-agent-state.sh' idle",
"timeout": 10,
"type": "command"
}
],
"matcher": "*"
}
],
"UserPromptSubmit": [
Expand All @@ -181,16 +141,6 @@
}
],
"matcher": "*"
},
{
"hooks": [
{
"command": "bash '/Users/danielkumlin/.claude/hooks/herdr-agent-state.sh' working",
"timeout": 10,
"type": "command"
}
],
"matcher": "*"
}
]
},
Expand Down
45 changes: 22 additions & 23 deletions config/codex/herdr-agent-state.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# managed by herdr; reinstalling or updating the integration overwrites this file.
# add custom hooks beside this file instead of editing it.
# HERDR_INTEGRATION_ID=codex
# HERDR_INTEGRATION_VERSION=4
# HERDR_INTEGRATION_VERSION=6

set -eu

Expand All @@ -13,7 +13,7 @@ trap 'rm -f "$hook_input_file"' EXIT HUP INT TERM
cat >"$hook_input_file" 2>/dev/null || true

case "$action" in
working|idle|blocked|release) ;;
session) ;;
*) exit 0 ;;
esac

Expand Down Expand Up @@ -48,35 +48,34 @@ if hook_input_file:
except Exception:
hook_input = {}

hook_event_name = str(hook_input.get("hook_event_name") or "")
if hook_event_name and hook_event_name != "SessionStart":
raise SystemExit(0)

request_id = f"{source}:{int(time.time() * 1000)}:{random.randrange(1_000_000):06d}"
report_seq = time.time_ns()
session_id = hook_input.get("session_id")
agent_session_id = session_id if isinstance(session_id, str) and session_id else None
if action == "release":
request = {
"id": request_id,
"method": "pane.release_agent",
"params": {
"pane_id": pane_id,
"source": source,
"agent": "codex",
"seq": report_seq,
},
session_start_source = hook_input.get("source") if hook_event_name == "SessionStart" else None
if not isinstance(session_start_source, str) or not session_start_source:
session_start_source = None
if agent_session_id:
params = {
"pane_id": pane_id,
"source": source,
"agent": "codex",
"seq": report_seq,
"agent_session_id": agent_session_id,
}
else:
if session_start_source:
params["session_start_source"] = session_start_source
request = {
"id": request_id,
"method": "pane.report_agent",
"params": {
"pane_id": pane_id,
"source": source,
"agent": "codex",
"state": action,
"seq": report_seq,
},
"method": "pane.report_agent_session",
"params": params,
}
if agent_session_id:
request["params"]["agent_session_id"] = agent_session_id
else:
raise SystemExit(0)

try:
client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
Expand Down
38 changes: 1 addition & 37 deletions config/codex/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@
"type": "command"
}
]
},
{
"hooks": [
{
"command": "bash '/Users/danielkumlin/.codex/herdr-agent-state.sh' blocked",
"timeout": 10,
"type": "command"
}
]
}
],
"PreToolUse": [
Expand All @@ -47,15 +38,6 @@
"type": "command"
}
]
},
{
"hooks": [
{
"command": "bash '/Users/danielkumlin/.codex/herdr-agent-state.sh' working",
"timeout": 10,
"type": "command"
}
]
}
],
"SessionStart": [
Expand Down Expand Up @@ -88,7 +70,7 @@
{
"hooks": [
{
"command": "bash '/Users/danielkumlin/.codex/herdr-agent-state.sh' idle",
"command": "bash '/Users/danielkumlin/.codex/herdr-agent-state.sh' session",
"timeout": 10,
"type": "command"
}
Expand Down Expand Up @@ -121,15 +103,6 @@
"type": "command"
}
]
},
{
"hooks": [
{
"command": "bash '/Users/danielkumlin/.codex/herdr-agent-state.sh' idle",
"timeout": 10,
"type": "command"
}
]
}
],
"UserPromptSubmit": [
Expand Down Expand Up @@ -158,15 +131,6 @@
"type": "command"
}
]
},
{
"hooks": [
{
"command": "bash '/Users/danielkumlin/.codex/herdr-agent-state.sh' working",
"timeout": 10,
"type": "command"
}
]
}
]
}
Expand Down
Loading
Loading