feat: status line helper scripts and setup documentation

Bash and PowerShell helpers for Claude Code statusLine. Setup docs with fallback note for non-Claude agents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 18:35:42 -04:00
parent 50e7333e84
commit 8e930c6b7a
3 changed files with 82 additions and 0 deletions
+65
View File
@@ -0,0 +1,65 @@
# ctask Status Line Setup
## Claude Code Integration
ctask includes helper scripts that display task context in Claude Code's status line.
### Setup
Add one of the following to your `~/.claude/settings.json`:
**Linux / macOS (bash):**
```json
{
"statusLine": {
"type": "command",
"command": "bash /path/to/ctask-statusline.sh"
}
}
```
**Windows (PowerShell):**
```json
{
"statusLine": {
"type": "command",
"command": "powershell -NoProfile -File C:\\path\\to\\ctask-statusline.ps1"
}
}
```
Replace `/path/to/` with the actual location of the script.
### Output
When inside a ctask session:
```
(ctask:arch-notes|local) ~/ai-workspaces/general/2026-04-05_arch-notes
```
When NOT in a ctask session: no output (falls through gracefully).
### How It Works
The scripts read only from environment variables set by ctask:
- `CTASK_TASK` -- task slug
- `CTASK_MODE` -- execution mode (local/container)
- `CTASK_WORKSPACE` -- full workspace path
No file parsing or subprocess calls are performed.
## Non-Claude Agents
For agents that do not support a dedicated status line, ctask provides an ephemeral
shell prompt prefix in `--shell` mode:
```
(ctask:arch-notes|local) user@host:~/path$
```
This is set via `PS1` (Unix) or `PROMPT` (Windows) and does not modify permanent
shell configuration.
+8
View File
@@ -0,0 +1,8 @@
# ctask status line helper for Claude Code
# Reads ctask environment variables and prints a formatted context string.
# Output: (ctask:<slug>|<mode>) <workspace_path>
# Outputs nothing when not in a ctask session.
if (-not $env:CTASK_TASK) { exit 0 }
Write-Output "(ctask:$($env:CTASK_TASK)|$($env:CTASK_MODE)) $($env:CTASK_WORKSPACE)"
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# ctask status line helper for Claude Code
# Reads ctask environment variables and prints a formatted context string.
# Output: (ctask:<slug>|<mode>) <workspace_path>
# Outputs nothing when not in a ctask session.
[ -z "$CTASK_TASK" ] && exit 0
echo "(ctask:${CTASK_TASK}|${CTASK_MODE}) ${CTASK_WORKSPACE}"