Claude Code prayer times: the current prayer and time left above your prompt
The current prayer, time left, next prayer and zawal as one line above the Claude Code prompt, computed locally.
Permissions
- Reads filesCan read files and list directories on your machine ($.fs.read / list / stat / exists).
- Changes the UIDraws into the Claude Code interface: bands, panes, status text, toasts (ui.render / $.ui.*).
- Adds commands/toolsRegisters new slash commands or tools that you or Claude can invoke ($.command.register / $.tool.register).
- tested with
- v2.1.310
- last tested
- requires
- Claude Code ≥ 2.1.287
- surfaces
- above-prompt, toast
- source
- Hamza Zafar (hamzafer) (MIT)
Install inside Claude Code:
/plugin install prayer-times --marketplace hamzafer/claude-code-modsWhat does this mod do?
Prayer Times is a community mod by Hamza Zafar (hamzafer), part of his claude-code-mods collection. It puts Claude Code prayer times on one line above the prompt: the prayer whose time it is now, how long is left to pray it, and the next prayer with its start time. You give it your latitude and longitude in /config, and it works out the times on your computer.
The line changes as the day goes on:
- In a prayer's window:
🕌 Asr · 1h 05m left · next Maghrib 18:29. The time left is green, turns yellow under 20 minutes and red under 5. - Between prayers:
🕌 Dhuhr in 3h 20m, plus when zawal starts. - Zawal and makruh:
⛔ Zawal · no prayer for 4min red, and the same for the minutes after sunrise and before sunset. Near sunset the line also keeps showing how long Asr has left. - No location set yet: a dim line asking you to set the latitude and longitude in
/config.
Two toasts come with it: one when each prayer begins, saying until when it lasts, and one a set number of minutes before it ends (15 by default, once per prayer). /prayers lists today's times in one reply.
Install
Use any of the methods in the install block; they install straight from the author's own marketplace. After installing, open /config, find the prayer-times plugin and enter your latitude and longitude. The line appears above the prompt on the next session start.
$ install prayer-times
Requires Claude Code ≥ 2.1.287
Installs from the author's own marketplace: hamzafer/claude-code-mods
1.One line, inside Claude Code
/plugin install prayer-times --marketplace hamzafer/claude-code-modsPaste into a running session (v2.1.275+). Claude Code asks to add the marketplace first.
2.From your shell
claude plugin marketplace add hamzafer/claude-code-mods claude plugin install prayer-times@claude-code-modsThen run /reload-plugins in any session that is already open.
3.Try it without installing
git clone https://github.com/hamzafer/claude-code-mods claude --plugin-dir ./claude-code-mods/mods/prayer-timesLoads the mod for one session only. Nothing is added to your settings.
How it works
At session.start the plugin registers /prayers and starts one timer that fires every 30 seconds. Each tick writes the current time to a host-held $.state atom, which makes the line redraw, and checks whether to show a toast. This is from hooks/register.tsx:
timer?.cancel()
timer = $.clock.every(30_000, () => {
void (async () => {
const t = await $.clock.now()
await update($, now, () => t)
if (!cfg || !toasts) return
const s = status(cfg, new Date(t), makruh, zawal)The times come from computeTimes, which follows the PrayTimes method: it computes the sun's declination and the equation of time for the date, then solves for the moment the sun reaches each angle (Fajr, Isha, Asr's shadow length, sunrise and sunset at 0.833°). status builds each day's windows for the days around now, picks the current prayer, any zawal or makruh window and the next prayer, and returns the parts the line draws. When the sun never reaches the horizon (polar day or night), the plugin uses the nearest latitude that has a sunrise, 65°, and the line says "estimated". The band is stacked with other band mods through hooks/bands.ts, which reads an optional order file.
Customize it
All options are in /config: latitude, longitude, method (karachi, mwl, isna, egypt or makkah), asr (hanafi or standard), highLatitude (angle, seventh or middle), adjust (minutes per time, such as asr+2 isha-5), makruhMinutes (default 15), zawalMinutes (default 5), warnMinutes (default 15, 0 turns the warning off) and toasts (on or off). If you run several band mods, the order of the lines can be set in claude-code-mods/bands.json in your Claude config directory; the plugin reads it once per session, so restart to apply a change.
Permissions & safety
We read every file the plugin can execute before running it: .claude-plugin/plugin.json, hooks/hooks.json, hooks/register.tsx, hooks/bands.ts, the type declaration and the tests. There is no package.json, install script, binary or bundled code. Here is what we found:
- Network, processes, telemetry: none. The plugin has no
fetch, no$.process.runand no analytics. Your location is only used in the local calculation. - File reads:
$.fs.existsand$.fs.readopen one file,claude-code-mods/bands.jsonunderCLAUDE_CONFIG_DIR(or~/.claudewhen unset), to read the band order.$.env.getreadsCLAUDE_CONFIG_DIRandHOME. The plugin never writes a file. - Background work: one 30-second timer, only while the session is running. No daemon.
- Prompts and tools: it injects no text into the prompt or the model's context and has no gating hooks. It draws a line above the prompt, shows toasts and answers
/prayers. - License: MIT, with a LICENSE file in the repository root.
claude plugin validate reported no errors and one directory warning (no plugin icon), which does not affect use. The author's tests ran 19 passed and 1 failed on Claude Code 2.1.310. The failing test, "after midnight, Isha runs until Fajr", builds a local-time date and expects London's Isha, so it depends on the time zone of the machine running it. We read that as a test problem rather than a user-facing one. The times are meant to be used where your computer's clock matches your location.
- Reads files
- Can read files and list directories on your machine ($.fs.read / list / stat / exists).
- Changes the UI
- Draws into the Claude Code interface: bands, panes, status text, toasts (ui.render / $.ui.*).
- Adds commands/tools
- Registers new slash commands or tools that you or Claude can invoke ($.command.register / $.tool.register).
Compatibility & troubleshooting
Validated and tested on Claude Code 2.1.310 on macOS. If the line does not look right:
- Asks for a location: enter both latitude (north positive) and longitude (east positive) in
/config. A value outside -90 to 90 or -180 to 180 counts as not set. - No line at all: a survey above the prompt hides it until the survey closes.
- Times are off by hours: the plugin shows times in your computer's time zone, so the system time zone should match the location you entered.
- Times are off by minutes: switch
methodorasr, or useadjustto match your mosque's timetable. - Order of lines: if another band mod sits in the wrong place, check
bands.jsonand restart.
To check it works, run /prayers. It should print Fajr, Sunrise, Zawal, Dhuhr, Asr, Maghrib and Isha for today with your method and Asr rule.
FAQ
- Does Prayer Times send my location anywhere?
- No. The times are calculated in the plugin from the latitude and longitude you enter in /config, using the sun's position. We found no network calls, no process calls and no telemetry in the code. The latitude and longitude stay in your local plugin settings.
- Which calculation methods and Asr rules does it support?
- Five Fajr and Isha conventions (karachi, mwl, isna, egypt, makkah) and two Asr rules (hanafi, the default, and standard). For far north or south locations you can pick angle, seventh or middle. The adjust setting shifts any time by some minutes, for example asr+2 isha-5, to match your mosque's timetable.
- What does the red warning mean?
- The line turns red with a no-entry sign during zawal, the minutes before Dhuhr (5 by default), and during the makruh minutes after sunrise and before sunset (15 by default). Both lengths are options in /config. The line then counts down to when the window ends.
- Can I turn off the toasts?
- Yes. The toasts option turns off both the "has begun" toast and the warning before a prayer ends. To keep the start toast but drop the warning, set warnMinutes to 0.
- Why are the times a minute or two different from my local timetable?
- The author's tests compare the output with the Aladhan API and allow up to 1.5 minutes, and up to 3 minutes for Asr, because the textbook shadow formula used here runs slightly earlier than Aladhan's. Use the adjust setting to match your own mosque exactly.
# Related mods
FeaturedWhere Am I
A recap above the Claude Code prompt: the session goal, what is happening now, what waits on you and the next step.
- above-prompt
- Reads files
- Calls the model (uses your quota)
- Intercepts tool calls
- Reads your prompts
- Changes the UI
- Adds commands/tools
tested with v2.1.303
FeaturedDone Toast
A "Done in 2m 14s" toast and a short chime when a long Claude turn finishes, plus an optional desktop notification.
- toast
- Runs commands
- Changes the UI
- Plays sound
tested with v2.1.310
FeaturedCache Clock
A prompt-cache line under your Claude Code status line: time left while warm, hit rate, and tokens re-cached once cold.
- status
- Reads files
- Writes files
- Runs commands
- Adds commands/tools
tested with v2.1.296