Skip to content

Commit fc44a00

Browse files
committed
Teach token-goat about PowerShell Get-Content
1 parent b68207a commit fc44a00

3 files changed

Lines changed: 32 additions & 13 deletions

File tree

‎src/token_goat/install.py‎

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,10 +1522,10 @@ def _skill_routing_rows() -> list[tuple[str, str, str, str]]:
15221522
CLAUDE_MD_CONTENT = (
15231523
"## token-goat - route code reads through token-goat first\n"
15241524
"\n"
1525-
"token-goat is installed. Before you call Read or Grep on a source file, check for a"
1526-
" token-goat command that does the same job for a fraction of the tokens. This is the"
1527-
" default path, not an optimization. Skipping it burns context you will need later in"
1528-
" the session.\n"
1525+
"token-goat is installed. Before you call Read or Grep on a source file, or use"
1526+
" PowerShell `Get-Content` on Windows, check for a token-goat command that does the"
1527+
" same job for a fraction of the tokens. This is the default path, not an optimization."
1528+
" Skipping it burns context you will need later in the session.\n"
15291529
"\n"
15301530
+ _render_routing_table(_claude_skill_routing_rows(), codex=False)
15311531
+ "\n"
@@ -1617,10 +1617,11 @@ def unpatch_claude_md() -> str:
16171617
SKILL_MD_CONTENT = (
16181618
"---\n"
16191619
"name: token-goat\n"
1620-
"description: Use BEFORE reaching for Read or Grep on a source file. token-goat commands"
1621-
" replace symbol search, single-function reads, doc-section reads, semantic search, and"
1622-
" repo overviews at a fraction of the token cost. Hooks handle image shrink, Drive"
1623-
" intercept, and read dedup automatically. Skipping token-goat burns session context.\n"
1620+
"description: Use BEFORE reaching for Read or Grep on a source file, or PowerShell"
1621+
" `Get-Content` on Windows. token-goat commands replace symbol search, single-function"
1622+
" reads, doc-section reads, semantic search, and repo overviews at a fraction of the"
1623+
" token cost. Hooks handle image shrink, Drive intercept, and read dedup automatically."
1624+
" Skipping token-goat burns session context.\n"
16241625
"---\n"
16251626
"\n"
16261627
"# token-goat\n"
@@ -1642,7 +1643,8 @@ def unpatch_claude_md() -> str:
16421643
"\n"
16431644
"## What you DO call\n"
16441645
"\n"
1645-
"Before reaching for Read or Grep on a code file, check this table.\n"
1646+
"Before reaching for Read or Grep on a code file, or PowerShell `Get-Content` on"
1647+
" Windows, check this table.\n"
16461648
"\n"
16471649
+ _render_routing_table(_skill_routing_rows(), codex=False)
16481650
+ "\n"
@@ -1790,10 +1792,10 @@ def unpatch_codex_config() -> str:
17901792
CODEX_AGENTS_MD_CONTENT = (
17911793
"## token-goat - route code reads through token-goat first (Codex)\n"
17921794
"\n"
1793-
"token-goat is installed. Before you run `rg`, `grep`, `cat`, `head`, `bat`, or any Bash"
1794-
" read of a source file, check whether a token-goat command does the same job for a"
1795-
" fraction of the tokens. Route through token-goat by default. Skipping it burns context"
1796-
" you will need later in the session.\n"
1795+
"token-goat is installed. Before you run `rg`, `grep`, `cat`, `head`, `bat`,"
1796+
" `Get-Content`, or any Bash read of a source file, check whether a token-goat command"
1797+
" does the same job for a fraction of the tokens. Route through token-goat by default."
1798+
" Skipping it burns context you will need later in the session.\n"
17971799
"\n"
17981800
+ _render_routing_table(_codex_routing_rows(), codex=True)
17991801
+ "\n"

‎tests/test_install_codex.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def test_patch_codex_agents_md_creates_file(patched_home):
174174
assert install.CODEX_AGENTS_BEGIN in content
175175
assert install.CODEX_AGENTS_END in content
176176
assert "token-goat" in content
177+
assert "Get-Content" in content
177178

178179

179180
# ---------------------------------------------------------------------------

‎tests/test_skill_iter10_integration.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,14 @@ def test_claude_md_content_has_skill_section(self):
300300
"CLAUDE_MD_CONTENT must mention skill-section command"
301301
)
302302

303+
def test_claude_md_content_mentions_get_content(self):
304+
"""CLAUDE_MD_CONTENT mentions PowerShell Get-Content as a read equivalent."""
305+
from token_goat.install import CLAUDE_MD_CONTENT
306+
307+
assert "Get-Content" in CLAUDE_MD_CONTENT, (
308+
"CLAUDE_MD_CONTENT must mention PowerShell Get-Content"
309+
)
310+
303311
def test_skill_md_content_has_skill_body(self):
304312
"""SKILL_MD_CONTENT includes skill-body command documentation."""
305313
from token_goat.install import SKILL_MD_CONTENT
@@ -340,6 +348,14 @@ def test_skill_md_content_has_skill_section(self):
340348
"SKILL_MD_CONTENT must mention skill-section command"
341349
)
342350

351+
def test_skill_md_content_mentions_get_content(self):
352+
"""SKILL_MD_CONTENT mentions PowerShell Get-Content as a read equivalent."""
353+
from token_goat.install import SKILL_MD_CONTENT
354+
355+
assert "Get-Content" in SKILL_MD_CONTENT, (
356+
"SKILL_MD_CONTENT must mention PowerShell Get-Content"
357+
)
358+
343359
def test_claude_md_skill_commands_have_one_line_descriptions(self):
344360
"""Each skill command in CLAUDE_MD_CONTENT is followed by a brief description."""
345361
from token_goat.install import CLAUDE_MD_CONTENT

0 commit comments

Comments
 (0)