hermes - 💡(How to fix) Fix feat: `!command` prefix for direct shell execution (like Claude Code)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

FileRole
cli.py process_input()Intercept !-prefixed input before LLM dispatch
hermes_cli/commands.pyRegister CommandDef for help/discovery
tools/terminal_tool.pyExecution path exists, just needs bypass route
RAW_BUFFERClick to expand / collapse

Feature Description

Add a ! prefix feature similar to Claude Code's, where typing !<command> in the chat executes the shell command directly without going through the LLM, and returns the output inline.

Motivation

When working in the terminal, I frequently need to run quick shell commands (e.g. !ls, !git status, !docker ps) to check state. Currently every command must go through the LLM tool-calling pipeline, which:

  1. Adds latency (the LLM parses, decides to use terminal, executes, returns)
  2. Wastes tokens on trivial operations
  3. Breaks flow when you just need a quick !pwd or !cat config.yml

This is one of the most appreciated features in Claude Code.

Proposed Solution

In the CLI input handler, before sending to the LLM, check if the user's message starts with !. If so, strip the ! prefix and execute the remainder as a shell command directly, returning stdout/stderr as if it were a terminal tool result.

Key behaviors:

  • !command to execute and return output inline (no LLM)
  • !?command to ask LLM to interpret the output
  • Only in interactive CLI mode (not gateway)
  • Standard TIRITH approval still applies for dangerous commands
  • History records both command and output

Code Locations

FileRole
cli.py process_input()Intercept !-prefixed input before LLM dispatch
hermes_cli/commands.pyRegister CommandDef for help/discovery
tools/terminal_tool.pyExecution path exists, just needs bypass route

Alternatives Considered

  1. Slash command /run - Works but /run ls is more typing than !ls
  2. Just telling the LLM - Adds 2-5s latency on trivial commands
  3. Separate REPL - Over-engineered for a simple passthrough

Example Comparison

ActionCurrent (via LLM)Proposed (!)
pwd2-5s, ~500 tokensInstant, 0 tokens
git diff --stat3-8s, ~800 tokensInstant, 0 tokens
cat config.yml2-5s, ~600 tokensInstant, 0 tokens

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING