Agent skill
agent-logs
Download or stream agent logs from GKE. Accepts issue number, session ID, or --all. Default mode downloads JSONL to tmp/agent-logs/.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/agent-logs
SKILL.md
Download or stream agent execution logs from GKE Autopilot K8s Jobs.
The argument $ARGUMENTS can be:
- An issue number (e.g.
714) — finds the latest job for that issue - A session ID (e.g.
issue-714-step1-firemandecko-3a19c027) — direct lookup --allorall— all active agent jobs--help— show usage
Modes
| Mode | Flag | Behavior |
|---|---|---|
| Download (default) | (none) or --download |
Downloads raw JSONL to tmp/agent-logs/<session>.jsonl. Skips if file already exists with content (never clobbers). |
| Stream | --stream |
Streams parsed, color-coded logs in a tmux pane. |
Instructions
-
If
$ARGUMENTSis--help, display usage and stop — do not run any commands. -
Parse
$ARGUMENTSto determine the target and mode:- Strip
#prefix if present - If it looks like a session ID (
issue-N-stepS-agent-uuid), use directly - If it's a number, resolve to the latest job via
--issue - If
--allorall, use the --all flow below - If
--streamis present, use stream mode; otherwise default to download mode
- Strip
Download mode (default)
- For a single target — download directly:
REPO_ROOT=$(git rev-parse --show-toplevel)
node "$REPO_ROOT/infrastructure/k8s/agents/agent-logs.mjs" <target>
- For
--all— download all active jobs:
REPO_ROOT=$(git rev-parse --show-toplevel)
kubectl get jobs -n fenrir-agents \
-o jsonpath='{range .items[?(@.status.active)]}{.metadata.name}{"\n"}{end}' | \
while read job; do
[ -z "$job" ] && continue
sid="${job#agent-}"
node "$REPO_ROOT/infrastructure/k8s/agents/agent-logs.mjs" "$sid"
done
- Report back:
Downloaded N agent logs to tmp/agent-logs/
Or if no active agents: "No active agent jobs found."
Stream mode (--stream)
- For a single target — spawn one tmux pane:
REPO_ROOT=$(git rev-parse --show-toplevel)
node "$REPO_ROOT/infrastructure/k8s/agents/agent-logs.mjs" stream <target> --tools --spawn-pane
- For
--all— get all active jobs and spawn a pane for EACH one using--spawn-pane:
REPO_ROOT=$(git rev-parse --show-toplevel)
kubectl get jobs -n fenrir-agents \
-o jsonpath='{range .items[?(@.status.active)]}{.metadata.name}{"\n"}{end}' | \
while read job; do
[ -z "$job" ] && continue
sid="${job#agent-}"
node "$REPO_ROOT/infrastructure/k8s/agents/agent-logs.mjs" stream "$sid" --tools --spawn-pane
done
IMPORTANT: Do NOT use --all --tmux — that blocks the current process. Always loop
with --spawn-pane so each agent gets its own non-blocking tmux pane.
- Report back:
Streaming N active agents in tmux panes
Or if no active agents: "No active agent jobs found."
Additional flags (pass through from $ARGUMENTS)
--thinking— include thinking blocks (stream mode)--no-follow— dump existing logs, don't stream--raw— show raw JSONL--verbose— alias for --tools (stream mode)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?