Repository navigation
Read Claude Code's PowerShell tool as shell text - #268
Open
Kirill (AJIADb9) wants to merge 1 commit into
Open
Kirill (AJIADb9) wants to merge 1 commit into
Kirill (AJIADb9) wants to merge 1 commit into
Conversation
On Windows, Claude Code runs commands through its PowerShell tool, whose
input is {"command": ...} like Bash's. Micro-skills only read bash, shell
and stop_bash, so every Windows session folded with no commands and no fact
could form; the loop guard did not count those calls either.
One SHELL_TOOLS set in trace names the shell tools for the observer and the
distiller, the loop guard canonicalises powershell to bash, and tool pruning
protects PowerShell. A command head's .exe suffix is dropped, so
C:\Python312\python.exe reads as the python interpreter.
|
Kirill (@AJIADb9) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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.
Claude Code on Windows runs commands through its
PowerShelltool rather thanBash. The tool's input is{"command": ...}, the same as Bash's, but micro-skills only readbash,shellandstop_bash, so every Windows session folded with no commands and no fact could form. The loop guard did not count those calls either.trace.SHELL_TOOLSnames the shell tools once; the observer and the distiller use it.powershelltobash.PowerShell, as it doesBash..exesuffix is dropped, soC:\Python312\python.exe -m pytestand.\.venv\Scripts\python.exe -m pytestare seen as the Python interpreter running the tests.Checked against recorded sessions:
observe_taskover 60 real Claude Code sessions from a Windows machine found 3 observations onmainand 108 with this change (39 test runs, 49 fetches, 13 VCS probes, 5 package-tool calls). New tests are intests/test_claude_powershell_tool.py;python -m pytest tests experiments/testspasses.