Skip to content

Commit db48388

Browse files
Kasper Jungeclaude
authored andcommitted
docs: fix incorrect claim that failed context commands produce no output
The troubleshooting page and cookbook both stated that context commands with non-zero exit codes produce no output. In reality, ralphify captures and injects context output regardless of exit code — this is intentional so commands like pytest still provide useful data when tests are failing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 282a8e9 commit db48388

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

docs/cookbook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ uv run pytest --cov=src --cov-report=term-missing -q 2>/dev/null || true
894894
```
895895

896896
!!! note "Why `|| true`?"
897-
Context commands that fail (non-zero exit) produce no output. Appending `|| true` ensures the coverage report is captured even when some tests are currently failing.
897+
Context output is captured regardless of exit code, so `|| true` isn't strictly needed for ralphify. However, it ensures the script exits cleanly if you run it manually outside of ralphify (e.g. during debugging), and prevents errors if you later add `set -e` to the script.
898898

899899
### Setup commands
900900

docs/troubleshooting.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ cat .ralph/contexts/git-log/CONTEXT.md
207207
git log --oneline -10
208208
```
209209

210-
If the command fails, its output won't be injected. Fix the command or increase its timeout.
210+
Context output is injected into the prompt **regardless of exit code** — even if the command exits non-zero, its stdout and stderr are still captured and included. This is intentional: commands like `pytest` often exit non-zero (because tests are failing) but still produce useful output the agent should see.
211+
212+
If the command produces no output at all, check that it runs correctly outside of ralphify. If it times out, increase the `timeout` value in the context's frontmatter.
211213

212214
### Some contexts are missing from the prompt
213215

0 commit comments

Comments
 (0)