Make the current context obvious
Use a consistent project naming pattern for tabs or windows, and include the environment when it matters: for example, “site-local” versus “site-staging.” Choose a tab color or profile only if it adds a visible distinction you will notice before typing.
iTerm2 is a terminal app for macOS. Its own current documentation is the place to confirm which profile, tab, and session controls are available in the version you use.
Separate local and remote work
Before running a command, check the host, working directory, and active environment. Keep production credentials out of ordinary shell history and avoid pasting a command you have not reviewed. For destructive operations, pause and inspect the target explicitly.
Reduce repeated command entry carefully
Aliases and shell functions can save keystrokes, but short opaque names are easy to misuse. Prefer descriptive names, document team-specific commands, and inspect what a command expands to before using it on important files or remote systems.
Keep clipboard and terminal history distinct
A terminal scrollback buffer, shell history, and clipboard history are three different records. Each can retain data independently. If a command contains a token or secret, avoid saving it in shell history, clear the corresponding clipboard item, and rotate the credential if it may have been exposed.
Start with a small convention
Try the naming and environment convention on one project first. If it reduces mistakes, apply it to the rest of your sessions. See also our terminal and clipboard workflow guide for moving ordinary snippets between a shell and other apps.