Destroying the Mahloness of $\kappa$ with a forcing of size $\kappa$ that is $\alpha$-distributive for all $\alpha<\kappa$ Exercise 21.4 of Jech's Set Theory says:

Let $\kappa$ be an inaccessible cardinal. There is a notion of forcing $(P,<)$ such that $|P| = \kappa$ and $P$ is $\alpha$-distributive for all $\alpha < \kappa$, and such that $\kappa$ is not a Mahlo cardinal in the generic extension.

The hint below says:

Forcing conditions are sets $p \subseteq \kappa$ such that $|p \cap \gamma| < \gamma$ for every regular $\gamma \leq \kappa$; $p \leq q$ if and only if $p$ is an end-extension of $q$, i.e., if $q = p \cap \alpha$ for some $\alpha$. To show that for any $\alpha < \kappa$, $P$ does not add any new $\alpha$-sequence, observe that for every $p$ there is a $q \leq p$ such that $P_q = \{r \in P : r \leq q\}$ is $\alpha$-closed.

While it was not difficult proving that the $P$ in the hint is $\alpha$-distributive, I'm not sure how we have $\kappa$ is not Mahlo in $V[G]$. My guess is that $P$ adds a stationary subset of $\kappa$ that does not intersect the regular cardinals below $\kappa$, so I tried the most straightforward approach of taking $\bigcup G$. Yet it does not seem to be club.
 A: Let me modify $P$ so that conditions are closed subsets of $\kappa$ (everything else is left unchanged). I'm afraid I don't see why $P$ as Jech has defined it destroys the Mahloness. If conditions are not closed, then the generic object is just stationary, not club, and we need a club set that misses the inaccessibles below $\kappa$ to show that $\kappa$ is not Mahlo in the extension.
Let $\dot C$ be a name for the generic club $\bigcup \dot G$.

Claim: $\dot C$ is forced to be club in $\kappa$.
Proof: Unbounded: Fix $\alpha_0<\kappa$ and put $p_0:=\{\alpha_0\}$. Given $\alpha_n$ and $p_n$, find $\alpha_{n+1}> \max\{\sup(p_n),\alpha_n\}$ and $p_{n+1}\le p_n$ such that $\alpha_{n+1}\in p_{n+1}$. Put $\alpha_{\omega}=\sup_n \alpha_n$ and $p_{\omega}=\bigcup_n p_n\cup \{\alpha_{\omega}\}$. It is easy to see that $p_\omega$ is a condition forcing $\alpha_\omega$ into the generic object.
Closed: Suppose we had $p\in P$ and $\alpha<\kappa$ such that $p\Vdash \alpha\in\lim(\dot C)\setminus\dot C$. We may assume, extending $p$ if necessary, that $p$ has a largest element. Note that we must have $\alpha<\max(p)$ (else we could just add $\alpha$ into $p$ and get an extension forcing $\alpha$ into the generic object). But then $\alpha$ must be a limit point of $p$. Suppose otherwise and fix $G$ which is $P$-generic over $V$ and contains $p$. Find $q\le p$ such that $\alpha\in q$. This is impossible. So $\alpha\in\lim(p)\subseteq p$.

Let $G$ be $P$-generic over $V$ and $$S=\{\gamma<\kappa:(\gamma\text{ is inaccessible})^V\}=\{\gamma<\kappa:(\gamma\text{ is inaccessible})^{V[G]}\}$$ (because $P$ adds no bounded subsets of $\kappa$). Suppose $S\cap\lim({\dot C}_G)\neq\emptyset$. Take some $p\in G$ and $\gamma\in S$ with $\gamma\in \lim(p)$. By definition, $|p\cap \gamma|<\gamma$, so $p\cap \gamma$ is bounded in $\gamma$, contradicting that $\gamma$ is a limit point of $p$.
This shows that $S$ misses a club, so $S$ is non-stationary in the extension. In particular, $\kappa$ is not Mahlo in $V[G]$. Note that, since $P$ adds no bounded subsets of $\kappa$, $\kappa$ remains inaccessible in the extension.
A: In $V[G]$, $X := \bigcup G$  is an unbounded subset of $\kappa$. Moreover, by the distributivity claim, $\kappa$ is still regular.
Consider the club $\lim (X) = \{ \alpha : X \cap \alpha \text{ is unbounded in } \alpha \}$ (This is always a club). If $S$ is stationary, where $S$ is the set of regular cardinals, then $X \cap S \neq \emptyset$. Say $\lambda \in X \cap S$. Then $\lambda$ is a regular cardinal and $C \cap \lambda$ is unbounded in $\lambda$. $\lambda$ also was a regular cardinal in $V$ (the property of being regular is downwards absolute). Then there must have been a condition $p \in G$, with $X \cap \lambda \subseteq p$. This is a contradiction.
