cd /news/ai-agents/show-hn-zsh-codex-assistant-codex-se… · home › topics › ai-agents › article
[ARTICLE · art-143448] src=github.com ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Show HN: Zsh-codex-assistant: codex session attached to your shell

Developer klntsky released zsh-codex-assistant, a zsh plugin that attaches a persistent Codex CLI session to a shell and is invoked by prefixing a prompt with '@', preserving shell context and command history between invocations. The plugin requires Zsh and an installed, signed-in Codex CLI, and can be loaded via a source line in ~/.zshrc or through zplug; it supports ZSH_CODEX_ASSISTANT_MODEL, ZSH_CODEX_ASSISTANT_PROFILE, and ZSH_CODEX_ASSISTANT_INITIAL_PROMPT environment settings. The author said existing tools were unsatisfactory because they lacked a persistent harness process, carried feature bloat for a root shell, and did not focus on Codex support.

read2 min views1 publishedOct 1, 2026
Show HN: Zsh-codex-assistant: codex session attached to your shell
Image: Michielbdejong (auto-discovered)

An on-demand codex session attached to your zsh shell. You can bring it forward any time, shell context is preserved.

Use @ your prompt to hop into Codex anytime.

$ # run your commands normally in the shell
$ cd ./zsh-codex-assistant
$ # prefix your prompts with '@'. first invocation starts a background codex session for this shell
$ @ explain this project
<codex CLI opens, responds to your request and exits>
$ # your shell returns to normal.
$ ls
session-notify.zsh zsh-codex-assistant.plugin.zsh ...
$ @ what was my last request?
$ <codex session resumes, your shell command history since the last invocation is put into the context>

I decided to build this because none of the existing tools were quite satisfactory:

  • I need a persistent harness process, not just an agent in oneshot mode - to preserve shell context and skip the warmup delay
  • I do not want to trust a pile of overcomplicated slop for my root shell (there are plenty of other projects for AI in the shell that suffer from feature bloat)
  • I only need codex support

If you need LLM command generation in-place, check out zsh-ai - it's decent.

Requires Zsh and an installed, signed-in Codex CLI. Make sure codex works first.

Clone this repository, then add this line to your ~/.zshrc, using the path where you cloned it:

source /path/to/zsh-codex-assistant/zsh-codex-assistant.plugin.zsh

Open a new terminal to load the plugin.

Load it after plugins that customize the Enter key if you have any.

Add this alongside your other zplug declarations in ~/.zshrc, after any plugins that customize the Enter key and before zplug load:

zplug "klntsky/zsh-codex-assistant", use:"zsh-codex-assistant.plugin.zsh"

Open a new terminal, run zplug install, then open another new terminal to load the plugin. Your ~/.zshrc should already call zplug load after the declarations.

If you already cloned this repository and want zplug to use that checkout, register its path instead:

zplug "/path/to/zsh-codex-assistant", from:local, use:"zsh-codex-assistant.plugin.zsh"

Local checkouts do not need zplug install. Put the declaration before your existing zplug load line, then open a new terminal.

Add any of these settings to ~/.zshrc:

export ZSH_CODEX_ASSISTANT_MODEL="your-model"
export ZSH_CODEX_ASSISTANT_PROFILE="your-profile"
export ZSH_CODEX_ASSISTANT_INITIAL_PROMPT="Act as a shell assistant"
── more in #ai-agents 4 stories · sorted by recency
── more on @zsh-codex-assistant 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-zsh-codex-as…] indexed:0 read:2min 2026-10-01 · —