Skip to content

Commit d113273

Browse files
committed
plugins/config: update documentation with $HOME and new features
- Replace hardcoded /home/USERNAME paths with $HOME variable - Update all references to /tmp/claude-sessions/ storage location - Document new status line features: emojis, path context, truncation - Update example outputs to reflect new format with emojis - Fix hook installation path references to ~/.claude/hooks/ - Improve settings.json examples with $HOME variable
1 parent 6e1944b commit d113273

File tree

2 files changed

+32
-28
lines changed

2 files changed

+32
-28
lines changed

plugins/config/commands/install-hooks.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ config:install-hooks
1515
## Description
1616

1717
The `config:install-hooks` command installs the session prompt capture hook script to `~/.claude/hooks/session-prompt-hook.sh`.
18-
This hook captures user prompts during a Claude Code session and saves them to `/tmp/prompts-{session_id}.txt`.
18+
This hook captures user prompts during a Claude Code session and saves them to `/tmp/claude-sessions/prompts-{session_id}.txt`.
1919

2020
**Purpose**: This hook exists solely to provide the status line with your last prompt for display.
2121
It has no other functionality and provides no value on its own.
@@ -25,7 +25,7 @@ The status line works fine without it.
2525

2626
1. **Copy hook script to Claude Code config directory**
2727
- Source: `plugins/config/scripts/session-prompt-hook.sh`
28-
- Destination: `~/.claude/session-prompt-hook.sh`
28+
- Destination: `~/.claude/hooks/session-prompt-hook.sh`
2929
- Ensure the script is executable
3030

3131
2. **Configure Claude Code to use the hook**
@@ -39,7 +39,7 @@ The status line works fine without it.
3939
"hooks": [
4040
{
4141
"type": "command",
42-
"command": "/home/USERNAME/.claude/session-prompt-hook.sh"
42+
"command": "$HOME/.claude/hooks/session-prompt-hook.sh"
4343
}
4444
]
4545
}
@@ -48,18 +48,18 @@ The status line works fine without it.
4848
}
4949
```
5050

51-
- Replace `USERNAME` with the actual username
51+
- Replace `$HOME` with the actual `$HOME` environment variable
5252
- If settings.json already has other content, merge this configuration
5353
- Restart Claude Code or start a new session for changes to take effect
5454

5555
3. **Verify installation**
56-
- Check that `~/.claude/session-prompt-hook.sh` exists
56+
- Check that `~/.claude/hooks/session-prompt-hook.sh` exists
5757
- Check that the script is executable
5858
- Verify that `jq` is installed (required dependency)
5959

6060
4. **Provide usage instructions**
6161
- Inform user how to verify the hook is working
62-
- Explain the `/tmp/prompts-{session_id}.txt` file location
62+
- Explain the `/tmp/claude-sessions/prompts-{session_id}.txt` file location
6363
- Note that prompts persist until system reboot or manual cleanup
6464

6565
## Return Value
@@ -86,7 +86,7 @@ The status line works fine without it.
8686
Expected output:
8787
8888
```
89-
Installed session-prompt-hook.sh to ~/.claude/
89+
Installed session-prompt-hook.sh to ~/.claude/hooks/
9090

9191
To enable the hook, add to ~/.claude/settings.json:
9292

@@ -97,7 +97,7 @@ The status line works fine without it.
9797
"hooks": [
9898
{
9999
"type": "command",
100-
"command": "/home/YOUR_USERNAME/.claude/session-prompt-hook.sh"
100+
"command": "$HOME/.claude/hooks/session-prompt-hook.sh"
101101
}
102102
]
103103
}
@@ -111,7 +111,7 @@ The status line works fine without it.
111111
## Notes
112112
113113
- This hook's only purpose is to enable prompt display in the status line
114-
- The hook captures prompts to `/tmp/prompts-{session_id}.txt` (persist until reboot)
114+
- The hook captures prompts to `/tmp/claude-sessions/prompts-{session_id}.txt` (persist until reboot)
115115
- The status line works fine without this hook installed
116116
- Captured prompts are single-line (newlines converted to spaces)
117117
- Installing this hook is optional and provides minimal additional value

plugins/config/commands/install-status-line.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ config:install-status-line
1717
The `config:install-status-line` command installs a custom status line script to `~/.claude/status_line.sh`.
1818
This status line displays session information including:
1919

