feat: add --debug and --debug-log flags for diagnostic logging#8
Merged
Merged
Conversation
Adds global --debug and --debug-log FILE flags to the CLI. When enabled, emits DEBUG-level logs showing: - Full Claude CLI commands and working directories - Claude stdout/stderr and exit codes - Workspace setup (file copies, temp dirs) - Trigger signal classification and tool call details Uses Python stdlib logging (zero external deps). Logs go to stderr (--debug) or file (--debug-log) to keep stdout clean for tool output. Without either flag, previous behavior is unchanged.
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.
Problem
When debugging why
skill-eval functionalorskill-eval triggerproduces unexpected results, there's no way to see what's happening internally — which Claude command was invoked, what workspace was used, what Claude returned, or how trigger signals were classified.Solution
Adds two global CLI flags:
--debug— emits DEBUG logs to stderr (visible in terminal)--debug-log FILE— writes DEBUG logs to a file (terminal stays quiet)What gets logged
Design
logging)mode="w") — each run starts fresh--verbose/-vflag is completely unaffected (it controls finding visibility in audit reports, not diagnostic logging)Usage
Testing
--debugand--debug-logwithskill-eval functionalandskill-eval triggeragainst real skillsskill-eval audit --verbosebehavior is unchanged with and without the new flagsFixes #9