claude-function-hooks
Function hooks for Claude Code, packaged as a plugin marketplace. Function
hooks are early access: TypeScript modules that run inside the session,
behind the CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 flag. The API may change
between releases.
| Plugin | What it does |
| --- | --- |
| time | The time you sent each message, drawn above it |
| gh-ci-status | GitHub Actions runs of the session's repo, pinned above the prompt, with links to the PR and the run |
time
The time above a message is the one of its first drawing, which is when you
sent it, and it is kept per message, so a resize or a redraw does not move it.
A resumed session, or a reload of the plugin, draws the old messages with the
current time.
gh-ci-status
⚙ owner/repo · Actions · 1 running · 1 finished
#167 ◐ Running PR 0m37s chore(ci): smoke-test PR
main ● Success Deploy 2m15s Release 1.4.0
- Finds the repo the way
gh does (gh repo view, the default remote), so
gh must be on your PATH and logged in. Without a GitHub remote it logs
one line and stays quiet. The check runs once, at session start, so a
failure there, no network or an expired token, keeps it quiet for the
whole session: after gh auth login, or once the network is back,
restart the session or edit a hook module to reload the plugin.
- Polls
gh run list every 60 s, and every 15 s while a run is in flight or
for 6 minutes after a push. A git push, git subtree push, gh pr merge,
gh workflow run or gh run rerun in Bash wakes it.
#N links to the PR (matched by branch through gh pr list, or from
refs/pull/N/head); the workflow name links to the run.
- Shows runs from a push, a pull request, a manual dispatch, the merge
queue, a release, or a workflow another one started, and leaves cron and
issue bots out. Toasts when a run starts or finishes. A finished run stays
for 5 minutes.
Use
# a folder of plugins needs Claude Code 2.1.265 or later
CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude --plugin-dir /path/to/claude-function-hooks/plugins
Or install them from the marketplace, in a session started with the same
flag:
/plugin marketplace add diegorv/claude-functions-hook
/plugin install gh-ci-status@claude-function-hooks
/plugin install time@claude-function-hooks
Edits to a hook module reload without restarting the session.
Develop
npm test # node --test, no dependencies
npm run typecheck # tsc
npm run format # prettier
npm run validate # claude plugin validate
The API's type declarations (.claude/types/) are not in git. Generate them
with /plugin-types in a Claude Code session at the root of this repo, and
regenerate after updating Claude Code.
Plugin layout
plugins/gh-ci-status/
.claude-plugin/plugin.json manifest
hooks/hooks.json points at the entry module
src/core/ the run model and the text derived from it, no I/O
src/utils/ generic helpers (text)
src/app/ use cases (the poller), dependencies injected
src/infra/ external clients (GitHub through gh)
src/components/ the band's view model and its JSX
src/hooks/ the wiring to the engine
*.test.ts next to the file it tests, run on Node