20-
- Claude Code version
21-
- Active model name
22-
- Git branch or current directory
23-
- Output style
24-
- Most recent user prompt (only if session-prompt-hook is installed)
20+
- 📦 Claude Code version
21+
- 🧬 Active model name
22+
- 🗂️ Git branch with path context (parent/current directory)
23+
- 🎨 Output style
24+
- 💬 Most recent user prompt (only if session-prompt-hook is installed)
2525

2626
The status line works fully without the prompt hook.
2727
The prompt hook is optional and only adds minimal extra context by showing your last prompt.
@@ -39,11 +39,11 @@ The prompt hook is optional and only adds minimal extra context by showing your
3939
{
4040
"statusLine": {
4141
"type": "command",
42-
"command": "/home/USERNAME/.claude/status_line.sh"
42+
"command": "$HOME/.claude/status_line.sh"
4343
}
4444
}
4545
```
46-
- Replace `USERNAME` with the actual username
46+
- Replace `$HOME` with the actual `$HOME` environment variable
4747
- If settings.json already has other content, merge this configuration
4848
- Restart Claude Code or start a new session for changes to take effect
4949

@@ -95,14 +95,14 @@ The prompt hook is optional and only adds minimal extra context by showing your
9595
{
9696
"statusLine": {
9797
"type": "command",
98-
"command": "/home/YOUR_USERNAME/.claude/status_line.sh"
98+
"command": "$HOME/.claude/status_line.sh"
9999
}
100100
}
101101

102102
Then restart Claude Code or start a new session.
103103

104104
Status line format:
105-
[version] | [model] | [branch/dir] | [style] | [last prompt...]
105+
📦 [version] | 🧬 [model] | 🗂️ [parent/current:branch] | 🎨 [style] | 💬 [last prompt...]
106106
```
107107
108108
2. **Full setup with prompt hook**:
@@ -114,25 +114,29 @@ The prompt hook is optional and only adds minimal extra context by showing your
114114
115115
## Status Line Format
116116
117-
The status line displays information with color-coded sections:
117+
The status line displays information with emojis and color-coded sections:
118118
119-
- **Purple**: Claude Code version
120-
- **Blue**: Active model display name
121-
- **Green**: Git branch name or current directory
122-
- **Yellow**: Output style name
123-
- **Grey**: Last user prompt (truncated at 50 chars)
119+
- 📦 **Purple**: Claude Code version
120+
- 🧬 **Blue**: Active model display name
121+
- 🗂️ **Green (dark/light)**: Path context (parent/current directory) and git branch
122+
- Parent directory truncated to 10 chars, current folder to 20 chars
123+
- Format: `parent/current:branch` (if in git repo) or `parent/current` (if not)
124+
- 🎨 **Yellow**: Output style name
125+
- 💬 **Grey**: Last user prompt (truncated at 50 chars)
124126
125127
Example output:
126128
```
127-
v1.2.3 | Sonnet 4.5 | main | default | I would like to contribute ~/.clau...
129+
📦 v1.2.3 | 🧬 Sonnet 4.5 | 🗂️ openshift/ai-helpers:config-plugin | 🎨 default | 💬 I would like to contribute ~/.clau...
128130
```
129131
130132
## Notes
131133
132134
- The status line works fully without the session-prompt-hook installed
133-
- If session-prompt-hook is installed, it reads prompts from `/tmp/prompts-{session_id}.txt` for display
134-
- If no git repository is found, displays the current directory name
135-
- Colors use matte ANSI codes for terminal compatibility
135+
- If session-prompt-hook is installed, it reads prompts from `/tmp/claude-sessions/prompts-{session_id}.txt` for display
136+
- If no git repository is found, displays the path context (parent/current directory)
137+
- Colors use matte ANSI codes for terminal compatibility, with dark/light green variants for better visual hierarchy
138+
- Directory truncation: parent directory to 10 chars, current folder to 20 chars
139+
- Emojis provide quick visual scanning: 📦 version, 🧬 model, 🗂️ location, 🎨 style, 💬 prompt
136140
- Status line is updated on every prompt submission
137141
- The prompt hook is optional and provides minimal additional context
138142

0 commit comments

Comments
 (0)